Automate "shutting" down the server!

Automate "shutting" down the server!

Post by Raqueeb Hass » Wed, 24 Jul 2002 13:32:26



Hello net gurus!

I just want my linux pc shutting down at midnight, say 01:00 a.m.
automatically. So, I'll have to put an entry in crontab asking for
kill signal. Now, how to auth the the script to su -c root? Like how
the script can signal "init 0" at midnight when I'm sleeping?

TIA

raqueeb hassan
bangladesh

 
 
 

Automate "shutting" down the server!

Post by ujay » Wed, 24 Jul 2002 13:44:22



> Hello net gurus!

> I just want my linux pc shutting down at midnight, say 01:00 a.m.
> automatically. So, I'll have to put an entry in crontab asking for
> kill signal. Now, how to auth the the script to su -c root? Like how
> the script can signal "init 0" at midnight when I'm sleeping?

> TIA

> raqueeb hassan
> bangladesh

if you use crontab -e while logged on as root, then it is the root
crontab, and will shutdown the machine.

eg
su root
crontab -e

30 0 * * * shutdown -h now

that should do it

 
 
 

Automate "shutting" down the server!

Post by Nils O. Sel?sd » Wed, 24 Jul 2002 17:31:50


Quote:> Hello net gurus!

> I just want my linux pc shutting down at midnight, say 01:00 a.m.
> automatically. So, I'll have to put an entry in crontab asking for
> kill signal. Now, how to auth the the script to su -c root? Like how
> the script can signal "init 0" at midnight when I'm sleeping?

crontab -e
as root and put in the entry
or:
at midnight
Quote:>shutdown
><CTRL+D>

 
 
 

Automate "shutting" down the server!

Post by Skylar Thompso » Wed, 24 Jul 2002 23:34:32



Quote:> Hello net gurus!

> I just want my linux pc shutting down at midnight, say 01:00 a.m.
> automatically. So, I'll have to put an entry in crontab asking for
> kill signal. Now, how to auth the the script to su -c root? Like how
> the script can signal "init 0" at midnight when I'm sleeping?

Simple: Set it in root's crontab. Unless you want it to shutdown every
night at 1AM, then I would use at, though.

--

 
 
 

Automate "shutting" down the server!

Post by Raqueeb Hass » Thu, 25 Jul 2002 10:58:07


Thanks all of you for this tweaking. I took all your hints and compiled.

now, what I did is .....

put an entry in /etc/crontab

# shutdown at 05:11 morning.

11 5 * * * root /etc/cron.shut

the content of /etc/cron.shut

#!/bin/sh
/bin/sync
sleep 2
su - root -c '/sbin/shutdown -h now'

its working!

thanks once again.

raqueeb hassan
bangladesh

 
 
 

Automate "shutting" down the server!

Post by Frank Sweetse » Thu, 25 Jul 2002 11:54:51



> su - root -c '/sbin/shutdown -h now'

You don't need the 'su - root -c' part.  If it weren't already
running as root, it would fail.  You can change this line to

/sbin/shutdown -h now

without the su and it will work just as well.

--
Frank Sweetser fs at wpi.edu, fs at suave.net            | $ x 18
Full-time WPI Network Engineer, Part time Linux/Perl guy |
Double *sigh*.  _04 is going onto thousands of CDs even as we speak,
so to speak.

 
 
 

Automate "shutting" down the server!

Post by Raqueeb Hass » Mon, 29 Jul 2002 21:51:56


thanks for that.

raqueeb hassan
bangladesh

 
 
 

1. X+32meg+xv = "caught signal 11, server shutting down!"

        Hello everybody

        I've been using X since before linux 99pl-something, and it's always
worked great.  Several months ago I upgraded to the latest X, and again
everything worked great.  Then I upgraded from 16 to 32 megs of ram, and now
X dies!

        Specifically, this happens when I use xv.  The problem is, IT'S GETTING
WORSE!  I can start up xv, pull up the visual shnauzer, press "update", and
it may get as far as a few icons when X dies with a "caught signal 11" error.

        What is this?  How can I fix it?

Thanks,

2. Linux Bootup Problem

3. What about the "X server to shut down FreeFontPath" error

4. Win2k doesn't see Samba Server

5. X+32meg+xv = "caught signal 11, server shutting down!"

6. Is there a way not to use global variables for signal,setjmp,lonjmp?

7. nastygram from labelit.

8. GETSERVBYNAME()????????????????????"""""""""""""

9. ppp server "ip-up" "ip-down" problem

10. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

11. "Shutting down Allegro due to signal #2" ??

12. RH 6.1 freezing when "shutting down interface eth0"