Commit | Line | Data |
---|---|---|
378cc40b | 1 | #!/usr/bin/perl |
2 | ||
3 | # $Header: vanexp,v 2.0 88/06/05 00:17:34 root Exp $ | |
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 | } |