Kobus Myburgh
Kobus Myburgh

Reputation: 1202

Cron job not firing in cPanel, but runs manually

I have a situation that appears to have been asked several times, but none of them answers my problem, as all of them refer to a ownership problem or something entirely different.

I have a cron task that I schedule from within the cPanel cron manager. It currently looks like this:

5,20,35,50 0-8,17-23 * * * php /path/to/script/product_warehouse_update.php5

This is intended to run every 15 minutes, starting at 17:05 and running the last time the next morning at 08:50am.

When I run the PHP script manually, it works 100%, but cron does not invoke it. As I set up the cron task within cPanel like all the other cron jobs that are working, I doubt that this is an access/ownership issue. I log in with PuTTy using the same credentials that I use to log in with cPanel, and via PuTTy, I can manually run the script, but cPanel does not invoke it.

I have set up Cron to mail me when a cron job is started, but I never get any e-mails from this particular cron job. The WHM Server Health never indicates that the cron task is fired, and there are no log entries generated from the script (which I have coded to log to a text file with r/w access that works as expected for the other scripts).

Any ideas will be greatly appreciated.

Upvotes: 1

Views: 4481

Answers (1)

Kobus Myburgh
Kobus Myburgh

Reputation: 1202

Found the problem. The cron is firing through system account, which has access to the script. The user account used to run scripts via a browser was different and did not have permissions.

Upvotes: 2

Related Questions