1

I'm trying to run my custom module that setup two cronjobs. Here is my config.xml file.

<config>
    <global>
        <models>
            <RLTS_Certification>
                <class>RLTS_Certification_Model</class>
            </RLTS_Certification>
        </models>
    </global>
    <crontab>
        <jobs>
            <certi_status_update>
                <schedule>
                    <cron_expr>*/2 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>RLTS_Certification/StatusHelper::updateCertiStatus</model>
                </run>
            </certi_status_update>

            <certi_renewal_reminder>
                <schedule>
                    <cron_expr>*/2 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>RLTS_Certification/StatusHelper::certiRenewalReminder</model>
                </run>
            </certi_renewal_reminder>           
        </jobs>
    </crontab>
</config>

My cronjobs are not visible in cron_schedule table. One more thing is, that table is empty. What I need to do to setup these cronjobs?

3 Answers 3

2

In your local system, you have to use your browser to run http://yourdomain.com/cron.php or php-cli to execute cron.php in the root of the application.

7
  • I tried mydomain/cron.php on my browser but It returns just an empty page. Jul 15, 2016 at 12:56
  • Yes it returns empty page but now cron jobs are inserted in cron_schedule table. Jul 15, 2016 at 12:58
  • but cron_schedule table is still empty Jul 15, 2016 at 12:59
  • clear all cache and run it again. it works. Jul 15, 2016 at 13:06
  • I remove var folder and again hit the cron.php file, but table is still empty Jul 15, 2016 at 13:09
0

It appears to be a problem with the code for $isShellDisabled in cron.php I commented out the two lines that were determining it (around line 50) and made the results be true. $isShellDisabled = true;

The first time I ran it with that fix the table repopulated instantly and I do see changes each time the cron job runs.

Here's a thread on the same problem from ver 1.8:

Magento cron.php Does Nothing After it Runs

1
0

The issue is magento_root/cron.php was not set in server crontab. We need to add this file in crontab so it worked for us as follow.

# crontab -l (this command will list all the Cron jobs in Crontab)

There should be an entry for magento_root/cron.php file. If not, we need to add this file because this file is responsible for initiating your Magento Cron jobs. So we need to edit the Crontab as follow.

# crontab -e

Add the following statement in the file and close after saving it.

*/5 * * * * wget -O /dev/null -q path_to_magento_root/cron.php > /dev/null

For more information, visit this link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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