#!/bin/bash if /usr/bin/innobackupex-1.5.1 --no-timestamp --no-lock --user=root --password=testpassword --stream=tar ./ | ssh root@remote.backup.com "cat - > /root/bkuptest/Backup/test.tar" then if ssh root@remote.backup.com "/usr/bin/mybackup.sh" then echo "Backup Done" | mail -s "[Backup] backup done Complete" ketan@email.com else echo "Backup Failed" | mail -s "[Backup] master Failed" ketan@email.com fi else echo "Backup Failed" | mail -s "[Backup] master Failed" ketan@email.com fi