Centos 6.2 Cron Jobs
I am trying to set php scripts to run via cron jobs in the middle of the night. I am editing the dailyjobs file in /etc/cron.d. For testing purposes I just wanted to run the job every minute... So I edited the file to look like this:
Code:
* * * * * php /path/to/script.php Thanks. |
ok. good for you. was there a question?
|
You may have to define the whole path to php in your cron job.
|
Quote:
Code:
php /path/to/script.php My dailyjobs files looks like this. Code:
SHELL=/bin/bash |
right so clearly you've got a different format to the other lines. you've no user account listed there, where the other lines all run as root (this is a difference in the /etc/crontab file compared to other user crontabs where this field does not exist), and also as above you should use the full path to the php binary for good measure.
|
Wait, so should I be using the /etc/crontab file or the /etc/cron.d/dailyjobs file?
|
personally I've never heard of "dailyjobs" before, but that file is exactly what should be in /etc/crontab. Google says this is new in el6 so something I should read up on... Eitehr way, correct that line and go from there.
|
Problem solved. I simply did it through webmin. I did yum install crontab and it installed that package and 2 dependent packages. I then went into Webmin and setup the job to run and it completed fine.
|
ewww webmin is nasty. kill it with fire.
|
All times are GMT -5. The time now is 09:36 AM. |