Request some help please

Anthony Ventimiglia ant at mongrel.dogpound
Sat Aug 24 23:42:53 EDT 2002


On Sat, 24 Aug 2002 13:09:20 -0700, chen lee 
<clob at ber.com> wrote:
> I need to be able to watch a linux directory and remove all file that
> are over 4 housr old .  Is this possoble with python or should I just
> use perl to do it?

If you're on a *nix system, I'd use find in a cron job, the following
line in your crontab should do it:

0 */1 * * * 	find /dir -amin +4 -exec rm {} \;

That will run every hour and remove every file in /dir that hasn't been
accessed in the last 4 hours.



More information about the Python-list mailing list