Newby Question: Remove files older than 7 days from a directory

kbass kbass at midsouth.rr.com
Thu Nov 13 05:29:34 EST 2003


I would like to remove file that are older than 7 days old from a directory.
I can do this in shell script rather easy but I would like to integrate this
functionality into my Python program. How can this be achieved? Which module
can be used to perform this tasks? Thanks!

Shell Script example:   find /path/to/dir -mtime +30 -exec rm '{}' \;


Kevin






More information about the Python-list mailing list