This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 2
[perl5.git] / eg / van / vanexp
1 #!/usr/bin/perl
2
3 # $RCSfile: vanexp,v $$Revision: 4.1 $$Date: 92/08/07 17:20:53 $
4
5 # This is for running from a find at night to expire old .deleteds
6
7 $can = $ARGV[0];
8
9 exit 1 unless $can =~ /.deleted$/;
10
11 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
12    $blksize,$blocks) = stat($can);
13
14 exit 0 unless $size;
15
16 if (time - $mtime > 2 * 24 * 60 * 60) {
17     `/bin/rm -rf $can`;
18 }
19 else {
20     `find $can -ctime +2 -exec rm -f {} \;`;
21 }