Cron jobs not working

AtomicRax

Verified User
Joined
Oct 12, 2003
Messages
79
I recently acquired another dedicated server, and I'm trying to setup a cronjob. I've tried several things now, and nothing is working.

I'm trying to setup a cronjob for use with a php script. I've set it up in DirectAdmin with no luck and I've set it up via crontab in ssh and still nothing!

30 2 * * * /usr/local/bin/php /home/user/domains/domain.com/public_html/lib/cronJob.php >/dev/null 2>&1

I've tried using just "php" instead of "/usr/local/bin/php" and still no luck!!

How ever, both commands (using just "php" or the actual path to php) work when I input them in SSH. Any ideas?
 
Well I had been doing some research, googling, etc.. most of what I was finding was about adding a first line to the PHP script so that it executes...

I've played in DA before, used many cron jobs, and used this exact php script as a cron job on another server (not DA).. I've never had this problem before. EVER

I'll try what you suggested. Thanks
 
Maybe because I was here a long time and did not see the last 2 answers. But what's wrong with that?

Not bad with several suggestions and solutions anyways ;)

The easiest is to run it remotely. When you don't think about contents of the PHP file
 
Nothing wrong, man.

It's not always true. I'll tell you why. If your PHP script will run much more longer, it can fail to finish its work because it might be aborted on Apache's timeouts or on Apache reload/restart. And that's not the only reason.
 
Back
Top