给 crontab 添加了任务,但是不知道为什么不执行,检查了下,看了下 log 文件,确实没执行,不知道哪里出了问题。
[root@localhost /]# crontab -l
1 * * * * root date > /tmp/date.log
[root@localhost tmp]# date
Mon Jul 9 02:39:29 EDT 2018
[root@localhost tmp]# ls
crontab.cIbRuo
log
Jul 9 02:29:31 localhost crontab[21567]: (root) END EDIT (root)
Jul 9 02:29:46 localhost crontab[21600]: (root) LIST (root)
Jul 9 02:29:47 localhost crontab[21602]: (root) LIST (root)
Jul 9 02:30:02 localhost crond[21551]: (CRON) INFO (running with inotify support)
Jul 9 02:30:12 localhost crontab[21648]: (root) BEGIN EDIT (root)
Jul 9 02:30:17 localhost crontab[21648]: (root) END EDIT (root)
Jul 9 02:30:29 localhost crond[21712]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 14% if used.)
Jul 9 02:30:30 localhost crond[21712]: (CRON) bad username (/etc/crontab)
Jul 9 02:30:33 localhost crond[21712]: (CRON) INFO (running with inotify support)
Jul 9 02:30:33 localhost crond[21712]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Jul 9 02:30:35 localhost crontab[21714]: (root) LIST (root)
Jul 9 02:30:36 localhost crontab[21716]: (root) LIST (root)
Jul 9 02:30:38 localhost crontab[21718]: (root) LIST (root)
Jul 9 02:31:07 localhost crontab[21782]: (root) BEGIN EDIT (root)
Jul 9 02:31:13 localhost crontab[21782]: (root) REPLACE (root)
Jul 9 02:31:13 localhost crontab[21782]: (root) END EDIT (root)
Jul 9 02:31:28 localhost crond[21815]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 72% if used.)
Jul 9 02:31:29 localhost crond[21815]: (CRON) bad username (/etc/crontab)
Jul 9 02:31:31 localhost crond[21815]: (CRON) INFO (running with inotify support)
Jul 9 02:31:31 localhost crond[21815]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Jul 9 02:34:01 localhost crond[21815]: (localhost.localdomain.tmp.XXXXMdDmOK) ORPHAN (no passwd entry)
Jul 9 02:38:24 localhost crontab[21929]: (root) LIST (root)
Jul 9 02:38:28 localhost crontab[21931]: (root) LIST (root)
Jul 9 02:38:30 localhost crontab[21933]: (root) BEGIN EDIT (root)
Jul 9 02:38:41 localhost crontab[21933]: (root) REPLACE (root)
Jul 9 02:38:41 localhost crontab[21933]: (root) END EDIT (root)
Jul 9 02:39:01 localhost crond[21815]: (root) RELOAD (/var/spool/cron/root)
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.