How to run cron job
every day from 8:00 AM
to 8:00 PM
at 20 minutes interval eg cron job should start at 8:00 AM
every day, then run at 8:20 AM
then 8:40 AM
then 9:00 AM
up to 8:00 PM
. Thanks.
EDIT: How to Implement it with ruby whenever
gem.
Just use two cronjobs:
*/20 8-19 * * * /your/script
0 20 * * * /your/script
That is:
As a reminder, this is the format for a cronjob:
+---------------- minute (0 - 59)
| +------------- hour (0 - 23)
| | +---------- day of month (1 - 31)
| | | +------- month (1 - 12)
| | | | +---- day of week (0 - 6) (Sunday=0 or 7)
| | | | |
* * * * * command to be executed