What decides when cron.hourly runs?

Clash 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?
cron
add a comment |Â
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?
cron
add a comment |Â
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?
cron
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
cron
edited 13 mins ago
Rui F Ribeiro
37.4k1374118
37.4k1374118
asked Jun 15 '17 at 16:36
Rahman
4112
4112
add a comment |Â
add a comment |Â
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.
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 thecrontabutility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontabwould do some sanity checks before actually saving the file.)
â ilkkachu
Jun 16 '17 at 8:31
add a comment |Â
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.
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 thecrontabutility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontabwould do some sanity checks before actually saving the file.)
â ilkkachu
Jun 16 '17 at 8:31
add a comment |Â
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.
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 thecrontabutility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontabwould do some sanity checks before actually saving the file.)
â ilkkachu
Jun 16 '17 at 8:31
add a comment |Â
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.
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.
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 thecrontabutility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontabwould do some sanity checks before actually saving the file.)
â ilkkachu
Jun 16 '17 at 8:31
add a comment |Â
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 thecrontabutility just edits the per-user crontabs, so I don't think you have a choice but to edit manually. (crontabwould 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password