Automated Shutdown Script

J. Erik Hemdal ehemdal at townisp.com
Sat Jul 3 01:47:03 UTC 2004


 
> ------------------------------
> 
> Message: 5
> Date: Fri, 2 Jul 2004 08:42:17 -0700 (MST)
> From: Mike <azmr at earthlink.net>
> Subject: Re: Automated Shutdown Script
> To: For users of Fedora Core releases <fedora-list at redhat.com>
> Cc: Michael Marsh <m at mmm7.com>
> Message-ID:
> 	<Pine.LNX.4.44.0407020837050.12668-100000 at yoda.microdel.org>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> 
> On Fri, 2 Jul 2004, Michael Marsh wrote:
> 
> > Does anyone know how to make fedora shut down automatically at a 
> > certain time of day with a bash script?
> > 
> > Thanks in advance
> > Michael Marsh
> > m at mmm7.com
> 
> Here's one way.  Say you want to shutdown at 9:00 PM every 
> day.  Do the following as root:
> 
>    # crontab -e
>    0 21 * * * /sbin/shutdown -h now

This is a good way to do it.  I'd suggest only a slight difference.
Put the entry at the end of /etc/crontab and add 'root' in the user field,
so:

0 21 * * * root sbin/shutdown -h -t 600

Note that -t gives the number of seconds before shutdown, to give users 10
minutes before the system is yanked out from under them.  I prefer using
/etc/crontab because it keeps all my root cronjobs in one place, so I do not
lose track of them.

Just my 40% of a nickel.  Hope it helps.  Erik





More information about the fedora-list mailing list