Cron jobs, or scheduled tasks, must be enabled in order for Magento to operate properly. The Product Labels extension from Intenso is built upon Magento's functionality, it also inherits this requirement.
By default if you're running a UNIX operating system it should automatically recognize Magento's requests to use the CRON TAB service. Magento needs Cron Jobs to be initiated for the following features to operate correctly:
- Catalog Price rules
- Sending Newsletters
- Generating Google Sitemaps
- Customer Alerts/Notifications (product price change, product back to stock)
- Automatic updating of currency rates
- Scheduled DB logs cleanup
Evidence of Magento not picking up CRON TAB tasks properly in Intenso is a notification message in the Product Labels section of the admin panel: "Cron is not running". If this is the case please enable Cron Jobs.
For additional information on Cron Jobs in Magento please refer to Magento documentation.
Setting up the Cron In a UNIX Based Operating System
You can use the crontab service command if you have shell access to the server, or add it through your cPanel or similar admin. You need to make the script run every 5 minutes, so in advanced configurations you'd be entering in:
*/5 * * * *
The your crontab should have something like one of these:
*/5 * * * * /bin/sh /[magento_path]/cron.sh */5 * * * * /bin/bash /[magento_path]/cron.sh */5 * * * * /usr/bin/php /[magento_path]/cron.php */5 * * * * /usr/local/bin/php -f /[magento_path]/cron.php
Setting Up the Cron Using cPanel Version 11
If you're using cPanel, you can setup a Cron Job using the advanced tab.
- Login to cPanel and locate the Advanced panel as shown here:
- Click on the Cron Jobs icon
- Enter the following settings in the Add New Cron Job section, replacing [magento_path] with the path to your Magento install:
- Click Add New Cron Job to insert this cron job in the system.
Setting up a Scheduled Task In Windows
In windows you need to create a scheduled task that will execute the cron.php file every 5 minutes. To do this, go to the scheduled task manager and add a task to run the following command:
php C:\[magento_path]\cron.php
Additional Testing to see if CRON is running
You can place some probes into cron.sh and cron.php to confirm things are running.
You can add this to cron.sh after the INSTALLDIR variable is set:
# absolute path to magento installation INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'` date >> "$0".log whoami >> "$0".log
And this to cron.php at the end of the file:
$log = fopen(__FILE__.'.log', 'a'); fwrite($log, date("Y-m-d H:i:s").PHP_EOL); fclose($log);
After 6 minutes you should see both these files in Magento's directory if cron is running.
./cron.php.log ./cron.sh.log