What decides when cron.hourly runs?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












For some reason my cron.hourly is executing at 17 minutes past the hour. The number of seconds past 00:17 is seemingly random.



Why would it execute at 17 and not at 00? Is there a way to set this? Is it always going to be 17 or will that vary from day to day or month to month?










share|improve this question



























    up vote
    5
    down vote

    favorite












    For some reason my cron.hourly is executing at 17 minutes past the hour. The number of seconds past 00:17 is seemingly random.



    Why would it execute at 17 and not at 00? Is there a way to set this? Is it always going to be 17 or will that vary from day to day or month to month?










    share|improve this question

























      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      For some reason my cron.hourly is executing at 17 minutes past the hour. The number of seconds past 00:17 is seemingly random.



      Why would it execute at 17 and not at 00? Is there a way to set this? Is it always going to be 17 or will that vary from day to day or month to month?










      share|improve this question















      For some reason my cron.hourly is executing at 17 minutes past the hour. The number of seconds past 00:17 is seemingly random.



      Why would it execute at 17 and not at 00? Is there a way to set this? Is it always going to be 17 or will that vary from day to day or month to month?







      cron






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 13 mins ago









      Rui F Ribeiro

      37.4k1374118




      37.4k1374118










      asked Jun 15 '17 at 16:36









      Rahman

      4112




      4112




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote













          cron.hourly, cron.daily and friends are probably started from the system's main crontab in /etc/crontab. For example, in Debian, the relevant line is this:



          # m h dom mon dow user command
          17 * * * * root cd / && run-parts --report /etc/cron.hourly


          The idea behind not running exactly on the hour is to make the load spikes from multiple cron jobs less sharp. cron.daily jobs are started at another minute, so the hourly and daily jobs don't start at the same time. And if users set their own cron jobs to run on the hour, at least these will not start at the same time. In most housekeeping-type jobs the exact time of running doesn't matter.






          share|improve this answer




















          • You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
            – Rahman
            Jun 16 '17 at 2:45











          • @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
            – ilkkachu
            Jun 16 '17 at 8:31











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f371354%2fwhat-decides-when-cron-hourly-runs%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          5
          down vote













          cron.hourly, cron.daily and friends are probably started from the system's main crontab in /etc/crontab. For example, in Debian, the relevant line is this:



          # m h dom mon dow user command
          17 * * * * root cd / && run-parts --report /etc/cron.hourly


          The idea behind not running exactly on the hour is to make the load spikes from multiple cron jobs less sharp. cron.daily jobs are started at another minute, so the hourly and daily jobs don't start at the same time. And if users set their own cron jobs to run on the hour, at least these will not start at the same time. In most housekeeping-type jobs the exact time of running doesn't matter.






          share|improve this answer




















          • You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
            – Rahman
            Jun 16 '17 at 2:45











          • @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
            – ilkkachu
            Jun 16 '17 at 8:31















          up vote
          5
          down vote













          cron.hourly, cron.daily and friends are probably started from the system's main crontab in /etc/crontab. For example, in Debian, the relevant line is this:



          # m h dom mon dow user command
          17 * * * * root cd / && run-parts --report /etc/cron.hourly


          The idea behind not running exactly on the hour is to make the load spikes from multiple cron jobs less sharp. cron.daily jobs are started at another minute, so the hourly and daily jobs don't start at the same time. And if users set their own cron jobs to run on the hour, at least these will not start at the same time. In most housekeeping-type jobs the exact time of running doesn't matter.






          share|improve this answer




















          • You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
            – Rahman
            Jun 16 '17 at 2:45











          • @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
            – ilkkachu
            Jun 16 '17 at 8:31













          up vote
          5
          down vote










          up vote
          5
          down vote









          cron.hourly, cron.daily and friends are probably started from the system's main crontab in /etc/crontab. For example, in Debian, the relevant line is this:



          # m h dom mon dow user command
          17 * * * * root cd / && run-parts --report /etc/cron.hourly


          The idea behind not running exactly on the hour is to make the load spikes from multiple cron jobs less sharp. cron.daily jobs are started at another minute, so the hourly and daily jobs don't start at the same time. And if users set their own cron jobs to run on the hour, at least these will not start at the same time. In most housekeeping-type jobs the exact time of running doesn't matter.






          share|improve this answer












          cron.hourly, cron.daily and friends are probably started from the system's main crontab in /etc/crontab. For example, in Debian, the relevant line is this:



          # m h dom mon dow user command
          17 * * * * root cd / && run-parts --report /etc/cron.hourly


          The idea behind not running exactly on the hour is to make the load spikes from multiple cron jobs less sharp. cron.daily jobs are started at another minute, so the hourly and daily jobs don't start at the same time. And if users set their own cron jobs to run on the hour, at least these will not start at the same time. In most housekeeping-type jobs the exact time of running doesn't matter.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 15 '17 at 16:40









          ilkkachu

          53k680145




          53k680145











          • You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
            – Rahman
            Jun 16 '17 at 2:45











          • @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
            – ilkkachu
            Jun 16 '17 at 8:31

















          • You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
            – Rahman
            Jun 16 '17 at 2:45











          • @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
            – ilkkachu
            Jun 16 '17 at 8:31
















          You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
          – Rahman
          Jun 16 '17 at 2:45





          You are correct! I now see that the actual cron jobs that I add when doing crontab -e are actually located in /var/spool/cron. How do I edit those that are in the main crontab file? man says I am supposed to use crontab -e but when I do that none of the run-parts commands show up :( Should I just manually edit /etc/crontab instead? For example if I want to change it from 17 past the hour to on the hour precisely?
          – Rahman
          Jun 16 '17 at 2:45













          @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
          – ilkkachu
          Jun 16 '17 at 8:31





          @Rahman, I've always just edited it, but then, I don't always go by the book... That said, I think the crontab utility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontab would do some sanity checks before actually saving the file.)
          – ilkkachu
          Jun 16 '17 at 8:31


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f371354%2fwhat-decides-when-cron-hourly-runs%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          The Forum (Inglewood, California)

          Palaiologos