Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
472 B

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