New answers tagged

0

You could also consider the use of cronolog, which allows you to write the log files with "today's" date. ErrorLog "|/usr/bin/cronolog /var/log/httpd/error.log-%Y%m%d" CustomLog "|/usr/bin/cronolog /var/log/httpd/access.log-%Y%m%d" combined This avoids the need to use logrotate. To remove log files older than 60 days you would instead add a pair of ...


1

To be safe: none at all. Logrotate assumes that once the postrotate command has finished, the log file will not be written to anymore. There are two ways to deal with "closing log files might take a while": logrotate's delaycompress option postpones the compression step until the next logrotate invocation. That way, it can take up to however long it takes ...


0

Log rotation should probably be initiated more than once a day, probably every hour. The decision to actually rotate the logs or not should be left to the log rotation facility (logrotate in your case), not to cron. By invoking logrotate once every 24 hours, the following scenario will likely happen: cron initiates the log rotation job at X (a time). ...


0

Adding delaycompress to the configuration section for /var/log/ will solve the problem. From man logrotate: delaycompress Postpone compression of the previous log file to the next rota‐ tion cycle. This only has effect when used in combination with compress. It can be used when some program cannot be told to close its ...



Top 50 recent answers are included