Cron的时间问题
# dateTue Nov 20 20:06:06 CST 2012
# ll
-rw-r--r--1 rootwheel4158 Nov 19 19:49 ftp.log.20121120
# crontab -l
0 0 * * * /root/ftplog.sh
有一个脚本设定时间为每天0点运行,CP一个ftplog过来,但是实际执行时间却根本不是0点,比较奇怪。察看系统时间是正确的,但是执行时间就是乱的,感觉就是每天不定时去运行。大家碰到过吗? 换我,会设置成
1 0 * * *
因为不确定lz的写法到底有没有. 先看看cron.log怎么说呗? 不过看man应该是可以的.
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sun, or use names)
A field may be an asterisk (*), which always stands for ``first-last''.
写法正确,看/var/log/cron.log日志 嘿嘿
我一般也不写到0分, cron.log没有错误信息。脚本使用的都是绝对路径。
昨天重新调整了系统时间,今晚继续观察。 我又确认了一下,零也没问题:
0 * * * */bin/echo "abcdef" >> /home/test.txt
还是时间不对,脚本是被正确执行的,就是执行时间不对,太奇怪了! 现在怎么样了 #_# :emn31:
页:
[1]
2