Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cron every hour between 6 am to 18:00 [closed]

Tags:

cron

crontab

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

like image 542
Abx Avatar asked Nov 19 '15 04:11

Abx


People also ask

What is the use of * * * * * In cron?

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 .

What is cron expression 0 * * * *?

Meaning of cron expression 0 * * * * *? I think it means the scheduler is expected to run every seconds.

How do I set a cron schedule?

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.


1 Answers

Both should work, but I would probably use the second one.

like image 105
sb2150 Avatar answered Sep 21 '22 06:09

sb2150