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