/ etc / crontab中设置的默认时间背后的故事是什么?

据我了解,这是/etc/crontab的默认配置:

 # mh dom mon dow user command 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 ) 

为什么选择这些特定时间作为默认条目?

起初我假设它们在安装时有点随机化以均衡系统负载,但这似乎不正确。

Ubuntu始于2004年,基于Debian。 到那时,当前的crontab存在,所以我们可以追溯到Debian的历史,找到它的起源。

这是来自Debian 0.93R6(1995年11月)的crontab。 小时存在,但cron.daily条目的分钟不同:

 # mh dom mon dow user command 42 6 * * * root run-parts /etc/cron.daily 47 6 * * 7 root run-parts /etc/cron.weekly 52 6 1 * * root run-parts /etc/cron.monthly 

通过Debian 2.1(2009年3月9日),它发生了变化。 cron.hourly条目尚未出现,但其余时间与目前相同:

 25 6 * * * root run-parts --report /etc/cron.daily 47 6 * * 7 root run-parts --report /etc/cron.weekly 52 6 1 * * root run-parts --report /etc/cron.monthly 

值得庆幸的是,Debian有更改日志,因此我们可以看到为什么要进行此更改。 我已经链接了错误号,感谢Debian保留的:

  • 做cron.daily一点,尽量避免与cron.weekly重叠(关闭: Bug#23023 )(从3.0pl1-46)

现在,找出6 AM和47和52来自哪里,你将不得不回到Debian之前的历史。 我检查了原始的Vixie Cron来源 ,它似乎并非来自那里。

据我所知, SLS 1.03没有发布cron,但是SLS 1.05没有。 但是,它似乎没有附带/ etc / crontab,并且联机帮助页中的示例不同。 它也没有run-parts

从Debian 0.93R6(包miscutils)看运行部件,它似乎是一个特定于Debian的工具(当时是一个简短的Perl脚本)。 所以那些cron行可能源于早期的Debian开发。