Systemd timer every minute between 09:15 - 17:15 [duplicate]
Clash Royale CLAN TAG#URR8PPP
This question already has an answer here:
Systemd Timer every minute on specific hours (using a range of values)
2 answers
i need a service to start every minute between 09:15 - 17:15.
Whats the best way to achieve this?
I could make 3 timers, one to start (1) the timer (2) which runs the service every minute and one to stop it (3). but then it wouldn't be robust for reboots in between.
systemd systemd-timer
marked as duplicate by don_crissti, msp9011, Anthony Geoghegan, Rui F Ribeiro, jimmij Feb 6 at 9:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Systemd Timer every minute on specific hours (using a range of values)
2 answers
i need a service to start every minute between 09:15 - 17:15.
Whats the best way to achieve this?
I could make 3 timers, one to start (1) the timer (2) which runs the service every minute and one to stop it (3). but then it wouldn't be robust for reboots in between.
systemd systemd-timer
marked as duplicate by don_crissti, msp9011, Anthony Geoghegan, Rui F Ribeiro, jimmij Feb 6 at 9:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
What about cron?
– Romeo Ninov
Feb 5 at 14:59
1
yes i need the timer to start and stop at :15. i don't see how cron or the other thread is the answer to this
– shmn
Feb 5 at 15:03
@shmn, with cron is quite easy, please check my answer
– Romeo Ninov
Feb 5 at 15:05
add a comment |
This question already has an answer here:
Systemd Timer every minute on specific hours (using a range of values)
2 answers
i need a service to start every minute between 09:15 - 17:15.
Whats the best way to achieve this?
I could make 3 timers, one to start (1) the timer (2) which runs the service every minute and one to stop it (3). but then it wouldn't be robust for reboots in between.
systemd systemd-timer
This question already has an answer here:
Systemd Timer every minute on specific hours (using a range of values)
2 answers
i need a service to start every minute between 09:15 - 17:15.
Whats the best way to achieve this?
I could make 3 timers, one to start (1) the timer (2) which runs the service every minute and one to stop it (3). but then it wouldn't be robust for reboots in between.
This question already has an answer here:
Systemd Timer every minute on specific hours (using a range of values)
2 answers
systemd systemd-timer
systemd systemd-timer
edited Feb 5 at 17:27
Rui F Ribeiro
40.6k1479137
40.6k1479137
asked Feb 5 at 14:47
shmnshmn
82
82
marked as duplicate by don_crissti, msp9011, Anthony Geoghegan, Rui F Ribeiro, jimmij Feb 6 at 9:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by don_crissti, msp9011, Anthony Geoghegan, Rui F Ribeiro, jimmij Feb 6 at 9:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
What about cron?
– Romeo Ninov
Feb 5 at 14:59
1
yes i need the timer to start and stop at :15. i don't see how cron or the other thread is the answer to this
– shmn
Feb 5 at 15:03
@shmn, with cron is quite easy, please check my answer
– Romeo Ninov
Feb 5 at 15:05
add a comment |
What about cron?
– Romeo Ninov
Feb 5 at 14:59
1
yes i need the timer to start and stop at :15. i don't see how cron or the other thread is the answer to this
– shmn
Feb 5 at 15:03
@shmn, with cron is quite easy, please check my answer
– Romeo Ninov
Feb 5 at 15:05
What about cron?
– Romeo Ninov
Feb 5 at 14:59
What about cron?
– Romeo Ninov
Feb 5 at 14:59
1
1
yes i need the timer to start and stop at :15. i don't see how cron or the other thread is the answer to this
– shmn
Feb 5 at 15:03
yes i need the timer to start and stop at :15. i don't see how cron or the other thread is the answer to this
– shmn
Feb 5 at 15:03
@shmn, with cron is quite easy, please check my answer
– Romeo Ninov
Feb 5 at 15:05
@shmn, with cron is quite easy, please check my answer
– Romeo Ninov
Feb 5 at 15:05
add a comment |
3 Answers
3
active
oldest
votes
You can create a single timer unit with multiple OnCalendar=
settings, which will allow you to specify the exact interval you want.
If you look at the man page for systemd.timer, the OnCalendar=
section says:
May be specified more than once.
So use three separate settings for the start, middle and end:
[Timer]
OnCalendar=*-*-* 09:15..59:00
OnCalendar=*-*-* 10..16:*:00
OnCalendar=*-*-* 17:00..15:00
This should trigger the timer every minute between the times of 9:15 to 17:15, inclusive.
add a comment |
To run exactly between desired times you need 3 records in cron
15-59 9 * * * /path/to/task
* 10-16 * * * /path/to/task
0-15 17 * * * /path/to/task
1
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
add a comment |
Does it have to be a Systemd timer? You could also create a cronjob for this task. For example like this:
*/1 9-17 * * * /bin/systemctl restart SERVICE
This wouldn't run it exactly between 9:15 and 17:15 o'clock but between 9 o'clock and 17:59. But im not too skilled in creating advanced cronjobs...
Hope this helps.
1
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can create a single timer unit with multiple OnCalendar=
settings, which will allow you to specify the exact interval you want.
If you look at the man page for systemd.timer, the OnCalendar=
section says:
May be specified more than once.
So use three separate settings for the start, middle and end:
[Timer]
OnCalendar=*-*-* 09:15..59:00
OnCalendar=*-*-* 10..16:*:00
OnCalendar=*-*-* 17:00..15:00
This should trigger the timer every minute between the times of 9:15 to 17:15, inclusive.
add a comment |
You can create a single timer unit with multiple OnCalendar=
settings, which will allow you to specify the exact interval you want.
If you look at the man page for systemd.timer, the OnCalendar=
section says:
May be specified more than once.
So use three separate settings for the start, middle and end:
[Timer]
OnCalendar=*-*-* 09:15..59:00
OnCalendar=*-*-* 10..16:*:00
OnCalendar=*-*-* 17:00..15:00
This should trigger the timer every minute between the times of 9:15 to 17:15, inclusive.
add a comment |
You can create a single timer unit with multiple OnCalendar=
settings, which will allow you to specify the exact interval you want.
If you look at the man page for systemd.timer, the OnCalendar=
section says:
May be specified more than once.
So use three separate settings for the start, middle and end:
[Timer]
OnCalendar=*-*-* 09:15..59:00
OnCalendar=*-*-* 10..16:*:00
OnCalendar=*-*-* 17:00..15:00
This should trigger the timer every minute between the times of 9:15 to 17:15, inclusive.
You can create a single timer unit with multiple OnCalendar=
settings, which will allow you to specify the exact interval you want.
If you look at the man page for systemd.timer, the OnCalendar=
section says:
May be specified more than once.
So use three separate settings for the start, middle and end:
[Timer]
OnCalendar=*-*-* 09:15..59:00
OnCalendar=*-*-* 10..16:*:00
OnCalendar=*-*-* 17:00..15:00
This should trigger the timer every minute between the times of 9:15 to 17:15, inclusive.
answered Feb 5 at 15:14
filbrandenfilbranden
9,55121343
9,55121343
add a comment |
add a comment |
To run exactly between desired times you need 3 records in cron
15-59 9 * * * /path/to/task
* 10-16 * * * /path/to/task
0-15 17 * * * /path/to/task
1
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
add a comment |
To run exactly between desired times you need 3 records in cron
15-59 9 * * * /path/to/task
* 10-16 * * * /path/to/task
0-15 17 * * * /path/to/task
1
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
add a comment |
To run exactly between desired times you need 3 records in cron
15-59 9 * * * /path/to/task
* 10-16 * * * /path/to/task
0-15 17 * * * /path/to/task
To run exactly between desired times you need 3 records in cron
15-59 9 * * * /path/to/task
* 10-16 * * * /path/to/task
0-15 17 * * * /path/to/task
answered Feb 5 at 15:05
Romeo NinovRomeo Ninov
6,54132028
6,54132028
1
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
add a comment |
1
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
1
1
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
ah thanks for the idea, i can make the samething with 3 systemd timers (i manage everything with them so starting with cron would cause confusion): 09:00..15:00 10..16:*:00 17:00..15:00
– shmn
Feb 5 at 15:11
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
@shmn, its up to you, but cron is much old and stable technology :)
– Romeo Ninov
Feb 5 at 15:12
add a comment |
Does it have to be a Systemd timer? You could also create a cronjob for this task. For example like this:
*/1 9-17 * * * /bin/systemctl restart SERVICE
This wouldn't run it exactly between 9:15 and 17:15 o'clock but between 9 o'clock and 17:59. But im not too skilled in creating advanced cronjobs...
Hope this helps.
1
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
add a comment |
Does it have to be a Systemd timer? You could also create a cronjob for this task. For example like this:
*/1 9-17 * * * /bin/systemctl restart SERVICE
This wouldn't run it exactly between 9:15 and 17:15 o'clock but between 9 o'clock and 17:59. But im not too skilled in creating advanced cronjobs...
Hope this helps.
1
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
add a comment |
Does it have to be a Systemd timer? You could also create a cronjob for this task. For example like this:
*/1 9-17 * * * /bin/systemctl restart SERVICE
This wouldn't run it exactly between 9:15 and 17:15 o'clock but between 9 o'clock and 17:59. But im not too skilled in creating advanced cronjobs...
Hope this helps.
Does it have to be a Systemd timer? You could also create a cronjob for this task. For example like this:
*/1 9-17 * * * /bin/systemctl restart SERVICE
This wouldn't run it exactly between 9:15 and 17:15 o'clock but between 9 o'clock and 17:59. But im not too skilled in creating advanced cronjobs...
Hope this helps.
answered Feb 5 at 15:03
majesticLSDmajesticLSD
763
763
1
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
add a comment |
1
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
1
1
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
i have the same functionality with systemd (9..17:*:00) but this is just a workaround as the service doesn't really work before 9:15 and after 17:15
– shmn
Feb 5 at 15:06
add a comment |
What about cron?
– Romeo Ninov
Feb 5 at 14:59
1
yes i need the timer to start and stop at :15. i don't see how cron or the other thread is the answer to this
– shmn
Feb 5 at 15:03
@shmn, with cron is quite easy, please check my answer
– Romeo Ninov
Feb 5 at 15:05