START_TIME=`date +'%Y%m%d-%H%M'`
BACKUP_LOG_FILE=/home/bitnami/scripts/drupal_backup_$START_TIME.log
/home/bitnami/scripts/backupDrupal_v2.sh >> $BACKUP_LOG_FILE 2<&1
RUN_RESULT=$?
echo "Run Result is $RUN_RESULT"
if [ $RUN_RESULT -gt 0 ]; then
OUTCOME="FAILURE"
mailx -s "$OUTCOME - Bitnami Drupal Archive Job (weave04vm6) - $START_TIME" dba@test < $BACKUP_LOG_FILE
rm $BACKUP_LOG_FILE
else
OUTCOME="SUCCESS"
mv $BACKUP_LOG_FILE /windowsbackup/weave04vm6
mailx -s "$OUTCOME - Bitnami Drupal Archive Job (weave04vm6) - $START_TIME" dba@test < /windowsbackup/xx/drupal_backup_$START_TIME.log
fi
Last active
September 18, 2018 00:45
-
-
Save aimtiaz11/da7ed93857e09047a26c to your computer and use it in GitHub Desktop.
UNIX Script: Function to check if the last command ran successfully
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment