Link to home
Start Free TrialLog in
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?
ASKER CERTIFIED SOLUTION
Avatar of flyjedi
flyjedi
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doolyo

ASKER

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