[colug-432] Script Help

David Coulson david at davidcoulson.net
Thu Mar 11 10:31:06 EST 2010


find /path -type f -mtime +8 -exec /bin/rm -f {} \; > /dev/null

On 3/11/10 10:27 AM, Mike Haun wrote:
> Hi Tom,
> Did you get this resolved?  I have one running that I'll look up if 
> you need it.
> Mike
>
>
> On Mon, Mar 8, 2010 at 11:24 PM, Tom Hanlon <tom at functionalmedia.com 
> <mailto:tom at functionalmedia.com>> wrote:
>
>     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
>     _______________________________________________
>     colug-432 mailing list
>     colug-432 at colug.net <mailto:colug-432 at colug.net>
>     http://lists.colug.net/mailman/listinfo/colug-432
>
>
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20100311/7b9d09c7/attachment.html 


More information about the colug-432 mailing list