doushen2154 2019-07-31 10:43
浏览 130

Cronjob wget以不可预测的间隔多次触发http请求

I setup the crons in ubuntu server for php services using wget and I run crons on every 5 min. It was worked good for some days. Recently, I got an issue that service is running twice or thrice (as per output of application logs) but cron ran for only one time (as per syslog).

I have gone through with link Why is this cron entry executed twice? but it didn't work for me. I have only one PID (ps -aux | grep 'cron') and I restarted,stopped,started the cron service (service cron restart/stop/start) but none of them worked for me. So finally I restarted the server as cron job is init service but after restarting also, I got same issue.

Cron running as root user.

Cron:

*/5 * * * * /usr/bin/wget --no-check-certificate  https://**********/controlller/method

From Syslog:

Jul 31 12:05:01 web-server CRON[26997]: (root) CMD (/usr/bin/wget --no-check-certificate  https://xx.xx.xx.xx/controller/method)
Jul 31 12:10:01 web-server CRON[27222]: (root) CMD (/usr/bin/wget --no-check-certificate  https://xx.xx.xx.xx/controller/method)
Jul 31 12:15:01 web-server CRON[27470]: (root) CMD (/usr/bin/wget --no-check-certificate  https://xx.xx.xx.xx/controller/method)
Jul 31 12:20:01 web-server CRON[27768]: (root) CMD (/usr/bin/wget --no-check-certificate  https://xx.xx.xx.xx/controller/method)

ps -aux | grep 'cron'
root      1079  0.0  0.0  26012   696 ?        Ss   Jul30   0:03 cron

From Application logs:

31 Jul 2019 12:05:01 [26836] DEBUG [xx.xx.xx.xx]:entered into controller/method
31 Jul 2019 12:05:01 [26922] DEBUG [xx.xx.xx.xx]:entered into controller/method
31 Jul 2019 12:13:00 [27378] DEBUG [xx.xx.xx.xx]:entered into controller/method
31 Jul 2019 12:13:01 [27376] DEBUG [xx.xx.xx.xx]:entered into controller/method
31 Jul 2019 12:23:47 [27733] DEBUG [xx.xx.xx.xx]:entered into controller/method
31 Jul 2019 12:23:47 [27674] DEBUG [xx.xx.xx.xx]:entered into controller/method

From Apache2 access logs:

xx.xx.xx.xx - - [31/Jul/2019:12:05:01 +0200] "GET /controller/method HTTP/1.1" 200 6914 "-" "Wget/1.15 (linux-gnu)"
xx.xx.xx.xx - - [31/Jul/2019:12:05:01 +0200] "GET /controller/method HTTP/1.1" 200 6909 "-" "Wget/1.15 (linux-gnu)"
xx.xx.xx.xx - - [31/Jul/2019:12:13:01 +0200] "GET /controller/method HTTP/1.1" 200 6862 "-" "Wget/1.15 (linux-gnu)"
xx.xx.xx.xx - - [31/Jul/2019:12:13:00 +0200] "GET /controller/method HTTP/1.1" 200 6862 "-" "Wget/1.15 (linux-gnu)"
xx.xx.xx.xx - - [31/Jul/2019:12:23:47 +0200] "GET /controller/method HTTP/1.1" 200 6862 "-" "Wget/1.15 (linux-gnu)"
xx.xx.xx.xx - - [31/Jul/2019:12:23:47 +0200] "GET /controller/method HTTP/1.1" 200 6862 "-" "Wget/1.15 (linux-gnu)"
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料