Add option to not remount target on backup

This commit is contained in:
2021-04-19 22:01:50 +02:00
parent d6b11898a2
commit b7f41c4ec7

View File

@@ -82,7 +82,9 @@ step_3_info() {
} }
step_3_alias() { ALIAS="budir"; } step_3_alias() { ALIAS="budir"; }
step_3() { step_3() {
local arg
local configTarget=0 local configTarget=0
local noRemount=0
local buSource= local buSource=
local buTarget= local buTarget=
local buExcludes= local buExcludes=
@@ -90,10 +92,16 @@ step_3() {
# don't use step number # don't use step number
shift shift
if [ "$1" == "-t" ] ; then for arg in "$@"; do
case "$1" in
-t)
configTarget=1 configTarget=1
shift shift;;
fi -n)
noRemount=1
shift;;
esac
done
if [ -z "$1" ] ; then if [ -z "$1" ] ; then
echoerr " [E] Nothing found to backup $1" echoerr " [E] Nothing found to backup $1"
@@ -144,9 +152,11 @@ step_3() {
tmpTarget="${buTarget}/" tmpTarget="${buTarget}/"
fi fi
if [ $noRemount -eq 0 ]; then
# remount target to be writable # remount target to be writable
exep "mount -o rw,remount '${buTarget}' >>/dev/null 2>&1" exep "mount -o rw,remount '${buTarget}' >>/dev/null 2>&1"
endReturn -o $? "Remount (${buTarget}) to be writable failed" endReturn -o $? "Remount (${buTarget}) to be writable failed"
fi
if [ ! -w "${buTarget}" ] ; then if [ ! -w "${buTarget}" ] ; then
echoerr " [E] Backup target (${buTarget}) is not writable" echoerr " [E] Backup target (${buTarget}) is not writable"