Cron few days a month

I wonder if there is a way to cron a job using @monthly to run from 3rd to 6th of every month, once a day only.
LVL 31
farzanjAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BasementCatConnect With a Mentor Commented:
I believe you can put multiple values in a single field in your crontab file, like so:
0    0   3,4,5,6    *    *   ./your-command

Open in new window

which would run the command on the 3rd, 4th, 5th, and 6th of every month at 12:00 am
0
 
night_monkeyCommented:
how about setting up four separate identical cron jobs with a different schedule? setting each to run on the 3rd, 4th, 5th, and 6th?

too clunky?
0
 
mccrackyConnect With a Mentor Commented:
BasementCat is correct and bear me to it.
0
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

 
mccrackyCommented:
s/bear/beat/
0
 
BasementCatConnect With a Mentor Commented:
As a side note, you may be able to use a hyphenated range instead - rather than 3,4,5,6 you probably can use 3-6
0
 
farzanjAuthor Commented:
Sorry, dumb question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.