[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cobalt-users] Log rotation .. renaming rotated logs
- Subject: [cobalt-users] Log rotation .. renaming rotated logs
- From: "Jean-Francois Fortin" <jffortin@xxxxxxxxxxxx>
- Date: Mon Jun 10 12:31:01 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
I want to keep rotated logs for further offline processing. So I would
like the rotated logs named somewhat according to the date they
relate to...(for example : access_20020610.log.gz)
I currently have this in /etc/logrotate.d/apache :
/var/log/httpd/access {
prerotate
/usr/local/sbin/split_logs web < /var/log/httpd/access
endscript
missingok
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
daily
}
.... So if the rotation takes place then there should be a file named
access.1.gz in /var/log/httpd
If I would change the postrotate script to :
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
mv /var/log/httpd/access1.gz /var/log/httpd/access_`date
+'%Y%m%d'`.log.gz
endscript
Would that work ?