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?

7ochem
  • 7,532
  • 14
  • 51
  • 80
Muhammad Saeed Khan
  • 1,343
  • 2
  • 16
  • 29

3 Answers3

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.

Jaimin Parikh
  • 2,392
  • 2
  • 13
  • 27
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

  • I explained why $isShellDisabled = true works and what the real solution to this problem is here: http://magento.stackexchange.com/questions/137130/is-adding-isshelldisabled-true-in-cron-php-recommended/137166#137166 – Fabian Schmengler Oct 24 '16 at 19:05
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

Muhammad Saeed Khan
  • 1,343
  • 2
  • 16
  • 29