1

I have been trying to setup a cron job in Magento. I have been reading and followed the tutorials for a few. Now i do not understand what needs to be done to setup a cron job. I followed this tutorial http://inchoo.net/magento/creating-cron-script-in-magento/ however it did not work I tried a few others but they were no good either. Based on the reading on stackoverflow people seemed to use MAGE? to link to cron jobs however they are not clearly explaining how. I can not seem to understand what i need to add to make this work. Any suggestions

<crontab>
        <jobs>
            <customconfig>
                <schedule><cron_expr>*/2 * * * *</cron_expr></schedule>
                <run><model>customconfig/observer::cronEvent</model></run>
            </customconfig>
        </jobs>
    </crontab>
Noob
  • 154
  • 1
  • 1
  • 14

1 Answers1

2

Regarding the replies in comment section I suppose using Windows you don't have any system Cron that is runing Magento Cron. In such case you could force running Magento Cron using PHP; Try something like this:

path/to/php.exe path/to/magento-folder/cron.php

It should run your Magento Cron (only once) and schedule the tasks. You could track scheduled tasks in Magento Database table which is called cron_schedule. You might need to force cron.php several times (let's say every 1-2 minutes) to see whether your cronjobs are schedule or not.

hatef
  • 5,491
  • 30
  • 43
  • 46
  • i do not understand what to do with this path/to/php.exe path/to/magento-folder/cron.php – Noob Nov 18 '15 at 13:27
  • It means you should run `cron.php` file using PHP (`php.exe`).. You can find `php.exe` where your PHP is installed. Are you using `XAMPP` or something similar? (if so it's under \XAMPP\php\); And `cron.php` is located where your Magento is installed.. you can find it in Magento's root directory.. – hatef Nov 18 '15 at 13:56
  • its on a linux server. centos? sorry only found out now – Noob Nov 19 '15 at 13:44
  • Make sure your system's Cron is running Magento's cron correctly. Do you see something like this in your crontab? `*/5 * * * * /public_html/cron.sh` (using this in command-line: `crontab -l`) – hatef Nov 19 '15 at 14:16
  • how do i do that when i go on putty i type in the command and it says no cron for root? – Noob Nov 19 '15 at 14:22
  • Seems like your Cron has some issues. Follow this reply [here](http://serverfault.com/a/449652/197515) to see if you can fix your Cron issues. – hatef Nov 19 '15 at 14:35