Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I perfom a unattended linux reboot at a particular time- say at 10 p.m. every night.
Will the command "shutdown -h 22:01 -r now" work? If not what is the right command. Thanks
yeah.. that will work.. but umm... why are you wanting reboot daily?? Are you new to Linux/Unix?? These systems won't slow down from being turned on for long periods of time.. the only thing that isn't hardware related that you NEED to reboot Linux for is if you install a new kernel, you have to reboot in order to load the new kernel..
Automating a reboot is not hard to do, but the important point really is "Why would a daily reboot be necessary?" Unlike Windows, which is prone to becoming unstable the longer it has been runnning, Linux can easily run for months if not years without a reboot. (At least for me, the only time I need to reboot is when I need to switch over to Windows on my dual boot machine). As halo14 mentioned, there are not many situations where a reboot in Linux is truly required.
Is your question really more related to how to set up an automated task (and is just using the reboot simply as an example) or is there some sort of problem that you are hoping that a reboot will solve? -- J.W.
Actually according to my experience, after a period of time, linux runs faster that in the beginning.
Linux utilizes the RAM in a very efficient way. SO it tries to make use of all the RAM you have and the stuff you load in RAM will stay there unless you need the space. So applications like firefox that may need 3-4 second to load the first time will load pretty fast next time. I don't have a server, but I tend to leave my box switched on for weeks and never had a problem. The only time you need to reboot is when you load a new kernel.
For anything else you may need to switch yo run level 1, and install it, but rebooting is almost never necessary.
*EDIT*
If you experience slow downs in most cases it's a memory leak or a bug in one of your programs and tool like "top" or "htop" will help you determine and kill/unload the buggy application.
Last edited by perfect_circle; 07-28-2005 at 09:10 PM.
you also can use crontab. simply login as su, type '/usr/bin/crontab -e', set a time and the comand. for 10 p.m. its:
0 22 * * * /usr/bin/shutdown -r now
Linux boxes run their daily cron scripts early in the morning--I think the default is 2:30 am-?...
In general, though, most electronic devices run better and more reliably the more they are left on. Powering on and off eventually will stress the components of the power supply, making it more likely to fail. In Hawaii, or any humid environment, the corrosion level is very high. I leave all of my electronic equipment on most of the time, and I find that I have much less corrosion.
I have a twenty-two year old audiophile stereo system that has rarely been shut off; a Kurzweil keyboard, and various audio hardware that has rarely been turned off in five years; a pII from mid-1998 that has never had a hardware problem [ok, the windmodem kacked, so I had to replace it with a better one] (my server), plus some newer boxes. Only my laptop gets regularly powered up and down, because I transport it from work to home daily.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.