perl 删除过期文件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/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 $_;
        }
    }
}