Magento extension Cronjob not working?












1















I was working on a extension for our Magento website, but i found out that my cronjob is not working correctly.



Config: appcodelocalQuestcontrolCustomExstentionetcconfig.xml



<?xml version="1.0"?>
<config>
<modules>
<Questcontrol_CustomExstention>
<version>0.1.0</version>
</Questcontrol_CustomExstention>
</modules>
<global>
<models>
<CustomExstention>
<class>Questcontrol_CustomExstention_Model</class>
</CustomExstention>
</models>
</global>
<crontab>
<jobs>
<CustomExstention>
<schedule>
<cron_expr>* * * * *</cron_expr>
</schedule>
<run>
<model>CustomExstention/Observer::test</model>
</run>
</CustomExstention>
</jobs>
</crontab>
<frontend>
<routers>
<CustomExstention>
<use>standard</use>
<args>
<module>Questcontrol_CustomExstention</module>
<frontName>CustomExstention</frontName>
</args>
</CustomExstention>
</routers>
</frontend>
</config>


Object: appcodelocalQuestcontrolCustomExstentionModelObserver.php



<?php
class Questcontrol_CustomExstention_Model_Observer {

public function test(){
Mage::log("TEST success");
}
}
?>


What am i doing wrong at this point?



Thanks in advanced!










