Issue
I set the CronJob with cmd :20 * * * * wget –spider -O – http://172.104.177.93/demo > /dev/null 2>&1
is okay, but when running Cronjob with cmd is:20 9 * * * wget –spider -O – http://172.104.177.93/demo > /dev/null 2>&1
,then CronJob does not run. It's hard to understand
Thanks,
Solution
First, we need to distinguish the problem is the cron problem or the command problem, so I recommend you modify the command to 20 * * * * wget –spider -O – http://172.104.177.93/demo >> /tmp/cron 2>&1
and wait the cronjob is executed by cron, then check the /tmp/cron
:
- If the file does not exist, it should be a cron problem, go to check the cron daemon setting. Ubuntu have a help page for it.
- If the file exists, it should be the command problem, go to check the error message in the
/tmp/cron
and fix the problem.
Answered By - Jimms Hsieh