![]() |
|||||
|
"exact phrase" include -exclude
will give you more specific results |
Setup Logrotate [2/2]We will create a file called /etc/logrotate.d/httpd. Below is the configuration file that i have set in logrotate for this service. Next paragraph i will explain in details each logrotate directive I have used. /var/log/httpd/*log {# That is where my logs are being saved. /var/log/httpd/*log { # rotate log files weekly weekly # rotates keeps logs for 5 weeks then overwrites. rotate 5 # tells logrotate not to rotate a log if it's already empty notifempty # tells logrotate not to issue an error if the log file is missing missingok # The rotating scripts are only run once, no matter how many logs match the wildcarded pattern. sharedscripts # contains a block of instructions on what logrotate should do after the logs have been rotated. In our case we kill apache server so we can make it work with the new log files. postrotate /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true endscript } [ib] Additional useful parameters [/ib]: copytruncate - copytruncate tells logrotate to copy and truncate the original log file in place instead of renaming it and creating a new logfile. Some programs work better with this behavior compress - tells logrotate to compress old logs when they are rotated
|
RECOMMENDED TUTORIALS
Need a specific tutorial? Do not hesitate and submit a request! |
|||
| Related Tags: setup logrotate setup logrotate how to setup logrotate logrotate setup setup logrotate in linux logrotate logrotate how logrotate how to how to set up logrotate logrotate tutorial | |||||
|
Home | Sitemap |
Terms & Privacy
© ONLINEHOWTO.net 2006 - 2008 |
|||||