#!/usr/bin/perl
########################################################
#
# Perl script para chequear links rotos en el sistema
#
#
########################################################
use warnings;
use File::Find ();
#Directorios a chequear.
@direc=("/usr/local/etc3", "/usr/local/etc4");
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;
foreach $directory (@direc)
{
File::Find::find({wanted => \&wanted}, $directory);
}
exit;
sub wanted {
-l && !-e && print "Broken link: $File::Find::name\n";
}
No hay comentarios:
Publicar un comentario