Avatar of doolyo
doolyoFlag for Switzerland asked on

configuring crontab to run specific days of the month only (comma separated day numbers)

I would like to configure a cron task to be run only the 1st and the 15th of the month (let's say in /etc/crontab).
I have tried this specification:
09 20 1,15 * * root /root/scripts/myscript.sh

This makes it still run every day instead of the days specified with the comma separator. It probably comes from the fact that there are the days number specifiers AND the days in the week specifiers, and that the second is put to * which means each day.
This is what happens on my system: it is run every day instead of the specified 1 and 15 numbers.
Can someone help me?
Linux

Avatar of undefined
Last Comment
doolyo

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
flyjedi

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
doolyo

Thanks for that information. At least I know that the command was properly typed, which I was in doubt.
This made me go further and I saw some other cron file where other days were mistakenly specified.
Most probably this will solve the problem. I will post another request in case it wouldn't be the case. I have to wait several das to know if it solved it or not.

Thank you flyjedi!
Daniel
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck