[Klug-general] Auto trash emptying?

Laurence Southon laurence at southon.uk.net
Mon Mar 4 12:31:07 UTC 2013


On 04/03/13 11:07, Paul Littlefield wrote:
> $ /usr/bin/find /path/to/folder -type f -mtime +7 -exec rm {} \; -print

Yes, that will work for deleting files, as only files will be returned
with "-type f".

Sharon is trying to delete directories as well, so no "-type f" in her
script.

Suspect that's where the problem lies, find is getting confused if it's
trying to exec on a file that has already been deleted.

Never actually done this, but I'd be tempted to do two runs: find files
and delete them, then find directories and delete them?


LS
-- 
Laurence Southon
Tiger Computing, Bexley
www.tiger-computing.co.uk



More information about the Kent mailing list