Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for rotate logs files

Status
Not open for further replies.

Currando

ISP
Feb 13, 2001
25
ES
Hi group,

I need a script for rotate logs files in several directories. The idea is move all log files oldder than 30 days and for this I use the command find with the option "mtime" but i don't know what options are necesary for move all files oldder to another directory.

find /logs -name "*.xlm" -mtime +1 -exec mv -f /rotate {}\;

With this sintaxis the command not work well.

¿Anybody can help me?

Regards.
 
I think you've just got the mv command the wrong way round. Try this ..

find /logs -name "*.xlm" -mtime +1 -exec mv -f {} /rotate \;

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top