oxygenan
oxygenan

Reputation: 1033

Linux Cron tab Expression for a job run in different hours

I need to have a single cron tab entry configured for a scheduled job

The job runs at

0-4 hours and then 16-20 hours

I tried this

0 */0-4,9-23 * * * some_report.sh
*/15 0-4,9-23 * * * some_report.sh 

I checked this @ site http://cronchecker.net

but its not the correct entry..

How can i configure the cron expression for this job.

Upvotes: 1

Views: 776

Answers (1)

Christian Pekeler
Christian Pekeler

Reputation: 1070

0 0-4,16-20 * * * some_report.sh does exactly what you're asking.

Also try crontab.guru for similar crontab questions.

Upvotes: 1

Related Questions