[prog] bash script

Cynthia Kiser cnk at ugcs.caltech.edu
Mon Apr 9 20:32:53 UTC 2007


Have your script run a find in the trash using the flags for mtime and
then exec rm. Something like:

	find ~/trash -mtime +7 -exec rm {} \;

Please read and test before you replace "-print" with "-exec rm {} \;"

Quoting Wolf Rising <wolfrising at gmail.com>:
> I would like to run a little bash script at log out to empty any files
> from the trash that are at least 7 days old. I can figure out how to
> delete the trash at log out but not how to
> set it to only delete files that are at least 7 days old. Could anyone toss 
> me
> a hint or two? I was thinking find with a delete parameter might work....
> 
> Thanks!!
> _______________________________________________
> Programming mailing list
> Programming at linuxchix.org
> http://linuxchix.org/mailman/listinfo/programming

-- 
Cynthia N. Kiser



More information about the Programming mailing list