1
0
mirror of https://github.com/deajan/obackup.git synced 2024-12-26 15:33:41 +01:00

Fixed GetDirectoriesSize...again

This commit is contained in:
deajan 2016-08-18 10:58:35 +02:00
parent a6be969081
commit 9f6e676a9a

View File

@ -381,10 +381,12 @@ function ListRecursiveBackupDirectories {
if [ $file_exclude -eq 0 ]; then if [ $file_exclude -eq 0 ]; then
if [ "$FILE_RECURSIVE_BACKUP_TASKS" == "" ]; then if [ "$FILE_RECURSIVE_BACKUP_TASKS" == "" ]; then
FILE_SIZE_LIST="\"$line\"" FILE_SIZE_LIST_LOCAL="\"$line\""
FILE_SIZE_LIST_REMOTE="\'$line\'"
FILE_RECURSIVE_BACKUP_TASKS="$line" FILE_RECURSIVE_BACKUP_TASKS="$line"
else else
FILE_SIZE_LIST="$FILE_SIZE_LIST \"$line\"" FILE_SIZE_LIST_LOCAL="$FILE_SIZE_LIST_LOCAL \"$line\""
FILE_SIZE_LIST_REMOTE="$FILE_SIZE_LIST_REMOTE \'$line\'"
FILE_RECURSIVE_BACKUP_TASKS="$FILE_RECURSIVE_BACKUP_TASKS$PATH_SEPARATOR_CHAR$line" FILE_RECURSIVE_BACKUP_TASKS="$FILE_RECURSIVE_BACKUP_TASKS$PATH_SEPARATOR_CHAR$line"
fi fi
else else
@ -395,10 +397,12 @@ function ListRecursiveBackupDirectories {
IFS=$PATH_SEPARATOR_CHAR read -r -a fileArray <<< "$DIRECTORY_LIST" IFS=$PATH_SEPARATOR_CHAR read -r -a fileArray <<< "$DIRECTORY_LIST"
for directory in "${fileArray[@]}"; do for directory in "${fileArray[@]}"; do
if [ "$FILE_SIZE_LIST" == "" ]; then if [ "$FILE_SIZE_LIST_LOCAL" == "" ]; then
FILE_SIZE_LIST="\"$directory\"" FILE_SIZE_LIST_LOCAL="\"$directory\""
FILE_SIZE_LIST_REMOTE="\'$directory\'"
else else
FILE_SIZE_LIST="$FILE_SIZE_LIST \"$directory\"" FILE_SIZE_LIST_LOCAL="$FILE_SIZE_LIST_LOCAL \"$directory\""
FILE_SIZE_LIST_REMOTE="$FILE_SIZE_LIST_REMOTE \'$directory\'"
fi fi
if [ "$FILE_BACKUP_TASKS" == "" ]; then if [ "$FILE_BACKUP_TASKS" == "" ]; then
@ -448,7 +452,7 @@ function _GetDirectoriesSizeRemote {
local cmd local cmd
# Error output is different from stdout because not all files in list may fail at once # Error output is different from stdout because not all files in list may fail at once
cmd=$SSH_CMD' "'$COMMAND_SUDO' du -cs '$dir_list' | tail -n1 | cut -f1" > '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID' 2> '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID cmd=$SSH_CMD' '$COMMAND_SUDO' du -cs '$dir_list' | tail -n1 | cut -f1 > '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID' 2> '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID
Logger "cmd: $cmd" "DEBUG" Logger "cmd: $cmd" "DEBUG"
eval "$cmd" & eval "$cmd" &
WaitForTaskCompletion $! $SOFT_MAX_EXEC_TIME_FILE_TASK $HARD_MAX_EXEC_TIME_FILE_TASK ${FUNCNAME[0]} false true $KEEP_LOGGING WaitForTaskCompletion $! $SOFT_MAX_EXEC_TIME_FILE_TASK $HARD_MAX_EXEC_TIME_FILE_TASK ${FUNCNAME[0]} false true $KEEP_LOGGING
@ -478,12 +482,11 @@ function GetDirectoriesSize {
if [ "$BACKUP_TYPE" == "local" ] || [ "$BACKUP_TYPE" == "push" ]; then if [ "$BACKUP_TYPE" == "local" ] || [ "$BACKUP_TYPE" == "push" ]; then
if [ "$FILE_BACKUP" != "no" ]; then if [ "$FILE_BACKUP" != "no" ]; then
Logger "2. $FILE_SIZE_LIST" "NOTICE" _GetDirectoriesSizeLocal "$FILE_SIZE_LIST_LOCAL"
_GetDirectoriesSizeLocal "$FILE_SIZE_LIST"
fi fi
elif [ "$BACKUP_TYPE" == "pull" ]; then elif [ "$BACKUP_TYPE" == "pull" ]; then
if [ "$FILE_BACKUP" != "no" ]; then if [ "$FILE_BACKUP" != "no" ]; then
_GetDirectoriesSizeRemote "$FILE_SIZE_LIST" _GetDirectoriesSizeRemote "$FILE_SIZE_LIST_REMOTE"
fi fi
fi fi
} }