logrotate運行時間指定


Edit in /etc/crontab the line that says

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

so that the 25 6 reads 0 0. This will make it so that all scripts in /etc/cron.daily runs at midnight.

If you only want to make logrotate run at midnight, move /etc/cron.daily/logrotate to some other directory, and add the line

0 0    * * *   root    /new/path/to/logrotate/script

at the end of /etc/crontab.

參考:https://askubuntu.com/questions/24503/specify-the-time-of-daily-log-rotate


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM