egscripts/egrdbackup/postrun.sh.example-usb

29 lines
597 B
Text
Executable file

#/bin/bash -x
#
# This script runs before the main rdiffbackup script
# useful for mounting USB drives
#
# returns
# nothing if successful
# 1 = error on umount command
# 2 = parameters not defined
# 3 = no file system mounted
#
#
if [ $MOUNT_POINT"xxx" == "xxx" ]
then
echo "ERROR - Mount point not defined in initial.sh file" >> $LOGFILE
fi
#
if mount | grep $MOUNT_POINT > /dev/null
then
if ! umount $MOUNT_POINT
then
echo "ERROR - Couldn't unmount $MOUNT_POINT" >> $LOGFILE
fi
else
echo "ERROR - no file system on $MOUNT_POINT" >> $LOGFILE
fi