How to run a script everyday between 7 and 8 pm with the time interval of 5 minutes?

Hi,

Can someone help me in running a cronjob everyday between 7 and 8 pm with the time interval of 5 minutes in between to repeat that script. The script is so small and I need that to run daily between this time. Please if possible provide me the syntax for this logic.

Thanks.

0,5,10,15,20,25,30,35,40,45,50,55 19 * * * /path/to/myscript.sh
1 Like

Thanks Jim :slight_smile:

---------- Post updated at 08:27 AM ---------- Previous update was at 07:31 AM ----------

Do i need to create a new file with the code
<0,5,10,15,20,25,30,35,40,45,50,55 19 * * * /path/to/myscript.sh> and make it to run or shall i append this line at the top of my script which i need to run?

Thanks

You need to add the contents shared by Jim to your crontab file. Refer crontab command for scheduling a task.

-Nithin

This also works:

*/5 19 * * * /path/to/myscript.sh