Solved

Autoshutdown

Posted on 2004-03-30
6
249 Views
Last Modified: 2010-04-20
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
0
Comment
Question by:learner79
6 Comments
 
LVL 18

Expert Comment

by:liddler
Comment Utility
You can use cron to shut the system down at 7pm
add the following to root's crontab
0 19 * * * /sbin/halt
0
 

Author Comment

by:learner79
Comment Utility
i will try it
0
 

Author Comment

by:learner79
Comment Utility
is there any command line for me to do this? just asking
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 18

Expert Comment

by:liddler
Comment Utility
crontab -e
(edit the cron table)
man crontab
if you need any help ;-)
0
 
LVL 17

Expert Comment

by:owensleftfoot
Comment Utility
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
 
LVL 9

Accepted Solution

by:
Alf666 earned 50 total points
Comment Utility
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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now