I have a question regarding Magento.
Apparently, to perform scheduled tasks within Magento, it needs to run a script called cron.php
. Originally the script was triggered by an on-server crontab using the line wget -O /dev/null http://www.example.com/cron12345.php
.
Unfortunately, due to some problems, we need to limit the life of the PHP FPM child processes to 300 seconds... and that murdered the PHP process running cron.php
.
I tried running cron.php
from CLI using the command php -c /etc/php5/fpm/php.ini cron.php
and it seemed to work... but there were no output and the script just keeps running...
So my questions:
- Is
cron.php
a one-shot script, or does it run until completion and needs to be invoked again? - If it needs to be regularly invoked (via cron), can I just add a crontab like the following:
*/15 * * * * cd /var/www/website && php -c /etc/php5/fpm/php.ini cron.php
Thank you for your kind assistance.
Answer
It should finish, it can take some time especially if you didn't run it in a while.
But generally it will finish. If it doesn't you'll need to check what is going on.Yes, that is how this is generally done, see:
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job
Comments
Post a Comment