Autoshutdown

At my office, my server will be on by me at 9am and will be close at 7pm...my server also act as a router..

there will be me only who know how to turn on and off the server...so I worried if one of the staff will shutdown my server by pressing off button and not the proper way by typing "halt"

is there any other way for me to set my Redhat9 automaticcaly shutdown completedly at 7pm? or second option is if i can set the server to be running on the spesific time perday, example the server will be down after 10 hour from the online time...

thanks
learner79Asked:
Who is Participating?
 
Alf666Connect With a Mentor Commented:
If your server is recent enough and has ACPI installed, you can also have it react to the power off button properly :

In /etc/acpi/events/power :

       event=button power.*
       action=/sbin/shutdown -h now

You can also look inside your bios. It might have an "auto poweron at a given time" feature.

BTW, I strongly advise against using halt in the above cron job !! halt is a bit harsh for your system and does not go through all
the daemons stop files.
shutdown does a much cleaner job.
0
 
liddlerCommented:
You can use cron to shut the system down at 7pm
add the following to root's crontab
0 19 * * * /sbin/halt
0
 
learner79Author Commented:
i will try it
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
learner79Author Commented:
is there any command line for me to do this? just asking
0
 
liddlerCommented:
crontab -e
(edit the cron table)
man crontab
if you need any help ;-)
0
 
owensleftfootCommented:
You could also use at. Type at 19:00 and press return. You will get a prompt like at>
Type /sbin/halt press enter and then press ctrl + d
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.