mirror of
https://github.com/opnsense/src.git
synced 2026-02-22 17:32:57 -05:00
21 lines
485 B
Perl
21 lines
485 B
Perl
#!/usr/bin/perl
|
|
|
|
# $Header: /home/cvs/386BSD/ports/lang/perl/eg/van/vanexp,v 1.1.1.1 1993/08/23 21:29:45 nate Exp $
|
|
|
|
# This is for running from a find at night to expire old .deleteds
|
|
|
|
$can = $ARGV[0];
|
|
|
|
exit 1 unless $can =~ /.deleted$/;
|
|
|
|
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
|
|
$blksize,$blocks) = stat($can);
|
|
|
|
exit 0 unless $size;
|
|
|
|
if (time - $mtime > 2 * 24 * 60 * 60) {
|
|
`/bin/rm -rf $can`;
|
|
}
|
|
else {
|
|
`find $can -ctime +2 -exec rm -f {} \;`;
|
|
}
|