fix: minor fixes for ssh and package options

This commit is contained in:
Shannon Sterz 2017-08-03 21:55:08 +02:00
parent 385702b21a
commit b94d4e72e4

View file

@ -52,7 +52,7 @@ function backup ()
{
$ECHO "Creating backup in \"$TOSSH:$TARGET$1\"..." | formatLog >> $LOG
if [ "$LISTPACKAGES" ] && [ -z "$FROMSSH" ]; then
if [ -n "$LISTPACKAGES" ] && [ -z "$FROMSSH" ]; then
$ECHO "$DPKG --get-selections | $AWK '!/deinstall|purge|hold/'|$CUT -f1 | $TR '\n' ' '" | formatLog >> $LOG
$DPKG --get-selections | $AWK '!/deinstall|purge|hold/'|$CUT -f1 |$TR '\n' ' ' | formatLog >> $LOG 2>&1
fi
@ -75,13 +75,13 @@ function backup ()
# Backup files
for SOURCE in "${SOURCES[@]}"
do
if [ -n $"S" ] && [ -n "$TOSSH" ] && [ -z "$FROMSSH" ]; then
if [ -n "$S" ] && [ -n "$TOSSH" ] && [ -z "$FROMSSH" ]; then
$ECHO "$RSYNC -e \"$S\" -avR \"$SOURCE\" ${RSYNCCONF[@]} \"$TOSSH:$TARGET$1\" $INC " | formatLog >> $LOG
$RSYNC -e "$S" -avR "$SOURCE" "${RSYNCCONF[@]}" "$TOSSH:\"$TARGET\"$1" $INC --exclude-from=$EXCLUDEFROM | formatLog >> $LOG 2>&1
if [ $? -ne 0 ]; then
ERROR=1
fi
elif [ -n $"S" ] && [ -z "$TOSSH" ] && [ -n "$FROMSSH" ]; then
elif [ -n "$S" ] && [ -z "$TOSSH" ] && [ -n "$FROMSSH" ]; then
$ECHO "$RSYNC -e \"$S\" -avR \"$FROMSSH:$SOURCE\" ${RSYNCCONF[@]} $TARGET$1 $INC" | formatLog >> $LOG
$RSYNC -e "$S" -avR "$FROMSSH:\"$SOURCE\"" "${RSYNCCONF[@]}" "$TARGET"$1 $INC --exclude-from=$EXCLUDEFROM | formatLog >> $LOG 2>&1
if [ $? -ne 0 ]; then