Show pageBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== How to change CUPS logrotate schedule ===== CUPS logrotate is configured in ''/etc/logrotate.d/cups-daemon''. By default, logrotate is performed daily, and after the rotate CUPS is restarted. <file txt /etc/logrotate.d/cups-daemon> /var/log/cups/*log { daily missingok rotate 7 sharedscripts postrotate invoke-rc.d --quiet cups restart > /dev/null endscript compress delaycompress notifempty create } </file> By default, the installation of logrotate creates a crontab file inside ''/etc/cron.daily'' named ''logrotate''. As it is the case with the other crontab files inside this directory, it will be executed daily starting at ''6:25 am'' if anacron is **not** installed. Otherwise, the execution will begin around ''7:35 am''. To verify, watch for the line containing ''cron.daily'' in either ''/etc/crontab'' or ''/etc/anacrontab''. //How does this happen?// Taking Ubuntu 16.04 defaults as example: <file txt /etc/crontab> ... 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) ... </file> > If anacron exists, ''test -x /usr/sbin/anacron'' will return true, and prevent the second half of that line from running: in that case ''/etc/cron.d/anacron'' must be edited to change daily scheduled time, since that's the config that will kick off anacron itself. <file txt /etc/cron.d/anacron> 30 7 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null </file> > anacron is started at ''7:30 am'', but hang on ... the actual anacron behavior is configured in ''/etc/anacrontab'' <file txt /etc/anacrontab> ... # These replace cron's entries # 1 = daily, 5 = number of minutes anacron waits, before executing the job. 1 5 cron.daily run-parts --report /etc/cron.daily ... </file> > So, effectively, CUPS daily logrotate is kicked off at ''7:30 am'' by anacron, but the actual rotate is executed after a 5 minutes wait, at ''7:35 am'' (( See [[https://www.linux.org/docs/man5/anacrontab.html|anacron manpage]] )). ==== anacron: logrotate daily at 6:35am ==== <code bash> sudo vi /etc/cron.d/anacron </code> ... and change line like this: <code> 30 6 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start </code> ==== Change time interval ==== [[https://www.linux.org/docs/man5/logrotate.html|man logrotate]] <code bash> sudo vi /etc/logrotate.d/cups-daemon # change daily to weekly, monthly, yearly </code> howto/cups/logrotate.txt Last modified: 2019/09/16 10:26by rijk