在审查我接pipe的环境时,我发现Amazon Linux默认使用anacron,这意味着cron.weekly作业在3a.m之间执行。 下午10点 而且 – 我发现每周工作都会执行两次 :每个星期三和每个星期天。 / etc / anacron看起来像默认的:
SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # 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
根据这个我有一个重要的和不重要的问题:
[重要]在服务器上使用anacron是否是一个很好的做法,例如更短的时间范围(1a.m.-5a.m.而不是3a.m.-10p.m.)或者我应该切换到cron ?
[不重要]为什么每周的任务每周执行两次 ? (/ var / spool / cron /为空,/ etc / crontab没有项目; / var / log / messages只包含DHCP请求项目,/ var / log / cron包含将运行作业的信息)
提前致谢!
ALX