[olug] Unix Tip: DID MY COMMAND COMPLETE?

Unix Guru Universe listserv at ugu.com
Thu Dec 26 19:00:20 UTC 2002


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

			      UNIX GURU UNIVERSE 
			         UNIX HOT TIP

			Unix Tip 2186 - December 26, 2002

		    http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


DID MY COMMAND COMPLETE?

This sample script demonstrates 
how an if loop directly beneath 
a command can send failure 
notification via e-mail.


----------------CUT HERE -----------
#!/bin/ksh
#
# IWS Log Download/Archive Script
#
#*******************************

# The next variable can be set for multiple addresses
# (i.e. jsmith at yahoo.com,jsmith at hotmail.com)
MAILADD=status

# Use secure copy to download today's log files

scp "admin at 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 -----------

This tip generously supported by: gideon at infostruct.net




--------------------------------------------------------------------------
To Subscribe:    http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe:  http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX 
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU  ADVISES THAT 
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips at ugu.com - Copyright 1994-2001
==========================================================================




More information about the OLUG mailing list