1

I have create fedex module that complate the order status based on product delivery status and setup with /root/cron.php/.

but i don't know to check cron schedules are working or not. Any manual trick to check the cron are working or not?

3
  • Did you get what you want? – Rohit Kundale Mar 12 '16 at 11:22
  • no. i have not got any solution for this. :( – Ajay Patel Mar 12 '16 at 11:30
  • Did you tried putting mage::log() In cron.php file?. Is there any log generating? – Rohit Kundale Mar 12 '16 at 11:45
0

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 after the dispatchEvent call:

Mage::dispatchEvent('default');
$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

If you have tried everything and still cant get cron to work, perhaps this unsupported workaround might help. Adding the following to the top of index.php will cause cron to run in the background whenever someone accesses your website.

<?php
$pathToCron = dirname(__FILE__)."/cron.sh";
exec( "sh $pathToCron > /dev/null &" );

Another workaround

*/5 * * * * /usr/bin/wget http://your_webpage.com/cron.php

You can check more information here

Hope this helps

0
  1. Straight forward way would be to configure
     */5 * * * * /usr/bin/bash /path_to/cron.php 
    in cron tab.
  2. Backup and Truncate cron_schedule table.
  3. Wait for cron run. Cron will insert the data.
  4. You can also check by hitting cron.php from the URL.

Note : I would not recommend configuring cron with wget.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.