#!/usr/bin/perl
`find /bak/ >list.txt`;
open LIST,"/root/list.txt";
while (<LIST>){
chomp;
open TEST,"$_";
if ( -d TEST ){
close TEST;
}
else{
close TEST;
$mtime= -M $_;
if ($mtime > 60){
print "$_ old than 60 day!!\n";
unlink $_;
}
}
}
#!/usr/bin/perl
`find /bak/ >list.txt`;
open LIST,"/root/list.txt";
while (<LIST>){
chomp;
open TEST,"$_";
if ( -d TEST ){
close TEST;
}
else{
close TEST;
$mtime= -M $_;
if ($mtime > 60){
print "$_ old than 60 day!!\n";
unlink $_;
}
}
}