Auto Shutdown at stated hours
Hi Friends,
We run Mandrake 10.0 on our server. The number of users who will access our server is very very limited and only during the office hours, they will access the system. So, we want to shutdown the system during non-office hours. Is there any provision for switching off the system automatically at the close of the office and boot it on automatically during the day time? Thanks in Advance, Sriram. |
"cron" or "at".
check the man page. |
Not for booting up automatically... that's foolish to think that...
shutting down is simple... you can either schedule a cron for every night at whatever time... or.. you can su - to root and key shutdown -h at 18:00 this will shutdown the servers at 6:00pm |
halo14 is correct - in order for a computer to perform any action, it needs to be turned on. Once it's off, there's no possible way to have it execute a command to turn itself back on.
Perhaps what you are really trying to do is just to prevent users from accessing the system during certain times. If so, I believe it is possible to limit the times of the day during which a user can log in. For more info, see: man porttime man logoutd Good luck with it -- J.W. |
Use xinetd. You can set access times for certain services.
|
Thank you very much for the responses.
I was able to use shutdown -h at 18:00 successfully. I also want to know if there is a way I can boot my system on, after being shutdown. There is one facility in Win 2K machines, where by through UPS, we can start it on. We can set the timings of its boot and shutdown. Is there any similar functionality available in Linux? Thanks in Advance. Sriram. |
You can use WOL. You will have to set up another computer that will wake up a computer using a MAC address. Another way is to use a relay and some timer circuits to turn on the computer like you do with a switch. I do not know why you want to shutdown a server because inetd or xinetd can be set to stop the access of services or servers at a certain time. Also scripts like service can stop services or servers, you can use cron to start them and stop them at certain times and days. IMO, powering down a server is useless. During the off hours your server can do some daily jobs. By turning it off the server. The jobs have to be run during work hours. Some jobs can take a lot of processor usage.
|
There are services which run in the background that are usually set up in the crontab to start in the wee hours. One such service will update the locatedb each night. The locate command will use this database file, and on some systems, you can see a slowdown while this service is operating, hence it is scheduled around 3am when someone is less likely to be using the system. If you want to shut down the server at night, you may want to use anacron instead of cron, and maybe precede some of the commands in the setup file with the 'nice' command to lower their priorities a bit.
|
Check in your BIOS... I was recently looking at a computers BIOS that had an option for automatically booting up at a given time.. Very nice... I had never seen that before.. So check the BIOS on the computer and see if that's an option...
|
All times are GMT -5. The time now is 11:38 AM. |