简体   繁体   English

Cron Jobs停止工作

[英]Cron Jobs stopped working

I've been running a daily cron job for a few months and it was working fine. 我已经执行了几个月的日常cron工作,并且工作正常。 The cron job runs a php script that does a database action then mails my email address with the results. cron作业运行一个php脚本,该脚本执行数据库操作,然后将结果发送给我的电子邮件地址。 Suddenly a few days ago, when the script ran, the database action stopped working, but it would send me the email. 几天前突然,当脚本运行时,数据库操作停止工作,但是它将向我发送电子邮件。 I changed the php script to send a different email, but it still sends me the old one. 我更改了php脚本以发送另一封电子邮件,但仍然向我发送了旧的电子邮件。 I can't seem to get any new scripts to run and when I set up an email address for the cron job to run it doesn't send one. 我似乎无法运行任何新脚本,当我为要运行的cron作业设置电子邮件地址时,它不会发送任何脚本。

Any thought as to how I can get this back on track? 是否对如何使它回到正轨有任何想法?

More information: I use a linux OS cPanel. 详细信息:我使用Linux OS cPanel。

I've used the following commands. 我使用了以下命令。 /usr/bin/php -f /home/[user]/public_html/[path to script] /usr/bin/php -q /home/[user]/public_html/[path to script] /usr/local/bin/php -f /home/[user]/public_html/[path to script] /usr/local/bin/php -q /home/[user]/public_html/[path to script] / usr / bin / php -f / home / [用户] / public_html / [脚本路径] / usr / bin / php -q / home / [用户] / public_html / [脚本路径] / usr / local / bin / php -f / home / [用户] / public_html / [脚本路径] / usr / local / bin / php -q / home / [用户] / public_html / [脚本路径]

PHP says that the path to PHP is /usr/bin/php however, it used to work with the local part in there. PHP说,PHP的路径是/ usr / bin / php,但是它曾经与那里的本地部分一起工作。

@DampeS8N- I'd rather not. @ DampeS8N-我宁愿不要。 The PHP script just includes a few sql commands and a mail function. PHP脚本仅包含一些sql命令和一个邮件功能。 It works fine without any errors when visited by browser. 当浏览器访问它时,它运行良好,没有任何错误。 @Paul- That is what I am inclined to believe. @ Paul-这就是我倾向于相信的东西。 I think the Cron Daemon is stuck somehow. 我认为Cron Daemon被卡住了 When I try to add new cron jobs, they don't register as going off, and it won't send emails to my email address when a cron should go off. 当我尝试添加新的cron作业时,它们不会注册为“关闭”,并且当cron应该关闭时,它也不会向我的电子邮件地址发送电子邮件。

I am a complete newbie to cron. 我是cron的新手。 I access cron jobs in my cPanel X. I'm pretty sure I don't use crontab. 我在cPanel X中访问cron作业。我很确定我不使用crontab。 Detailed instructions for any actions you'd like me to take would be great. 您希望我采取的任何操作的详细说明都很好。

Well, I wound up contacting my hosting support. 好吧,我最终联系了我的托管支持。 Turns out the domain was moved to a new server and the cron jobs were still running on the old one. 原来,该域已移至新服务器,而cron作业仍在旧服务器上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM