回復 1# lttliang
Your may try this
the command to reboot should be something like "shutdown -r now", where -r means to reboot (as opposed to -h which is halt).
Cron is the process for executing commands at a scheduled time. Crontab is the facility to schedule cron jobs. Cron jobs can be run by any user, but because you want to reboot, you'll need to do this as root.
Edit the cron table:
> crontab -e
Now you are in vi, editing the cron table. Add a line like:
0 1 * * * shutdown -r now >/dev/null
This command says, when the minute is 0 and the hour is 1, execute the command "shutdown -r now" and send any standard output to /dev/null (which cause the output to be thrown away).
If you wanted this to happen on only Monday and Friday, you'd change one of the asterisks (first one I believe) to 1,5 (sunday is 0). Do a man on crontab for more details. |