PDA

View Full Version : Cron job problem



Leo
06-08-2006, 10:52 AM
Hi everyone, I am a new customer and I think I am going to like it here :) Now, I have setup my site and everything seems to run smoothly. However I came to a problem when I tried to run a cron job, it's a php script which I want to run every minute. I have setup my cron job like this "* * * * * /usr/local/bin/php /var/www/html/bal_ctf/script.php 2>&1 > /dev/null" but it doesn't seem to work. It works if I run it straight from the command line but the job doesn't run. Any help would be appreciated. Thanks.

wildjokerdesign
06-08-2006, 11:06 AM
Try:

* * * * * /usr/local/bin/php /var/www/html/bal_ctf/script.php

Also have a look at this related thread:
http://forums.westhost.com/showthread.php?t=8951

Leo
06-08-2006, 11:32 AM
Thanks for the quick reply. That's the code I am using, I have also tried without the "2>&1 > /dev/null" and at the top of the cron I added MAILTO=myemailhere but no email came. It's like the cron job doesn't run :(

Leo
06-08-2006, 12:34 PM
It's ok, I am so new to this that I thought that by just editing the file it was going to work. I actually had to install the cron job. Works fine now :)

wildjokerdesign
06-08-2006, 03:55 PM
It's ok, I am so new to this that I thought that by just editing the file it was going to work. I actually had to install the cron job. Works fine now :)

By that do you mean you restarted the VPS/Apache? How did you edit the file? Did you use "editcron -e"?

Leo
06-08-2006, 04:16 PM
I was just editing the file through ftp, after I searched in google I found out what I had to do :)

torrin
06-09-2006, 08:56 AM
I was just editing the file through ftp, after I searched in google I found out what I had to do :)

Hmmm . . . I'm surprised this worked. I would swear that editcron/crontab was doing something else other than just editing the cron file. Glad it worked for you.