=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
DICA UNIX
Dica Unix 3227 - 06 de dezembro de 2008
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
O meu comando está completo ?
Este script demonstra como um comando qualquer que esteja sendo executado pode mandar um email sempre que ele falhar.
----------------CUT HERE -----------
#!/bin/ksh
#
# IWS Log Download/Archive Script
#
#*****************************
# The next variable can be set for multiple addresses
# (i.e. jsmith@yahoo.com,jsmith@hotmail.com)
MAILADD=status
# Use secure copy to download today's log files
scp "admin@ISPlogsrv.isp.com#22:/app/weblog/access.ISPlogsrv" $LOGDIR
if [ $? -gt 0 ]; then
mail $MAILADD <<EOF
From: $0
Subject: Web Server Log
The download of log files
from ISPlogsrv to webtrsrv
has failed. The files must
be downloaded immediately.
See $0 for details. Once the
files have been downloaded,
click "Analyze Now" for each
website1 Webtrends profile.
Otherwise, there will be a
missing day in the web
statistics.
EOF
fi;
exit 0
----------------CUT HERE -----------
-----------------------------------------------------------------------
Para assinar: http://www.ugu.com/sui/ugu/show?tip.subscribe
Para sair: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
Para enviar uma dica: http://www.ugu.com/sui/ugu/show?tip.today
======================================
DECLARAÇÃO: TODAS AS DICAS DE UNIX SÃO PROPIEDADE DA UNIX GURU UNIVERSE
E NÃO SÃO PARA SER VENDIDAS, IMPRESSAS OU USADAS SEM O CONSENTIMENTO POR
ESCRITO DA UNIX GURU UNIVERSE. TODAS AS DICAS SÃO "USADAS POR SEU PROPRIO RISCO".
UGU ADVERTE PARA TESTAR TODAS AS DICAS EM UM AMBIENTE QUE NÃO ESTEJA EM
PRODUÇÃO.
Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2008
======================================