0

I am unable to call cron into my model using this xml. Please suggest be a way.

app/code/local/Rkt/Crons/etc/config.xml

  <models>
        <cronscron>
            <class>Rkt_Crons_Model</class>
        </cronscron>                         
    </models>
</global>
<crontab>
    <jobs>
        <cronscron>
            <schedule>
                <cron_expr>*/1 * * * *</cron_expr>
            </schedule>
            <run>
              <model>cronscron/observer::setStatus</model>
            </run>
        </cronscron>
    </jobs>
</crontab>

/app/code/local/Rkt/Crons/Model/Observer.php

 class Rkt_Crons_Model_Observer
{

   public function setStatus()
   { 

     Mage::log("WORKS!");

   }
}
0

Try changing the job name so that it is different from the models sub-node

<crontab>
    <jobs>
        <somecron>
            <schedule>
                <cron_expr>*/1 * * * *</cron_expr>
            </schedule>
            <run>
              <model>cronscron/observer::setStatus</model>
            </run>
        </somecron>
    </jobs>
</crontab>
  • Thanks for the response, its working now. – teja123 Jan 9 at 6:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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