在/etc/cron.daily/ ,
我明白上面是每日cron工作。 如何显示为logrotate和makewhatis.cron设置的时间?
它没有列出,当我尝试这个脚本:
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
检查/etc/anacrontab
克朗运行anacron,然后运行cron.daily /每周/每月…
如果你有默认的文件,你会看到类似于:
# /etc/anacrontab: configuration file for anacron # the maximal random delay added to the base delay of the jobs RANDOM_DELAY=45 # the jobs will be started during the following hours only START_HOURS_RANGE=3-22 #period in days delay in minutes job-identifier command 1 5 cron.daily nice run-parts /etc/cron.daily 7 25 cron.weekly nice run-parts /etc/cron.weekly @monthly 45 cron.monthly nice run-parts /etc/cron.monthly
基本上,这意味着/etc/cron.daily/中的作业将从凌晨3:05开始连续运行,最多可延迟45分钟。
例如,您可以通过search日志来查看maketimeis在过去的运行时间:
# grep makewhatis /var/log/cron /var/log/cron:Jan 25 03:35:20 xt run-parts(/etc/cron.daily)[21432]: starting makewhatis.cron /var/log/cron:Jan 25 03:35:21 xt run-parts(/etc/cron.daily)[21776]: finished makewhatis.cron /var/log/cron:Jan 26 03:39:21 xt run-parts(/etc/cron.daily)[54618]: starting makewhatis.cron /var/log/cron:Jan 26 03:39:33 xt run-parts(/etc/cron.daily)[58997]: finished makewhatis.cron /var/log/cron:Jan 27 03:40:15 xt run-parts(/etc/cron.daily)[56366]: starting makewhatis.cron /var/log/cron:Jan 27 03:40:16 xt run-parts(/etc/cron.daily)[56710]: finished makewhatis.cron