3 # this script looks for all files with an access date older than
4 # $maxage days and deletes them.
5 # Empty directories will be deleted afterwards
8 $dirpath = "/data/.recycle";
11 # delete all old files
12 @a=`find $dirpath -atime +$maxage`;
15 print "deleting file: $_";
16 $r = `rm -f $_ 2> /dev/zero`;
19 # delete all empty directories
20 @a=`find $dirpath -type d | sort -r`;
23 print "deleting directory: $_";
24 $r = `rmdir $_ 2> /dev/zero`;