Delete old files and folders Script?
Hi LQ,
I need a small script to delete files and folders if they are older than 3 months. I can't seem to find any script that can do this? And it would be sweet if it would maked a small log of what was deleted! Thanks.. /Jesper |
Re: Delete old files and folders Script?
Quote:
|
Re: Re: Delete old files and folders Script?
Quote:
/Jesper |
Try the find command.
I believe you could use the -mtime flag to get what you are looking for. |
Check out tmpwatch. I believe it is pretty standard on most distributions.
NAME tmpwatch - removes files which haven?t been accessed for a period of time SYNOPSIS tmpwatch [-u|-m|-c] [-faqstv] [--verbose] [--force] [--all] [--test] [--fuser ] [--atime|--mtime|--ctime] [--quiet] <hours> <dirs> I run it every night using cron to keep my scratch partition clean. Gerald |
All times are GMT -5. The time now is 10:39 PM. |