top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to enable cron in Magento?

+3 votes
How to enable cron in Magento?
posted Apr 22, 2015 by Rahul Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

In Magento we can schedule custom tasks in our XML configuration, in a similar manner to the UNIX crontab style.
Like in app/code/core/Mage/CatalogRule/etc/config.xml:

                    <schedule><cron_expr>0 1 * * *</cron_expr></schedule>

This example will run Mage_CatalogRule_Model_Observer::dailyCatalogUpdate method every day at 01:00am (0 1 * * *).

To execute these configured tasks, there is a cron.php file located in the Magento root and it need to be run periodically,like every 15 minutes. Basically, these script will check that if it needs to run any tasks, and if it needs to schedule any future tasks.

In UNIX/BSD/linux systems we need to add this line in our crontab:

*/10 * * * *  /bin/sh /absolute/path/to/magento/
answer Oct 26, 2015 by Vrije Mani Upadhyay
0 votes

In the Magento admin, go to: System > Sonfiguration > System > Cron (Scheduled Tasks) and configure cron jobs you wish to run.

You should know that Magento runs cron jobs even if you don't have a daily cron job configured. Whenever Magento receives a request, it checks if there are any cron jobs to be run. Therefore, having the daily cron job would only make sense if you had no requests for an entire day.

Really there is no next step to be done. I recommend you read

answer Apr 22, 2015 by Amit Kumar Pandey
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.