Tuesday, December 30, 2008

Script to manage syslog-ng files

#!/bin/sh
#
# miw 9/20/07
#
# gzip any syslog-ng logfiles older than 7 days
find /var/log/perhost -name "*.log*" -mtime +7 -exec /bin/gzip {} \;

# clear out the syslog-ng logfiles older than 21 days
find /var/log/perhost -name "*log*.gz" -mtime +21 -exec /bin/rm -f {} \;

No comments: