Crontab运行时,它喜欢(固定..在某种程度上)

我在crontab中有以下行:

*/30 * * * * /usr/bin/php /home/antoniocs/phpscripts/update-noip/update-noip.php 

这个脚本更新我的非IP帐户。 它还写入一个日志文件,说明它做了什么,没有到期。

这是今天的日志文件:

 2009/08/06 11:30 - A tentar buscar ip 2009/08/06 11:30 - Ip encontrado - ***.***.***.*** 2009/08/06 11:30 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 12:00 - A tentar buscar ip 2009/08/06 12:00 - Ip encontrado - ***.***.***.*** 2009/08/06 12:00 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 12:30 - A tentar buscar ip 2009/08/06 12:30 - Ip encontrado - ***.***.***.*** 2009/08/06 12:30 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 13:00 - A tentar buscar ip 2009/08/06 13:00 - Ip encontrado - ***.***.***.*** 2009/08/06 13:00 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 13:30 - A tentar buscar ip 2009/08/06 13:30 - Ip encontrado - ***.***.***.*** 2009/08/06 13:30 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 14:00 - A tentar buscar ip 2009/08/06 14:00 - Ip encontrado - ***.***.***.*** 2009/08/06 14:00 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 14:30 - A tentar buscar ip 2009/08/06 14:30 - Ip encontrado - ***.***.***.*** 2009/08/06 14:30 - Ip nao alterado - Abortar acesso ao no-ip 2009/08/06 15:00 - A tentar buscar ip 2009/08/06 15:00 - Ip encontrado - ***.***.***.*** 2009/08/06 15:00 - Ip nao alterado - Abortar acesso ao no-ip 

正如你可以看到时间戳,今天开始于11:30,然后停止,15:00。

另外cron正在运行:

 antoniocs@acsserver:~$ /etc/init.d/cron status * cron is running 

我不知道为什么会这样。 前几天,这是运行没有问题(我每30米的日志中有条目)。 我做的唯一的事情是最近升级我的Ubuntu服务器(这导致了我一些其他问题 )

我在这里做错了什么? 有更新搞砸了?

编辑:

这是我在09年7月8日在15:00系统日志(这是今天的日志,但同样的事情发生在15:00后停止)

 146 Aug 7 15:00:01 acsserver CRON[30775]: Mount of private directory return code [0] 147 Aug 7 15:00:01 acsserver /USR/SBIN/CRON[30786]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) 148 Aug 7 15:00:01 acsserver /USR/SBIN/CRON[30811]: (antoniocs) CMD (/usr/bin/php /home/antoniocs/phpscripts/update-noip/update-noip.php ) 149 Aug 7 15:00:01 acsserver /USR/SBIN/CRON[30810]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd hourly 2>/dev/null) 

似乎没有任何错误:(

编辑2:在查看系统日志文件后,我注意到这些行:

 Aug 7 22:10:01 acsserver /USR/SBIN/CRON[6023]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) Aug 7 22:17:01 acsserver /USR/SBIN/CRON[6158]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Aug 7 22:20:01 acsserver /USR/SBIN/CRON[6207]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) Aug 7 22:30:01 acsserver CRON[6336]: Mount of private directory return code [256] Aug 7 22:30:01 acsserver /USR/SBIN/CRON[6350]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) Aug 7 22:30:01 acsserver /USR/SBIN/CRON[6354]: (antoniocs) CMD (/usr/bin/php /home/antoniocs/phpscripts/update-noip/update-noip.php ) Aug 7 22:30:01 acsserver postfix/sendmail[6367]: fatal: open /etc/postfix/main.cf: No such file or directory Aug 7 22:39:01 acsserver /USR/SBIN/CRON[6523]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm) Aug 7 22:40:01 acsserver /USR/SBIN/CRON[6574]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) Aug 7 22:50:01 acsserver /USR/SBIN/CRON[7044]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) Aug 7 23:00:01 acsserver CRON[7173]: Mount of private directory return code [256] Aug 7 23:00:01 acsserver /USR/SBIN/CRON[7193]: (antoniocs) CMD (/usr/bin/php /home/antoniocs/phpscripts/update-noip/update-noip.php ) Aug 7 23:00:01 acsserver /USR/SBIN/CRON[7195]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd hourly 2>/dev/null) Aug 7 23:00:01 acsserver /USR/SBIN/CRON[7196]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null) Aug 7 23:00:01 acsserver postfix/sendmail[7211]: fatal: open /etc/postfix/main.cf: No such file or directory Aug 7 23:09:01 acsserver /USR/SBIN/CRON[7390]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm) 

所以它运行的是PHP脚本。 我只是不知道/etc/postfix/main.cf是什么。 在我的PHP脚本中,我只使用curl来build立连接。

编辑3:

似乎这个问题真的是后缀。 我遵循这些指示 – > https://help.ubuntu.com/7.04/server/C/postfix.html ,只是设置了cron所抱怨的main.cf文件,现在php脚本似乎没问题。

仍然不完全理解为什么发生这种情况。 如果有人有任何理论为什么发生这种事情,为什么我需要后缀来运行我的PHP脚本,请让我知道!

感谢所有的帮助家伙!

PS:另外如果有人知道什么安装错误也请告诉我:(

您最后的“编辑2”日志文件显示您的后缀系统设置不正确。 当cron脚本将输出发送到标准输出或标准错误(例如,脚本中的任何错误消息)时,它会发送一封电子邮件(默认情况下为root @ localhost),并且您需要一个可以运行的邮件服务器。

它看起来非常像你的脚本由于其他原因失败,正在写一些stderr或标准输出,但是因为你没有一个工作的后缀设置你失去了这些信息。 这些错误电子邮件很可能有你需要的信息来确定脚本失败的原因。

当然,这是假设这不是你的错误:Aug 7 22:30:01 acsserver CRON [6336]:私人目录返回代码的装载[256]

无论哪种方式,你应该修复你的后缀设置。

我不太明白这个问题。 你的crontab说每30分钟运行一次(* / 30),而你的日志每运行一次显示3行 – 每30分钟发生一次。

有没有什么你可以从日志翻译,这表明它不是重新运行在:00和:30?

当你说“停止15:00”的时候,你的意思是说你在这之后大大复制了这个日志,并且没有按照你预期的那样在15:30和16:00看到这些日志?