Add additional checks for correct mounting and tagert being writeable

This commit is contained in:
2020-08-13 16:58:22 +02:00
parent 3dd31c51ea
commit c984905550

View File

@@ -89,7 +89,7 @@ step_3() {
fi
if [ -z "$1" ] ; then
echoerr " [E] Noting found to backup $1"
echoerr " [E] Nothing found to backup $1"
exit 1
fi
@@ -137,7 +137,15 @@ step_3() {
tmpTarget="${buTarget}/"
fi
# remount target to be writable
exep "mount -o rw,remount '${buTarget}' >>/dev/null 2>&1"
endReturn -o $? "Remount (${buTarget}) to be writable failed"
if [ ! -w "${buTarget}" ] ; then
echoerr " [E] Backup target (${buTarget}) is not writable"
exit 1
fi
exep "mv -f ${buTarget}/${buLog}0.log /tmp/${buLog}1.log 2>/dev/null"
exep "rsync -avxHAX --delete --info=stats2 ${buExcludes[*]} ${tmpSource} ${tmpTarget} > /tmp/${buLog}0.log"