share|improve this question





























    1















    I was working on a extension for our Magento website, but i found out that my cronjob is not working correctly.



    Config: appcodelocalQuestcontrolCustomExstentionetcconfig.xml



    <?xml version="1.0"?>
    <config>
    <modules>
    <Questcontrol_CustomExstention>
    <version>0.1.0</version>
    </Questcontrol_CustomExstention>
    </modules>
    <global>
    <models>
    <CustomExstention>
    <class>Questcontrol_CustomExstention_Model</class>
    </CustomExstention>
    </models>
    </global>
    <crontab>
    <jobs>
    <CustomExstention>
    <schedule>
    <cron_expr>* * * * *</cron_expr>
    </schedule>
    <run>
    <model>CustomExstention/Observer::test</model>
    </run>
    </CustomExstention>
    </jobs>
    </crontab>
    <frontend>
    <routers>
    <CustomExstention>
    <use>standard</use>
    <args>
    <module>Questcontrol_CustomExstention</module>
    <frontName>CustomExstention</frontName>
    </args>
    </CustomExstention>
    </routers>
    </frontend>
    </config>


    Object: appcodelocalQuestcontrolCustomExstentionModelObserver.php



    <?php
    class Questcontrol_CustomExstention_Model_Observer {

    public function test(){
    Mage::log("TEST success");
    }
    }
    ?>


    What am i doing wrong at this point?



    Thanks in advanced!










    share|improve this question



























      1












      1








      1








      I was working on a extension for our Magento website, but i found out that my cronjob is not working correctly.



      Config: appcodelocalQuestcontrolCustomExstentionetcconfig.xml



      <?xml version="1.0"?>
      <config>
      <modules>
      <Questcontrol_CustomExstention>
      <version>0.1.0</version>
      </Questcontrol_CustomExstention>
      </modules>
      <global>
      <models>
      <CustomExstention>
      <class>Questcontrol_CustomExstention_Model</class>
      </CustomExstention>
      </models>
      </global>
      <crontab>
      <jobs>
      <CustomExstention>
      <schedule>
      <cron_expr>* * * * *</cron_expr>
      </schedule>
      <run>
      <model>CustomExstention/Observer::test</model>
      </run>
      </CustomExstention>
      </jobs>
      </crontab>
      <frontend>
      <routers>
      <CustomExstention>
      <use>standard</use>
      <args>
      <module>Questcontrol_CustomExstention</module>
      <frontName>CustomExstention</frontName>
      </args>
      </CustomExstention>
      </routers>
      </frontend>
      </config>


      Object: appcodelocalQuestcontrolCustomExstentionModelObserver.php



      <?php
      class Questcontrol_CustomExstention_Model_Observer {

      public function test(){
      Mage::log("TEST success");
      }
      }
      ?>


      What am i doing wrong at this point?



      Thanks in advanced!










      share|improve this question
















      I was working on a extension for our Magento website, but i found out that my cronjob is not working correctly.



      Config: appcodelocalQuestcontrolCustomExstentionetcconfig.xml



      <?xml version="1.0"?>
      <config>
      <modules>
      <Questcontrol_CustomExstention>
      <version>0.1.0</version>
      </Questcontrol_CustomExstention>
      </modules>
      <global>
      <models>
      <CustomExstention>
      <class>Questcontrol_CustomExstention_Model</class>
      </CustomExstention>
      </models>
      </global>
      <crontab>
      <jobs>
      <CustomExstention>
      <schedule>
      <cron_expr>* * * * *</cron_expr>
      </schedule>
      <run>
      <model>CustomExstention/Observer::test</model>
      </run>
      </CustomExstention>
      </jobs>
      </crontab>
      <frontend>
      <routers>
      <CustomExstention>
      <use>standard</use>
      <args>
      <module>Questcontrol_CustomExstention</module>
      <frontName>CustomExstention</frontName>
      </args>
      </CustomExstention>
      </routers>
      </frontend>
      </config>


      Object: appcodelocalQuestcontrolCustomExstentionModelObserver.php



      <?php
      class Questcontrol_CustomExstention_Model_Observer {

      public function test(){
      Mage::log("TEST success");
      }
      }
      ?>


      What am i doing wrong at this point?



      Thanks in advanced!







      magento-1.9 cron






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 1 '16 at 12:56









      Gopal Patel

      2,9912930




      2,9912930










      asked Nov 1 '16 at 12:45









      LittleProgrammerLittleProgrammer

      364




      364






















          1 Answer
          1






          active

          oldest

          votes


















          0














          First of all, check your system crontab for magento cron. I think that magento cron.sh or cron.php runs every five minutes (cron expr: */5 * * * *), but not every minute (your cronjob expr), thats why you can't run your code propely.



          Second problem can be logic of magento cron (cron.sh or cron.php) - when it runs, it checks cron_scheduler table and works with it, after that it add new events (and remove old, etc) from that table. May be your cronjob just runs later because of this logic.



          And the third problem can be magento cron hangs on. In some cases (eg: your magento store has lots of cronjobs or cronjobs do lots of work, etc.) when your magento require a lot of time to work with cronjobs, cron.sh process can just hangs on and you need restart it.



          pS: In one of our projects we added additional system for magento cron control and moved heaviest and longest operations to the system cron, instead of magento cron






          share|improve this answer


























          • Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

            – LittleProgrammer
            Nov 1 '16 at 14:29











          • Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

            – rakshazi
            Nov 2 '16 at 14:10











          • I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

            – LittleProgrammer
            Nov 3 '16 at 9:17











          • may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

            – rakshazi
            Nov 3 '16 at 14:56











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f143521%2fmagento-extension-cronjob-not-working%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          First of all, check your system crontab for magento cron. I think that magento cron.sh or cron.php runs every five minutes (cron expr: */5 * * * *), but not every minute (your cronjob expr), thats why you can't run your code propely.



          Second problem can be logic of magento cron (cron.sh or cron.php) - when it runs, it checks cron_scheduler table and works with it, after that it add new events (and remove old, etc) from that table. May be your cronjob just runs later because of this logic.



          And the third problem can be magento cron hangs on. In some cases (eg: your magento store has lots of cronjobs or cronjobs do lots of work, etc.) when your magento require a lot of time to work with cronjobs, cron.sh process can just hangs on and you need restart it.



          pS: In one of our projects we added additional system for magento cron control and moved heaviest and longest operations to the system cron, instead of magento cron






          share|improve this answer


























          • Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

            – LittleProgrammer
            Nov 1 '16 at 14:29











          • Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

            – rakshazi
            Nov 2 '16 at 14:10











          • I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

            – LittleProgrammer
            Nov 3 '16 at 9:17











          • may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

            – rakshazi
            Nov 3 '16 at 14:56
















          0














          First of all, check your system crontab for magento cron. I think that magento cron.sh or cron.php runs every five minutes (cron expr: */5 * * * *), but not every minute (your cronjob expr), thats why you can't run your code propely.



          Second problem can be logic of magento cron (cron.sh or cron.php) - when it runs, it checks cron_scheduler table and works with it, after that it add new events (and remove old, etc) from that table. May be your cronjob just runs later because of this logic.



          And the third problem can be magento cron hangs on. In some cases (eg: your magento store has lots of cronjobs or cronjobs do lots of work, etc.) when your magento require a lot of time to work with cronjobs, cron.sh process can just hangs on and you need restart it.



          pS: In one of our projects we added additional system for magento cron control and moved heaviest and longest operations to the system cron, instead of magento cron






          share|improve this answer


























          • Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

            – LittleProgrammer
            Nov 1 '16 at 14:29











          • Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

            – rakshazi
            Nov 2 '16 at 14:10











          • I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

            – LittleProgrammer
            Nov 3 '16 at 9:17











          • may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

            – rakshazi
            Nov 3 '16 at 14:56














          0












          0








          0







          First of all, check your system crontab for magento cron. I think that magento cron.sh or cron.php runs every five minutes (cron expr: */5 * * * *), but not every minute (your cronjob expr), thats why you can't run your code propely.



          Second problem can be logic of magento cron (cron.sh or cron.php) - when it runs, it checks cron_scheduler table and works with it, after that it add new events (and remove old, etc) from that table. May be your cronjob just runs later because of this logic.



          And the third problem can be magento cron hangs on. In some cases (eg: your magento store has lots of cronjobs or cronjobs do lots of work, etc.) when your magento require a lot of time to work with cronjobs, cron.sh process can just hangs on and you need restart it.



          pS: In one of our projects we added additional system for magento cron control and moved heaviest and longest operations to the system cron, instead of magento cron






          share|improve this answer















          First of all, check your system crontab for magento cron. I think that magento cron.sh or cron.php runs every five minutes (cron expr: */5 * * * *), but not every minute (your cronjob expr), thats why you can't run your code propely.



          Second problem can be logic of magento cron (cron.sh or cron.php) - when it runs, it checks cron_scheduler table and works with it, after that it add new events (and remove old, etc) from that table. May be your cronjob just runs later because of this logic.



          And the third problem can be magento cron hangs on. In some cases (eg: your magento store has lots of cronjobs or cronjobs do lots of work, etc.) when your magento require a lot of time to work with cronjobs, cron.sh process can just hangs on and you need restart it.



          pS: In one of our projects we added additional system for magento cron control and moved heaviest and longest operations to the system cron, instead of magento cron







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 48 mins ago









          Teja Bhagavan Kollepara

          3,00641949




          3,00641949










          answered Nov 1 '16 at 13:16









          rakshazirakshazi

          13




          13













          • Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

            – LittleProgrammer
            Nov 1 '16 at 14:29











          • Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

            – rakshazi
            Nov 2 '16 at 14:10











          • I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

            – LittleProgrammer
            Nov 3 '16 at 9:17











          • may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

            – rakshazi
            Nov 3 '16 at 14:56



















          • Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

            – LittleProgrammer
            Nov 1 '16 at 14:29











          • Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

            – rakshazi
            Nov 2 '16 at 14:10











          • I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

            – LittleProgrammer
            Nov 3 '16 at 9:17











          • may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

            – rakshazi
            Nov 3 '16 at 14:56

















          Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

          – LittleProgrammer
          Nov 1 '16 at 14:29





          Thanks for your fast respone, I tried to put the cron on every 5 minutes but this still doesn't work. I tried the second option as well, but this didn't make any different at all. As last i tried to completely restart my apache server to clear all running crons (still doesn't work).

          – LittleProgrammer
          Nov 1 '16 at 14:29













          Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

          – rakshazi
          Nov 2 '16 at 14:10





          Just truncate table cron_scheduler and try run you job. By the way, you can check your job in this table, if job exists - all ok, it's just cron freeze, if not - try clean cache (config cache) and try to run your job

          – rakshazi
          Nov 2 '16 at 14:10













          I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

          – LittleProgrammer
          Nov 3 '16 at 9:17





          I checked the 'cron_scheduler' table in my mysql database, but my cron is not in that table. I have cleaned and disabled the cache, but it still doesn't work.

          – LittleProgrammer
          Nov 3 '16 at 9:17













          may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

          – rakshazi
          Nov 3 '16 at 14:56





          may be your module isn't active? Check app/etc/modules/<Module_Name>.xml active tag and check in core_reousrce DB table

          – rakshazi
          Nov 3 '16 at 14:56


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f143521%2fmagento-extension-cronjob-not-working%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What other Star Trek series did the main TNG cast show up in?

          Berlina muro

          Berlina aerponto