In RHEL6 root's account I have crontab job:
30 6 18 4 1 /sbin/init 6
It worked fine on the 18th of April and properly restarted my system, BUT it also restarted my OS at 6:30 on next Monday - 25th of April. Anyone knows why?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
You want this instead:
30 6 18 4 * /sbin/init 6
1 you have tells it to run every Monday as well. See cron:
While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" and "day of week" are restricted (not "*"), then either the "day of month" field (3) or the "day of week" field (5) must match the current day.
crontab(5) man page:
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, aren’t *), the command will be run when either field matches the cur- rent 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.