Products Services Download
  Support Contact Purchase
 

Delivering data   —   where and when you need it

Schema  > Products  > SRTransport  > Doc  > SRTransportES  > Mail
 

Email Notification

In shell scripts that you write for SRTransport, it is possible to send email notifying people of an important condition, such as the failure of a transport.

The following shell script can be used on HPUX, Solaris and MacOS X. On NT, the sendmail program is not available by default.

This script sends email if the transport fails or if it rejects any records.

#!/bin/sh
transport=abc.transport
recipient=admin@somewhere.com
sendmail=/usr/sbin/sendmail
date=`date`

srtransport -t $transport
status=$?

if [ $status != 0 ]; then
$sendmail $recipient <<EOF
From: srtransport
Subject: Transport failure.
Date: $date
$transport failed with status $status at $date.
EOF
fi
Schema Research Corporation webmaster