Cron 突然每 15 分钟调用一次脚本

Cron 突然每 15 分钟调用一次脚本

在 Debian 服务器上,我有一个 crontab 条目,应该每天凌晨 04:21 调用一个脚本。

这就是它所做的,直到今天..但现在该脚本每 15 分钟调用一次,没有任何原因!

我已经几个月没有更改 crontab 了!

这是 crontab 行:

21 4 * * * /usr/bin/wget -O /dev/null http://www.domain.tld/tasks/hebdomadaire.php &> /dev/null

这是 Apache 日志 ( cat access.log | grep "hebdomadaire" ):

SERVER_IP - - [28/Mar/2016:04:21:01 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [29/Mar/2016:04:21:01 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [30/Mar/2016:04:21:01 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:04:21:01 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:04:36:02 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:04:51:04 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:05:06:07 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:05:21:11 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:05:36:16 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:05:51:22 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:06:06:30 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:06:21:38 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:06:36:47 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:06:51:57 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"
SERVER_IP - - [31/Mar/2016:07:07:07 +0000] "GET /tasks/hebdomadaire.php HTTP/1.1" 200 454 "-" "Wget/1.13.4 (linux-gnu)"

怎么可能?

答案1

wget 的默认行为(手册中记录)是在默认超时 900 秒(也称为 15 分钟)后重新启动。

添加--timeout=0就解决了这里的问题。

相关内容