Mal*_*rba 39 cron-jobs scripts cron
如果我将一个 shell 脚本放在 中/etc/cron.daily/
,它将在一天中的什么时间执行?
Dai*_*hiF 43
大约早上 7:35,但确切的时间取决于 anacron。
默认情况下,cron 将 /etc/cron.daily 作业的运行委托给 anacron。/etc/crontab 包含以下行:
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
Run Code Online (Sandbox Code Playgroud)
但这定义了未安装anacron 时的行为
安装 anacron 后,cron.daily 作业的运行由 /etc/anacrontab 中的条目控制:
1 5 cron.daily nice run-parts --report /etc/cron.daily
Run Code Online (Sandbox Code Playgroud)
这表示每天运行一次这些作业,延迟 5 分钟。
anacron 本身由 cron 运行,如文件 /etc/cron.d/anacron 中所指定,它在早上 7:30 运行 anacron。
Oct*_*ean 41
查看/etc/crontab
它应该在06:25运行。
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
81453 次 |
最近记录: |