El jue, 17-11-2016 a las 08:47 -0500, Paradix ;) escribió:
> Hola lista
> 
> uptime me devuelve el tiempo que el sistema ha estado funcionando desde 
> su encendido. pero ¿como puedo saber cuanto tiempo estuvo funcionando en 
> otros momentos?
> 
> Xaire

En relación con el tema, quizás te interese este script que vi en su momento en 

la lista de SuSE (¿existirá todavía? cómo extraño eso de estar en sintonía con 
el Universo...).

Te avisará con un correo cuando se reinicie la máquina donde se ponga.

Pudiera pensarse en un script similar para cuando se apaguen, pienso yo,
siempre y cuando sea un apagado controlado por una UPS.

Fumero


Delivered-To: mailing list suse-linu...@suse.com
Received: (qmail 28909 invoked from network); 28 Aug 2002 18:09:17 -0000
Date: Wed, 28 Aug 2002 14:07:02 -0400
From: zentara <zent...@zentara.net>
To: suse-linu...@suse.com
Message-Id: <20020828140702.244d967d.zent...@zentara.net>
X-Mailer: Sylpheed version 0.8.2 (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain;
  charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-RBL-Warning: OSDUL: This E-mail came from 65.142.82.104, a potential
spam source listed in OSDUL.
X-Note: This E-mail was scanned for spam.
Subject: [SLE] Mail Notification of remote server reboot.
X-Fetchmail-Warning: recipient address suse-linu...@suse.com didn't
match any local name
X-UIDL: 9c65920c163a7409e77db7ca61d43628
Status: R 
X-Status: N

Hi,
I saw this tip today from UGU, and thought some of you
might find it useful for security of remote servers.
 It was a ksh script, I converted to bash.
Put it in /etc/rc.d/notify  , and make a symlink to it in /etc/rc2.d
ln -s /etc/rc.d/notify    /etc/rc.d/rc2.d/S99notify
#############################################
#!/bin/sh
# Boot Notification Script
# /etc/rc2.d/S99notify - Sends e-mail notification to the
#administrators  when the system is booted. 
DATE=`date`
SRVNM=`uname -n`

# The next variable can be set for multiple addresses
# (i.e. jsm...@yahoo.com,jsm...@hotmail.com)
MAILADD=r...@you.net

mail $MAILADD <<EOF
From: $0
To: $MAILADD
Subject: Boot of $SRVNM
$DATE
$SRVNM has booted up. 
If this is news to you, please investigate.
EOF
exit 0
##############################################

-- 
use Perl;  #powerful programmable prestidigitation

-- 
M.Sc. Alberto García Fumero
Usuario Linux 97 138, registrado 10/12/1998
http://interese.cubava.cu
Una conclusión es el punto en que usted se cansó de pensar.

______________________________________________________________________
Lista de correos del Grupo de Usuarios de Tecnologías Libres de Cuba.
Gutl-l@jovenclub.cu
https://listas.jovenclub.cu/cgi-bin/mailman/listinfo/gutl-l

Responder a