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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find and purge log files 1

Status
Not open for further replies.

ksinbaraj

IS-IT--Management
Joined
May 20, 2004
Messages
4
Location
US
I want to purge the log files, .gz files, which are 7 days older or more.

This is the line I execute to do the job.

/usr/bin/find /var/log/active/*gz -mtime +7 -exec /usr/bin/rm {} \; > /dev/null 2>&1

But it returns with the following error:

bash: /usr/bin/find: The parameter or environment lists are too long.

Please help me out to correct the problem and correct syntax in the script.

thanks

 
/usr/bin/find /var/log/active/*gz -mtime +7 | xargs rm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top