Here is a way to tar up a set of important directories with the date. You can use this as a log archive, or with Splunk. This uses the highest compression of gzip (-9).
tar cp /myapp/logs /var/log/messages /var/log/httpd/ | gzip -9c > /tmp/oldlogs`date +"%Y%m%d"`.tgz
No comments:
Post a Comment