I don't have a box to test a cron job so I am posting it here.
I want to run a job every hour between 6 am to 18:00.This is what I have tried
0 6-18/1 * * * <command>
and
0 6-18 * * * <command>
Which one is the correct way of achieving it
It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .
Meaning of cron expression 0 * * * * *? I think it means the scheduler is expected to run every seconds.
Cron jobs are scheduled at recurring intervals, specified using a format based on unix-cron. You can define a schedule so that your job runs multiple times a day, or runs on specific days and months.
Both should work, but I would probably use the second one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With