Commit | Line | Data |
378cc40b |
1 | #!/usr/bin/perl |
2 | |
fe14fcc3 |
3 | # $Header: vanexp,v 4.0 91/03/20 01:15:54 lwall Locked $ |
378cc40b |
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 | } |