-1

i'm not sure about something and that's why asking i want a process to run every 19th of the month in 2am

i don't want the cron to run after that time or before and only when the date is 19th - in every month and in every year

is that the right code?

2 0 19  * * /usr/local/ss/script.sh 2>&1 > /dev/null &

i just want to make sure

sd1sd1
  • 99
  • 2

1 Answers1

4

No, the format is not right. The crontab has minutes first, then hours. So you would need:

0 2 19  * * /usr/local/ss/script.sh 2>&1 > /dev/null &

Additionally 2:00 is a potentially problematic time to use due to DST. Running at 3:01 would be safer, or even 3:03 (such that you don't risk swapping minutes and hours).

3 3 19  * * /usr/local/ss/script.sh 2>&1 > /dev/null &
kasperd
  • 29,894
  • 16
  • 72
  • 122