specify a time interval in which to execute a certain scriptRun commands at a specified timeHow to send a mail for every 10 minutes through shell script?Hardware and software inventoryingbash using grep and sedHow to execute recurring Bash script at specific times?Execute command after inotifywait established watchesRun certain script periodically at boot timeBoot computer on schedule 2 times per weekdayStart playing a video at a certain timeDisable Cron for specific interval of timeAutomatically save the text-only of every web page visited?Execute script at crontab
Partition error (Fdisk/Parted)
Placing rectangle box above tikz figure?
Is there an idiom that means "revealing a secret unintentionally"?
Is there a list of the most-transited airports in the world?
Do oversize pulley wheels increase derailleur capacity?
Using mean length and mean weight to calculate mean BMI?
Do these creatures from the Tomb of Annihilation campaign speak Common?
What are my options legally if NYC company is not paying salary?
Company stopped my paying salary. What are my options?
Names of the Six Tastes
Why doesn't a particle exert force on itself?
How do I give a darkroom course without negatives from the attendees?
Is the BCH version of Schnorr signatures compatible with taproot?
What's the 2-minute timer on mobile Deutsche Bahn tickets?
Magical Modulo Squares
Is the tensor product (of vector spaces) commutative?
Is it possible to do moon sighting in advance for 5 years with 100% accuracy?
Opposite party turned away from voting when ballot is all opposing party
The unknown and unexplained in science fiction
C++ : What is the order of function pointers inside vtable?
Visual Studio Code download existing code
Justification of physical currency in an interstellar civilization?
Why did Missandei say this?
Visualize multiple string segments
specify a time interval in which to execute a certain script
Run commands at a specified timeHow to send a mail for every 10 minutes through shell script?Hardware and software inventoryingbash using grep and sedHow to execute recurring Bash script at specific times?Execute command after inotifywait established watchesRun certain script periodically at boot timeBoot computer on schedule 2 times per weekdayStart playing a video at a certain timeDisable Cron for specific interval of timeAutomatically save the text-only of every web page visited?Execute script at crontab
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have this bash script:
while [[ 1 ]] ; do sleep 3600 ; ./notify.sh --text "ricordati di bere" && play /mnt/musica/login.wav && zenity --info --text="<span size="xx-large">Time is $(date +%Hh%M).</span>nnricordati di <b>bere</b>." --title="drink time" ; done
I'd like to execute this script (from 8:00 o'clock, less important) to 19:00 (most important); it's possible?
I have seen at command, but I didn't find how set "until" or "before".
This question is different from this
bash cron at
add a comment |
I have this bash script:
while [[ 1 ]] ; do sleep 3600 ; ./notify.sh --text "ricordati di bere" && play /mnt/musica/login.wav && zenity --info --text="<span size="xx-large">Time is $(date +%Hh%M).</span>nnricordati di <b>bere</b>." --title="drink time" ; done
I'd like to execute this script (from 8:00 o'clock, less important) to 19:00 (most important); it's possible?
I have seen at command, but I didn't find how set "until" or "before".
This question is different from this
bash cron at
Monday through Friday or 7 days a week? What if the script fired regularly but only notified between those hours?
– Jeff Schaller♦
3 hours ago
add a comment |
I have this bash script:
while [[ 1 ]] ; do sleep 3600 ; ./notify.sh --text "ricordati di bere" && play /mnt/musica/login.wav && zenity --info --text="<span size="xx-large">Time is $(date +%Hh%M).</span>nnricordati di <b>bere</b>." --title="drink time" ; done
I'd like to execute this script (from 8:00 o'clock, less important) to 19:00 (most important); it's possible?
I have seen at command, but I didn't find how set "until" or "before".
This question is different from this
bash cron at
I have this bash script:
while [[ 1 ]] ; do sleep 3600 ; ./notify.sh --text "ricordati di bere" && play /mnt/musica/login.wav && zenity --info --text="<span size="xx-large">Time is $(date +%Hh%M).</span>nnricordati di <b>bere</b>." --title="drink time" ; done
I'd like to execute this script (from 8:00 o'clock, less important) to 19:00 (most important); it's possible?
I have seen at command, but I didn't find how set "until" or "before".
This question is different from this
bash cron at
bash cron at
edited 3 hours ago
αғsнιη
18k103271
18k103271
asked 3 hours ago
DunsDuns
396
396
Monday through Friday or 7 days a week? What if the script fired regularly but only notified between those hours?
– Jeff Schaller♦
3 hours ago
add a comment |
Monday through Friday or 7 days a week? What if the script fired regularly but only notified between those hours?
– Jeff Schaller♦
3 hours ago
Monday through Friday or 7 days a week? What if the script fired regularly but only notified between those hours?
– Jeff Schaller♦
3 hours ago
Monday through Friday or 7 days a week? What if the script fired regularly but only notified between those hours?
– Jeff Schaller♦
3 hours ago
add a comment |
2 Answers
2
active
oldest
votes
You would do the scheduling with cron. The schedule would look like
0 8-19 * * * /path/to/script
or
0 8,9,10,11,12,13,14,15,16,17,18,19 * * * /path/to/script
and the script would look like
#!/bin/sh
./notify.sh --text "ricordati di bere" &&
play /mnt/musica/login.wav &&
zenity --info
--text="<span size="xx-large">Time is $(date +%Hh%M)</span>nnricordati di <b>bere</b>."
--title="drink time"
See also "How to send a mail for every 10 minutes through shell script?"
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab withsudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.
– Kusalananda♦
34 mins ago
add a comment |
Presuming you use Linux, timeout is the simplest way to do this. 08:00 to 19:00 is 11 hours, so we tell timeout to run the script for 11 hours.
timeout 11h /home/username/script
Start the job with cron at 08:00 (or manually whenever you wish) and have it killed automatically at 19:00 sharp with another cron entry
kill -9 /home/username/script
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
add a comment |
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',
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
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f517611%2fspecify-a-time-interval-in-which-to-execute-a-certain-script%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You would do the scheduling with cron. The schedule would look like
0 8-19 * * * /path/to/script
or
0 8,9,10,11,12,13,14,15,16,17,18,19 * * * /path/to/script
and the script would look like
#!/bin/sh
./notify.sh --text "ricordati di bere" &&
play /mnt/musica/login.wav &&
zenity --info
--text="<span size="xx-large">Time is $(date +%Hh%M)</span>nnricordati di <b>bere</b>."
--title="drink time"
See also "How to send a mail for every 10 minutes through shell script?"
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab withsudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.
– Kusalananda♦
34 mins ago
add a comment |
You would do the scheduling with cron. The schedule would look like
0 8-19 * * * /path/to/script
or
0 8,9,10,11,12,13,14,15,16,17,18,19 * * * /path/to/script
and the script would look like
#!/bin/sh
./notify.sh --text "ricordati di bere" &&
play /mnt/musica/login.wav &&
zenity --info
--text="<span size="xx-large">Time is $(date +%Hh%M)</span>nnricordati di <b>bere</b>."
--title="drink time"
See also "How to send a mail for every 10 minutes through shell script?"
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab withsudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.
– Kusalananda♦
34 mins ago
add a comment |
You would do the scheduling with cron. The schedule would look like
0 8-19 * * * /path/to/script
or
0 8,9,10,11,12,13,14,15,16,17,18,19 * * * /path/to/script
and the script would look like
#!/bin/sh
./notify.sh --text "ricordati di bere" &&
play /mnt/musica/login.wav &&
zenity --info
--text="<span size="xx-large">Time is $(date +%Hh%M)</span>nnricordati di <b>bere</b>."
--title="drink time"
See also "How to send a mail for every 10 minutes through shell script?"
You would do the scheduling with cron. The schedule would look like
0 8-19 * * * /path/to/script
or
0 8,9,10,11,12,13,14,15,16,17,18,19 * * * /path/to/script
and the script would look like
#!/bin/sh
./notify.sh --text "ricordati di bere" &&
play /mnt/musica/login.wav &&
zenity --info
--text="<span size="xx-large">Time is $(date +%Hh%M)</span>nnricordati di <b>bere</b>."
--title="drink time"
See also "How to send a mail for every 10 minutes through shell script?"
answered 3 hours ago
Kusalananda♦Kusalananda
145k18274454
145k18274454
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab withsudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.
– Kusalananda♦
34 mins ago
add a comment |
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab withsudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.
– Kusalananda♦
34 mins ago
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab with
sudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.– Kusalananda♦
34 mins ago
@Duns If you added the cron job as root, then it's added to root's crontab. You would view root's crontab with
sudo crontab -l. However, I just realised that you are trying to use GUI applications, so using cron for this may not be the easiest solution. Cron jobs have no connection to the display and can't generally open dialog boxes or windows.– Kusalananda♦
34 mins ago
add a comment |
Presuming you use Linux, timeout is the simplest way to do this. 08:00 to 19:00 is 11 hours, so we tell timeout to run the script for 11 hours.
timeout 11h /home/username/script
Start the job with cron at 08:00 (or manually whenever you wish) and have it killed automatically at 19:00 sharp with another cron entry
kill -9 /home/username/script
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
add a comment |
Presuming you use Linux, timeout is the simplest way to do this. 08:00 to 19:00 is 11 hours, so we tell timeout to run the script for 11 hours.
timeout 11h /home/username/script
Start the job with cron at 08:00 (or manually whenever you wish) and have it killed automatically at 19:00 sharp with another cron entry
kill -9 /home/username/script
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
add a comment |
Presuming you use Linux, timeout is the simplest way to do this. 08:00 to 19:00 is 11 hours, so we tell timeout to run the script for 11 hours.
timeout 11h /home/username/script
Start the job with cron at 08:00 (or manually whenever you wish) and have it killed automatically at 19:00 sharp with another cron entry
kill -9 /home/username/script
Presuming you use Linux, timeout is the simplest way to do this. 08:00 to 19:00 is 11 hours, so we tell timeout to run the script for 11 hours.
timeout 11h /home/username/script
Start the job with cron at 08:00 (or manually whenever you wish) and have it killed automatically at 19:00 sharp with another cron entry
kill -9 /home/username/script
edited 1 hour ago
answered 3 hours ago
K7AAYK7AAY
1,2421028
1,2421028
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
add a comment |
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
Thanks, but I start the Pc non always at the same time, so your solution is not what I search for.
– Duns
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
See rephrasing above which shows greater flexibility.
– K7AAY
1 hour ago
add a comment |
Thanks for contributing an answer to Unix & Linux 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.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f517611%2fspecify-a-time-interval-in-which-to-execute-a-certain-script%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
Monday through Friday or 7 days a week? What if the script fired regularly but only notified between those hours?
– Jeff Schaller♦
3 hours ago