dimanche 31 août 2014

shell script that send email before exiting


Vote count:

0




i am trying to write a shell script that will send me an email before exiting itself


or


as i am running this on an amazon ec2 DEBAIN spot request and it should send me an email before the instances is terminated



#!/bin/bash
sendEmailLog()
{
emailLog=true
if [ $emailLog = "true" ];then
/usr/bin/mpack -s "emailed log" -a "/srv/log.html" "emailid@gmail.com";
fi
exit 0;
}

trap sendEmailLog INT TERM EXIT KILL QUIT

aws ec2 terminate-instances instances ID


asked 38 secs ago

Moses

131






shell script that send email before exiting

Aucun commentaire:

Enregistrer un commentaire