[colug-432] Script Help

Tom Hanlon tom at functionalmedia.com
Mon Mar 8 23:24:33 EST 2010


Colug,

Any advice on how to create a script that deletes files older than a  
week ?

The backup script is creating files in a subdirectory per database, so  
I will have like 3 folders.

The files are named..
mysql_2010-03-05_02h02m.Friday.sql.gz

Once the file is created it is not moved.. So in addition to the date  
encoded in the name we also have the ability to delete based upon  
creation time

-rw-r--r--   1 root     root         424 Mar  9 02:02  
mysql_2010-03-09_02h02m.Tuesday.sql.gz

Thanks for any advice..

I will run man ls , after I send this and probably see what I need to  
filter on. Then again by the time I get back to my email you all will  
have multiple ways to skin this cat as well.

Thanks.

--
Tom 


More information about the colug-432 mailing list