Logrotate

Philippe de Rochambeau pderochambeau at iht.com
Mon Jun 6 14:46:53 UTC 2005


Hello,

I am having trouble understanding the following /etc/logrotate.d/ file

httpd:

/var/log/httpd/*log {
     missingok
     notifempty
     sharedscripts
     postrotate
         /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> 
/dev/null || true
     endscript
}
~

The " /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null 
|| true " line apparently means "kill the httpd daemon". But why would 
you want to kill the httpd daemon after rotating the logs? Furthermore, 
what is  "|| true" at the end of the line, for?

Furthermore, how would you write the above configuration file to rotate 
log files whose names contain the current date (e.g., 20050606.log, 
20050607.log, etc.)?

Many thanks.

philippe




More information about the redhat-list mailing list