I'm working on the program which creates a big log file.
I want to handle it with logrotate.
This is a configuration I put to /etc/logrotate.d/:
/var/log/myproject.log {
hourly
maxsize 1
rotate 6
missingok
notifempty
compress
nocreate
copytruncate
su www-data www-data
}
(/var/log/myproject.log has owner www-data)
Commands
sudo logrotate -vf /etc/logrotate.conf
and
sudo logrotate -vf /etc/logrotate.d/myproject
rotate the log correctly.
However, after calling them /etc/cron.hourly is empty. Which means logrotate is not called hourly.
Am I guaranteed to have
logrotatescript in/etc/cron.daily?Does the script check for frequency of update for log files. I.e. if I have
logrotatescript in/etc/cron.dailyand for some log fileXin/etc/logrotate.d/I setweeklysetting, willXbe rotated daily or weekly?Can I just copy-paste
/etc/cron.daily/logrotateto/etc/cron.hourly/? Can I cut-and-paste?Should I add
0anacronfile to/etc/cron.hourly/?Should I do something else to enable hourly logging?