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;








3















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










share|improve this question
























  • 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

















3















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










share|improve this question
























  • 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













3












3








3








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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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










2 Answers
2






active

oldest

votes


















2














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?"






share|improve this answer























  • @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


















1














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





share|improve this answer

























  • 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











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
);



);













draft saved

draft discarded


















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









2














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?"






share|improve this answer























  • @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















2














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?"






share|improve this answer























  • @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













2












2








2







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?"






share|improve this answer













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?"







share|improve this answer












share|improve this answer



share|improve this answer










answered 3 hours ago









KusalanandaKusalananda

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 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
















@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













1














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





share|improve this answer

























  • 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















1














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





share|improve this answer

























  • 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













1












1








1







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





share|improve this answer















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






share|improve this answer














share|improve this answer



share|improve this answer








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

















  • 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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

Siegen Nawigatsjuun

Log på Navigationsmenu

Log på Navigationsmenu