[colug-432] Script Help: deleting old files: find foo -type f-mtime +6 -exec rm {} \;

Greg Sidelinger gate at ilive4code.net
Tue Mar 9 17:26:11 EST 2010


On Redhat system you can also use tmpwatch but as Jim suggested find is a more portable solution.

Greg


On Mar 8, 2010, at 11:33 PM, jep200404 wrote:

> Tom Hanlon wrote:
> 
>> Any advice on how to create a script that deletes files older than a  
>> week ?
> 
> I think the classic solution is to use find, 
> with a command that looks something like: 
> 
>   find foo -type f -mtime +6 -exec rm {} \;
> 
> I've not tested the above. You'll definitely need to experiment and 
> read the man page for find. Also explore -mmin. 
> 
> Jim
> 
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
> 




More information about the colug-432 mailing list