Magento Cron is not run on windows












5














I want to run the cron job on magento, but the cron events are not appeared.
This is my etc/config.xml file.



<crontab>
<jobs>
<imagerecycle_imagerecycle>
<schedule>
<cron_expr>*/1 * * * *</cron_expr>
</schedule>
<run>
<model>imagerecycle/observer::cronexec</model>
</run>
</imagerecycle_imagerecycle>
</jobs>
</crontab>


And I define the cron event ovserver function.



class Imagerecycle_Imagerecycle_Model_Observer
{
public function cronexec($observer)
{
// do something
}
}


And to run the cron I use such a command line at the command prompt.



D:workmagento>schtasks /create /sc minute /mo 1 /tn "my cron" /tr "php -f d:workmagentocron.php


So the cron.php is called every 1 minutes.

But my cronexec() function are not working. So I installed the AOE-Scheduler extension and reviewed the information. There was my cron function correctly. By the way there is a message "there is no heartbeat work now". I guess there is no error on my php program. Only the magento cron cannot run on the windows 7. Is is right? Please help me.










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    5














    I want to run the cron job on magento, but the cron events are not appeared.
    This is my etc/config.xml file.



    <crontab>
    <jobs>
    <imagerecycle_imagerecycle>
    <schedule>
    <cron_expr>*/1 * * * *</cron_expr>
    </schedule>
    <run>
    <model>imagerecycle/observer::cronexec</model>
    </run>
    </imagerecycle_imagerecycle>
    </jobs>
    </crontab>


    And I define the cron event ovserver function.



    class Imagerecycle_Imagerecycle_Model_Observer
    {
    public function cronexec($observer)
    {
    // do something
    }
    }


    And to run the cron I use such a command line at the command prompt.



    D:workmagento>schtasks /create /sc minute /mo 1 /tn "my cron" /tr "php -f d:workmagentocron.php


    So the cron.php is called every 1 minutes.

    But my cronexec() function are not working. So I installed the AOE-Scheduler extension and reviewed the information. There was my cron function correctly. By the way there is a message "there is no heartbeat work now". I guess there is no error on my php program. Only the magento cron cannot run on the windows 7. Is is right? Please help me.










    share|improve this question
















    bumped to the homepage by Community yesterday


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      5












      5








      5







      I want to run the cron job on magento, but the cron events are not appeared.
      This is my etc/config.xml file.



      <crontab>
      <jobs>
      <imagerecycle_imagerecycle>
      <schedule>
      <cron_expr>*/1 * * * *</cron_expr>
      </schedule>
      <run>
      <model>imagerecycle/observer::cronexec</model>
      </run>
      </imagerecycle_imagerecycle>
      </jobs>
      </crontab>


      And I define the cron event ovserver function.



      class Imagerecycle_Imagerecycle_Model_Observer
      {
      public function cronexec($observer)
      {
      // do something
      }
      }


      And to run the cron I use such a command line at the command prompt.



      D:workmagento>schtasks /create /sc minute /mo 1 /tn "my cron" /tr "php -f d:workmagentocron.php


      So the cron.php is called every 1 minutes.

      But my cronexec() function are not working. So I installed the AOE-Scheduler extension and reviewed the information. There was my cron function correctly. By the way there is a message "there is no heartbeat work now". I guess there is no error on my php program. Only the magento cron cannot run on the windows 7. Is is right? Please help me.










      share|improve this question















      I want to run the cron job on magento, but the cron events are not appeared.
      This is my etc/config.xml file.



      <crontab>
      <jobs>
      <imagerecycle_imagerecycle>
      <schedule>
      <cron_expr>*/1 * * * *</cron_expr>
      </schedule>
      <run>
      <model>imagerecycle/observer::cronexec</model>
      </run>
      </imagerecycle_imagerecycle>
      </jobs>
      </crontab>


      And I define the cron event ovserver function.



      class Imagerecycle_Imagerecycle_Model_Observer
      {
      public function cronexec($observer)
      {
      // do something
      }
      }


      And to run the cron I use such a command line at the command prompt.



      D:workmagento>schtasks /create /sc minute /mo 1 /tn "my cron" /tr "php -f d:workmagentocron.php


      So the cron.php is called every 1 minutes.

      But my cronexec() function are not working. So I installed the AOE-Scheduler extension and reviewed the information. There was my cron function correctly. By the way there is a message "there is no heartbeat work now". I guess there is no error on my php program. Only the magento cron cannot run on the windows 7. Is is right? Please help me.







      magento-1.8 crontab windows






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 3 '17 at 10:06









      sv3n

      9,64062352




      9,64062352










      asked Mar 20 '16 at 1:23









      wuang li

      363




      363





      bumped to the homepage by Community yesterday


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community yesterday


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          3 Answers
          3






          active

          oldest

          votes


















          0














          Cron Setup looks fine. You can also just run cron.php from browsers as



          http://SITE_BASE_URL/cron.php


          Resource Magento Basic Cron Job Module setup






          share|improve this answer





















          • Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
            – wuang li
            Mar 26 '16 at 23:54












          • OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
            – wuang li
            Mar 27 '16 at 4:20





















          0














          Need to declare Model in config.xml file.



          <config>
          <global>
          <models>
          <imagerecycle>
          <class>Imagerecycle_Imagerecycle_Model</class>
          </imagerecycle>
          </models>
          </global>
          <crontab>
          <jobs>
          <imagerecycle>
          <schedule>
          <cron_expr>*/10 * * * *</cron_expr>
          </schedule>
          <run>
          <model>imagerecycle/observer::cronexec</model>
          </run>
          </imagerecycle>
          </jobs>
          </crontab>
          </config>





          share|improve this answer





























            0














            To run cron,



            1) check php is globle command or not if it is globle command you can use it as php else you have to specify full path of php.exe



            2) you have to create one magento.sh file write command on there which you want (php -f d:workmagentocron.php).



            3) now create Schedule Task for magento.sh you can create it by this link



            Thank you.






            share|improve this answer





















              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%2f107061%2fmagento-cron-is-not-run-on-windows%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Cron Setup looks fine. You can also just run cron.php from browsers as



              http://SITE_BASE_URL/cron.php


              Resource Magento Basic Cron Job Module setup






              share|improve this answer





















              • Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
                – wuang li
                Mar 26 '16 at 23:54












              • OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
                – wuang li
                Mar 27 '16 at 4:20


















              0














              Cron Setup looks fine. You can also just run cron.php from browsers as



              http://SITE_BASE_URL/cron.php


              Resource Magento Basic Cron Job Module setup






              share|improve this answer





















              • Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
                – wuang li
                Mar 26 '16 at 23:54












              • OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
                – wuang li
                Mar 27 '16 at 4:20
















              0












              0








              0






              Cron Setup looks fine. You can also just run cron.php from browsers as



              http://SITE_BASE_URL/cron.php


              Resource Magento Basic Cron Job Module setup






              share|improve this answer












              Cron Setup looks fine. You can also just run cron.php from browsers as



              http://SITE_BASE_URL/cron.php


              Resource Magento Basic Cron Job Module setup







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 24 '16 at 7:19









              Akhil Gupta

              1,5091719




              1,5091719












              • Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
                – wuang li
                Mar 26 '16 at 23:54












              • OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
                – wuang li
                Mar 27 '16 at 4:20




















              • Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
                – wuang li
                Mar 26 '16 at 23:54












              • OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
                – wuang li
                Mar 27 '16 at 4:20


















              Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
              – wuang li
              Mar 26 '16 at 23:54






              Thank u. But there cron is not working. Do u have another method? If u want , I will send more info.
              – wuang li
              Mar 26 '16 at 23:54














              OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
              – wuang li
              Mar 27 '16 at 4:20






              OK. I am trying to find the solution, so I have find the issue. That is magento core error. To run the cron, magento must generate the schedule internally. so I found the Mage_Cron_Model_Observer->generate(). [link] doc4dev.net/doc/Magento/1/class-Mage_Cron_Model_Observer.html So I reinstall the magento, there is nothing. Thank u everyone.
              – wuang li
              Mar 27 '16 at 4:20















              0














              Need to declare Model in config.xml file.



              <config>
              <global>
              <models>
              <imagerecycle>
              <class>Imagerecycle_Imagerecycle_Model</class>
              </imagerecycle>
              </models>
              </global>
              <crontab>
              <jobs>
              <imagerecycle>
              <schedule>
              <cron_expr>*/10 * * * *</cron_expr>
              </schedule>
              <run>
              <model>imagerecycle/observer::cronexec</model>
              </run>
              </imagerecycle>
              </jobs>
              </crontab>
              </config>





              share|improve this answer


























                0














                Need to declare Model in config.xml file.



                <config>
                <global>
                <models>
                <imagerecycle>
                <class>Imagerecycle_Imagerecycle_Model</class>
                </imagerecycle>
                </models>
                </global>
                <crontab>
                <jobs>
                <imagerecycle>
                <schedule>
                <cron_expr>*/10 * * * *</cron_expr>
                </schedule>
                <run>
                <model>imagerecycle/observer::cronexec</model>
                </run>
                </imagerecycle>
                </jobs>
                </crontab>
                </config>





                share|improve this answer
























                  0












                  0








                  0






                  Need to declare Model in config.xml file.



                  <config>
                  <global>
                  <models>
                  <imagerecycle>
                  <class>Imagerecycle_Imagerecycle_Model</class>
                  </imagerecycle>
                  </models>
                  </global>
                  <crontab>
                  <jobs>
                  <imagerecycle>
                  <schedule>
                  <cron_expr>*/10 * * * *</cron_expr>
                  </schedule>
                  <run>
                  <model>imagerecycle/observer::cronexec</model>
                  </run>
                  </imagerecycle>
                  </jobs>
                  </crontab>
                  </config>





                  share|improve this answer












                  Need to declare Model in config.xml file.



                  <config>
                  <global>
                  <models>
                  <imagerecycle>
                  <class>Imagerecycle_Imagerecycle_Model</class>
                  </imagerecycle>
                  </models>
                  </global>
                  <crontab>
                  <jobs>
                  <imagerecycle>
                  <schedule>
                  <cron_expr>*/10 * * * *</cron_expr>
                  </schedule>
                  <run>
                  <model>imagerecycle/observer::cronexec</model>
                  </run>
                  </imagerecycle>
                  </jobs>
                  </crontab>
                  </config>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 23 '18 at 23:03









                  MR.R DNATH

                  31617




                  31617























                      0














                      To run cron,



                      1) check php is globle command or not if it is globle command you can use it as php else you have to specify full path of php.exe



                      2) you have to create one magento.sh file write command on there which you want (php -f d:workmagentocron.php).



                      3) now create Schedule Task for magento.sh you can create it by this link



                      Thank you.






                      share|improve this answer


























                        0














                        To run cron,



                        1) check php is globle command or not if it is globle command you can use it as php else you have to specify full path of php.exe



                        2) you have to create one magento.sh file write command on there which you want (php -f d:workmagentocron.php).



                        3) now create Schedule Task for magento.sh you can create it by this link



                        Thank you.






                        share|improve this answer
























                          0












                          0








                          0






                          To run cron,



                          1) check php is globle command or not if it is globle command you can use it as php else you have to specify full path of php.exe



                          2) you have to create one magento.sh file write command on there which you want (php -f d:workmagentocron.php).



                          3) now create Schedule Task for magento.sh you can create it by this link



                          Thank you.






                          share|improve this answer












                          To run cron,



                          1) check php is globle command or not if it is globle command you can use it as php else you have to specify full path of php.exe



                          2) you have to create one magento.sh file write command on there which you want (php -f d:workmagentocron.php).



                          3) now create Schedule Task for magento.sh you can create it by this link



                          Thank you.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Oct 28 '18 at 5:15









                          Krunal Pathak

                          409




                          409






























                              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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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%2f107061%2fmagento-cron-is-not-run-on-windows%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

                              1300-talet

                              1300-talet

                              Display a custom attribute below product name in the front-end Magento 1.9.3.8