drxd54816 2015-12-07 05:58
浏览 40

CRON服务在自动运行时无法正常工作

I'm using cPanel to run a CRON JOB on my website every night at midnight.

/usr/bin/wget http://domain.com?iscron=yes&token=jf094h0werg&service=close

I have an email that gets sent out from the CRON Daemon, that tells me cPanel executed the CRON JOB. This fires at midnight, without any problems.

I have another email setup IN the CRON job, that lets me know that the service actually executed. This does NOT get sent at midnight. (Like I would expect.)

None of the CRON actions seem to run, when the CRON JOB gets launched automatically. However, when I run the CRON JOB manually, everything works perfectly.

does someone with a bit more experience have any idea why this would be happening?

tl;dr - CRON JOB isn't executing automatically, but works perfectly when run manually.

  • 写回答

1条回答 默认 最新

  • dongpu5874 2017-08-16 19:10
    关注

    Did you try running the cron like this:

    wget --spider http://your_domain.tld?iscron=yes&token=jf094h0werg&service=close
    

    Wget basically tries to download the content from the provided link so you'll have to instruct wget to act as a spider and execute URL not downloading it.

    评论

报告相同问题?