Solved

Autoshutdown

Posted on 2004-03-30
6
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 10712163
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
ID: 10712186
i will try it
0
 

Author Comment

by:learner79
ID: 10712189
is there any command line for me to do this? just asking
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 18

Expert Comment

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

Expert Comment

by:owensleftfoot
ID: 10712347
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
ID: 10712362
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Rate limit for DNS queries 7 93
Migrating php-mysql-jquery application to Microsoft Azure Cloud 7 51
Moving from Mcrypt to OpenSSL 18 66
plsql job on oracle 18 79
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

730 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