Laravel Scheduling - Only everyMinute works












0















It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P



Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1



Schedule entry:



$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->daily();


So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?










share|improve this question



























    0















    It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P



    Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1



    Schedule entry:



    $schedule->call(function () {
    $stat = new Stat();
    $stat->users = User::count();
    $stat->reviews = Review::count();
    $stat->scholen = School::count();
    $stat->save();
    })->daily();


    So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?










    share|improve this question

























      0












      0








      0








      It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P



      Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1



      Schedule entry:



      $schedule->call(function () {
      $stat = new Stat();
      $stat->users = User::count();
      $stat->reviews = Review::count();
      $stat->scholen = School::count();
      $stat->save();
      })->daily();


      So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?










      share|improve this question














      It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P



      Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1



      Schedule entry:



      $schedule->call(function () {
      $stat = new Stat();
      $stat->users = User::count();
      $stat->reviews = Review::count();
      $stat->scholen = School::count();
      $stat->save();
      })->daily();


      So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?







      php laravel cron






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 30 '18 at 23:58









      TeunissenStefanTeunissenStefan

      221114




      221114
























          1 Answer
          1






          active

          oldest

          votes


















          0














          So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.



          So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.



          So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.



          $schedule->call(function () {
          $stat = new Stat();
          $stat->users = User::count();
          $stat->reviews = Review::count();
          $stat->scholen = School::count();
          $stat->save();
          })->everyFiveMinutes();


          So with the function ->everyFiveMinutes(); you can run the scheduler every five minutes.






          share|improve this answer
























          • I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

            – TeunissenStefan
            Dec 31 '18 at 11:04













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2fstackoverflow.com%2fquestions%2f53982421%2flaravel-scheduling-only-everyminute-works%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














          So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.



          So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.



          So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.



          $schedule->call(function () {
          $stat = new Stat();
          $stat->users = User::count();
          $stat->reviews = Review::count();
          $stat->scholen = School::count();
          $stat->save();
          })->everyFiveMinutes();


          So with the function ->everyFiveMinutes(); you can run the scheduler every five minutes.






          share|improve this answer
























          • I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

            – TeunissenStefan
            Dec 31 '18 at 11:04


















          0














          So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.



          So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.



          So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.



          $schedule->call(function () {
          $stat = new Stat();
          $stat->users = User::count();
          $stat->reviews = Review::count();
          $stat->scholen = School::count();
          $stat->save();
          })->everyFiveMinutes();


          So with the function ->everyFiveMinutes(); you can run the scheduler every five minutes.






          share|improve this answer
























          • I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

            – TeunissenStefan
            Dec 31 '18 at 11:04
















          0












          0








          0







          So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.



          So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.



          So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.



          $schedule->call(function () {
          $stat = new Stat();
          $stat->users = User::count();
          $stat->reviews = Review::count();
          $stat->scholen = School::count();
          $stat->save();
          })->everyFiveMinutes();


          So with the function ->everyFiveMinutes(); you can run the scheduler every five minutes.






          share|improve this answer













          So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.



          So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.



          So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.



          $schedule->call(function () {
          $stat = new Stat();
          $stat->users = User::count();
          $stat->reviews = Review::count();
          $stat->scholen = School::count();
          $stat->save();
          })->everyFiveMinutes();


          So with the function ->everyFiveMinutes(); you can run the scheduler every five minutes.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 31 '18 at 2:47









          StonyStony

          20.2k135264




          20.2k135264













          • I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

            – TeunissenStefan
            Dec 31 '18 at 11:04





















          • I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

            – TeunissenStefan
            Dec 31 '18 at 11:04



















          I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

          – TeunissenStefan
          Dec 31 '18 at 11:04







          I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.

          – TeunissenStefan
          Dec 31 '18 at 11:04




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f53982421%2flaravel-scheduling-only-everyminute-works%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

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas