Invalid crontab
Posted by: section31
Posted on: 2006-04-11 16:39:00
Hi, i just tried to setup my first cronjob and I failed miserably.
My Goal: To run a php script every 30 minutes.
My attempt was as folows.
1. vi foo
MAILTO: myemailaddress
*/30 * * * * php /home/myusername/mydomain.com/script.php
# install cron
2. crontab foo
Now I get an email stating this.
In reply to:
/bin/sh: line 1: php: command not found
I used this cron on my previous shared server without a problem. I also tried running it as a shell script whatever by putting #!/usr/local/bin/php -q on top of my php script, chmodding it to 755 and then just doing */30 * * * * /fullpath/script.php, but that doesn't work either.
2 questions.
1. How can I get this working?
2. If i didn't put MAILTO on the cron, what email does the system to use and how do I change or modify that?
Oh, and running php script.php from the shell runs perfect....Must have something to do with this server clustering which confuses the hell out of me.
Edited by section31 on 04/11/06 04:58 PM (server time).