Answer the question
In order to leave comments, you need to log in
Did I record the trigger time in cron correctly?
Hello people.
There is an urgent matter and I will have to turn off the server,
I need to do it at certain dates and at a certain time
, the activation date is February 4 and 7 of this year at 9-30 in the morning,
I sort of did it using a calculator, but I want your help and verification - did I do it right or not .
30 9 4.7 2 fri,mon
Answer the question
In order to leave comments, you need to log in
In crontab, it is better to specify either specific days of the month or days of the week, but not both conditions at once, because they are compared with the "Or" operator. In your case, the row will fire every Monday and Friday, not just the 4th and 7th. In place of the days of the week, it is better to leave the default value (*).
From the crontab description:
Note: The day of a command's execution can be specified by two fields — day of month, and day of week. If both fields are restricted (ie, don't start with *), the command will be run when either
field matches the current time. For example,
``30 4 1.15 * 5'' would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday. One can, however, achieve the desired result by adding a test to the command (see
the last example in EXAMPLE CRON FILE below).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question