Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Is there a way to automattically reboot the entire linux server on a nightly basis, at a certain time?
Thanks,
nathan

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 -eNow 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.

well i use my linux server as a router, and i find after a few days, or after downloading alot of data, the internet connection for the whole network slows down. but as soon as i reboot the server it runs back at normal speed.

![]() |
/etc/bashrc
|
Samba PDC
|

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