View Single Post
Old 19th December 2005, 14:16
themachine themachine is offline
Senior Member
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts

In that case... with little modification that script i posted should be able to work for you... I would recommend using the "timestamp" check rather than checking to see if it is larger... mainly because the newer files could be smaller in size therefore it wouldn't work.

As far as deleting everything in a directory.... you could just throw that into a cronjob... i.e. -

1 * * * * /bin/rm -rf /path/to/your/directory/* 2>&1 > /dev/null

Put that in the appropriate users crontab (as root rype 'crontab -e -u <username>' and that is all you would need. That line right there will delete everything in '/path/to/your/directory/' but not "directory" itself.

Hope that helps.
Reply With Quote