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