I would like to run the cron job every 20 minutes between 9 AM and 11 PM and once an hour after 11 PM until 9 AM.
I created 2 cron jobs for the same script to achieve my goal. Did I do it correctly? Thank you.
I would like to run the cron job every 20 minutes between 9 AM and 11 PM and once an hour after 11 PM until 9 AM.
I created 2 cron jobs for the same script to achieve my goal. Did I do it correctly? Thank you.
Not really. There are two issues:
The way to do it is:
*/20 9-22 * * * command
0 0-8,23 * * * command
You can validate this using crontab guru