Computing.Net > Forums > Linux > Auto rebooting server nightly

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Auto rebooting server nightly

Reply to Message Icon

Name: nathan
Date: November 4, 2002 at 23:32:10 Pacific
OS: linux 7.3
CPU/Ram: AMD1600
Comment:

Is there a way to automattically reboot the entire linux server on a nightly basis, at a certain time?

Thanks,
nathan



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: November 5, 2002 at 00:07:28 Pacific
Reply:

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.


0

Response Number 2
Name: Jake
Date: November 5, 2002 at 06:26:14 Pacific
Reply:

Why would you want to do this? Linux doesn't have the same memory issues as Windows.


0

Response Number 3
Name: Richard
Date: November 5, 2002 at 07:25:13 Pacific
Reply:

In fact, the longer a Linux system is up, the better it runs.


0

Response Number 4
Name: nathan
Date: November 5, 2002 at 09:51:19 Pacific
Reply:

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.


0

Response Number 5
Name: armin
Date: November 6, 2002 at 20:10:52 Pacific
Reply:


youre fighting the symptoms not the roots.
ure a windows user?


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

/etc/bashrc Samba PDC



Post Locked

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


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Auto rebooting server nightly

Reboot server when server load more than 12 www.computing.net/answers/linux/reboot-server-when-server-load-more-than-12/30248.html

Auto reboot and auto power on again www.computing.net/answers/linux/auto-reboot-and-auto-power-on-again/30093.html

Automounting FAT32, is it possible? www.computing.net/answers/linux/automounting-fat32-is-it-possible/7535.html