From 643ede65242a52339f848d0eec16e73c0fb2b44a Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 2 Jan 2017 22:55:43 +0100 Subject: [PATCH] Fixed wrong file size fetched remotely --- dev/n_obackup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dev/n_obackup.sh b/dev/n_obackup.sh index 34782e2..32ee220 100755 --- a/dev/n_obackup.sh +++ b/dev/n_obackup.sh @@ -7,7 +7,7 @@ PROGRAM="obackup" AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" PROGRAM_VERSION=2.1-dev -PROGRAM_BUILD=2017010206 +PROGRAM_BUILD=2017010207 IS_STABLE=no # Execution order #__WITH_PARANOIA_DEBUG @@ -599,13 +599,12 @@ function _GetDirectoriesSizeRemote { # Error output is different from stdout because not all files in list may fail at once $SSH_CMD env _DEBUG="'$_DEBUG'" env _PARANOIA_DEBUG="'$_PARANOIA_DEBUG'" env _LOGGER_SILENT="'$_LOGGER_SILENT'" env _LOGGER_VERBOSE="'$_LOGGER_VERBOSE'" env _LOGGER_PREFIX="'$_LOGGER_PREFIX'" env _LOGGER_ERR_ONLY="'$_LOGGER_ERR_ONLY'" \ env PROGRAM="'$PROGRAM'" env SCRIPT_PID="'$SCRIPT_PID'" TSTAMP="'$TSTAMP'" \ -$COMMAND_SUDO' bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" 2> "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID.$TSTAMP" & +dirList="'$dirList'" $COMMAND_SUDO' bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" 2> "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID.$TSTAMP" & include #### DEBUG SUBSET #### include #### TrapError SUBSET #### include #### RemoteLogger SUBSET #### cmd="du -cs $dirList | tail -n1 | cut -f1" - RemoteLogger "cmd: $cmd" "DEBUG" eval "$cmd" ENDSSH # $cmd will return 0 even if some errors found, so we need to check if there is an error output