我正在尝试运行五月日志旋转器,使用下面的anacron设置,在11:59pm作为日常任务运行它。
我当前的/etc/anacrontab设置
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
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=0
# the jobs will be started during the following hours only
START_HOURS_RANGE=23-23
#period in days delay in minutes job-identifier command
1 59 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但这不管用。可能的原因是开始时间范围=23-23,即无效范围。有什么办法,我可以设置它,以便它将运行每天正好11:59下午?(如果服务器正在运行)
最后一个anacron日运行时间是(var/spool/anacron/cron.day) 20180322
我的cron日志
run-parts(/etc/cron.hourly)[31456]: starting 0anacron
Mar 27 11:01:01 ********[31467]: Anacron started on 2018-03-27
Mar 27 11:01:01 ******** anacron[31467]: Normal exit (0 jobs run)任何帮助都是有价值的。谢谢
发布于 2018-03-27 06:22:03
如果服务器运行强烈地表明您正在使用Anarcon,而实际上应该使用Cron,则您要求每天11:59PM运行此作业。Anacron被设计成每天运行作业,而不考虑机器打开的时间,而您的目标是在固定的分钟内运行它们。要做到这一点,一个简单的任人唯亲就可以做到这一点:
59 23 * * * commandhttps://serverfault.com/questions/904727
复制相似问题