2017-02-26 60 views
0
uname -r 
4.5.5-300.fc24.x86_64 

我已将0 0 test touch ~/ana.cron追加到/etc/anacrontab。但重新启动或从睡眠中恢复或运行后没有任何影响sudo anacron -f。我找不到输出文件ana.cron如何测试命令anacron?

cat /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=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 
0 0 test touch ~/ana.cron 

如何解决这个问题?

回答

0

我不知道可以是0

1 0 test.daily nice run-parts touch ~/ana.cron 

如果你希望你的任务在启动时运行,然后使用@reboot

@reboot test.reboot nice run-parts touch ~/ana.cron 
+0

我曾尝试你的代码' @reboot test.reboot touch〜/ ana.cron'。这是行不通的。 –

+0

@BigShield,那么这个'很好的零件'必须是必需的?看我的编辑。 – Jika