1
votes

I've been running a daily cron job for a few months and it was working fine. The cron job runs a php script that does a database action then mails my email address with the results. 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. 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.

Any thought as to how I can get this back on track?

More information: I use a 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]

PHP says that the path to PHP is /usr/bin/php however, it used to work with the local part in there.

@DampeS8N- I'd rather not. The PHP script just includes a few sql commands and a mail function. It works fine without any errors when visited by browser. @Paul- That is what I am inclined to believe. I think the Cron Daemon is stuck somehow. 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.

I am a complete newbie to cron. I access cron jobs in my cPanel X. I'm pretty sure I don't use crontab. Detailed instructions for any actions you'd like me to take would be great.

1
Sounds more like a configuration change/issue. You may have better luck over at serverfault.com - Stephen
can you post the cron php script? - DampeS8N
If it's still sending the old email, then when you thought you changed the script you didn't. Is it running a copy of the script somewhere else on the filesystem? Is it even running on the same server? - The Archetypal Paul
can you tell us which operating system you use; how you set the cron ( like using a cpanel or if linux crontab or something )? - Anush Prem
As DampeS8N suggested, please post the php script. Also, do a crontab -l to verify that it's pointing to the correct script. - webbiedave

1 Answers

0
votes

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.