Logrotate not working

I think that weekly means that logrotate wants to see at least a week old entry for your access.log file in order to rotate it. Hence the problem seems to be that you are not storing the state entry to trigger the rotation. Here is a stepped through example of the simple of case, of … Read more

logrotate not rotating the logs

A common issue is when you first setup a daily logrotate.d entry, it will not rotate the first day. When you use a time based rotation (daily/weekly/monthly) logrotate scribbles a date stamp of the last date it saw the file in /var/lib/logrotate/status (or /var/lib/logrotate.status on RHEL systems). The scribbled date becomes the reference date from … Read more

Where does logrotate save its own log?

logrotate does not log anything by default. normally it should be in your cron somewhere, for instance: $ grep -r — ‘logrotate.conf’ /etc/cron* /etc/cron.daily/logrotate:/usr/sbin/logrotate /etc/logrotate.conf You can either run that manually to see what is wrong, or redirect the logrotate output to a file in the above cron to see what happened next day. Likely … Read more

When to use delaycompress option in logrotate?

Your understanding of copytruncate is correct, but the wording in the manpage for delaycompress is a little misleading. More properly, it should say “when some program cannot be told to immediately close it’s logfile” — for instance, if you’re using sharedscripts and the script sends a signal to the process using the log when all … Read more

logrotate daily and size?

If the size directive is used, logrotate will ignore the daily, weekly, monthly, and yearly directives. This is not clear in the documentation when you execute the man logrotate command. However it can be confirmed in practice, and is mentioned in some arbitrary blog posts such as this one. There is a directive called minsize … Read more

logrotating files in a directories and its subdirectories

How deep do your subdirectories go? /var/log/basedir/*.log /var/log/basedir/*/*.log { daily rotate 5 } Will rotate all .log files in basedir/ as well as all .log files in any direct child of basedir. If you also need to go 1 level deeper just add another /var/log/basedir/*/*/*.log until you have each level covered. This can be tested … Read more