给 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)
1
qsnow6 OP 解决了,本来打算是每分钟执行一次的,应该写成*/1 * * * *
|