I use the root cron jobs to do this automatically.
I created a file using vi with a single line with the reboot command:
/usr/sbin/shutdown -y -g0 -i6
To create files using vi you have to be logged in as root.
If you don't know how to use vi editor, look it up online and get familar with it first.
I used chmod to make the file executable:
chmod 775 [filename]
Then I edited the root cron jobs to execute it once a month on the 3rd Thursday of the month at 3:10am which is our scheduled window for reboots:
***AGAIN, If you don't know how to use vi editor, look it up online and get familar with it before you access and change the cron file. You DON'T want to screw this up. Good idea is to copy the file to another file name so you have a backup to replace anything you might screw up.
While logged in as root, execute command "crontab -e" go to the last line of the cron file and enter what you need, mine is:
10 3 15-21 * 4 /[file directory path]/[filename]
10 = minute
3 = hr of day (24hr format)
15-21 = day of the month (ranges are allowed)3rd Thursday will always fall between 15 and 21.
* is month, since I want this to run every month entry is a *
4 = day of the week, the week starts with 0 as Sunday so 4 is Thursday
If you want is as simple as once every month on the 1st at midnight the entry would look like:
0 0 1 * * /[file directory path]/[filename]
Or every 3rd month starting with January would look like:
0 0 * 1,4,7,10 * /[file directory path]/[filename]
The file directory path has to be the full path so if you have this in a subdirectory you need the line to include the root directory and all subdirectories. Mine is /appbin/sys_maint/[filename]
Hope this helps.
- Stinney
Quoting only proves you know how to cut and paste.