Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,I would like to set a cron job from 9th to the
end of the month.So I did it like:
0 1 9-31 * * echo "Testing CronJob"But I am not sure what will happen for Febraury and for 30 day months like April,June etc..That is what will happen for 31st which does not exist for these,ie. will my script work on 1st of the next month.
Regards

From "man 5 crontab" on a linux system:
"Commands are executed by cron(8) when the minute, hour, and month of year fields match the current time, and when at least one of the two day fields (day of month, or day of week) match the current time (see ``Note'' below). Note that this means
that non-existant times, such as "missing hours" during daylight savings conversion, will never match, causing jobs scheduled during the "missing times" not to be run. Similarly, times that occur more than once (again, during daylight savings conversion) will cause matching jobs to be run twice."I would say that your dates, Feb 30 etc, would fall under the 'missing times' definition mentioned above, and would therefore be skipped

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |