1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-15 04:03:41 +01:00

Rebuilt targets

This commit is contained in:
deajan 2018-07-30 16:22:20 +02:00
parent 604d381091
commit c525b449f9
2 changed files with 48 additions and 12 deletions

View File

@ -7,7 +7,7 @@ PROGRAM="obackup"
AUTHOR="(C) 2013-2017 by Orsiris de Jong" AUTHOR="(C) 2013-2017 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.1-beta5 PROGRAM_VERSION=2.1-beta5
PROGRAM_BUILD=2018031501 PROGRAM_BUILD=2018083002
IS_STABLE=no IS_STABLE=no
#### Execution order #__WITH_PARANOIA_DEBUG #### Execution order #__WITH_PARANOIA_DEBUG
@ -2691,6 +2691,8 @@ function _ListRecursiveBackupDirectoriesLocal {
IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST" IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
for directory in "${directories[@]}"; do for directory in "${directories[@]}"; do
# Make sure there is only one trailing slash
directory="${directory%/}/"
# No sudo here, assuming you should have all necessary rights for local checks # No sudo here, assuming you should have all necessary rights for local checks
cmd="$FIND_CMD -L $directory/ -mindepth 1 -maxdepth 1 -type d >> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP 2> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID.$TSTAMP" cmd="$FIND_CMD -L $directory/ -mindepth 1 -maxdepth 1 -type d >> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP 2> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID.$TSTAMP"
Logger "Launching command [$cmd]." "DEBUG" Logger "Launching command [$cmd]." "DEBUG"
@ -2859,7 +2861,10 @@ function _ListRecursiveBackupDirectoriesRemoteSub {
IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST" IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
for directory in "${directories[@]}"; do for directory in "${directories[@]}"; do
# Make sure there is only one trailing slash
directory="${directory%/}/"
cmd="$REMOTE_FIND_CMD -L \"$directory\"/ -mindepth 1 -maxdepth 1 -type d" cmd="$REMOTE_FIND_CMD -L \"$directory\"/ -mindepth 1 -maxdepth 1 -type d"
Logger "Launching command [$cmd]." "DEBUG"
eval $cmd eval $cmd
retval=$? retval=$?
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then
@ -4211,8 +4216,12 @@ function FilesBackup {
# Backup directories from simple list # Backup directories from simple list
if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then
# Fix for backup of '/'
if [ "${backupTask#/}" == "/" ]; then
destinationDir="$FILE_STORAGE/${backupTask#/}"
else
destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}")
encryptDir="$FILE_STORAGE/${backupTask#/}" fi
else else
destinationDir="$FILE_STORAGE" destinationDir="$FILE_STORAGE"
encryptDir="$FILE_STORAGE" encryptDir="$FILE_STORAGE"
@ -4242,7 +4251,12 @@ function FilesBackup {
# Backup recursive directories withouht recursion # Backup recursive directories withouht recursion
if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then
# Fix for backup of '/'
if [ "${backupTask#/}" == "/" ]; then
destinationDir="$FILE_STORAGE/${backupTask#/}"
else
destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}")
fi
encryptDir="$FILE_STORAGE/${backupTask#/}" encryptDir="$FILE_STORAGE/${backupTask#/}"
else else
destinationDir="$FILE_STORAGE" destinationDir="$FILE_STORAGE"
@ -4273,8 +4287,12 @@ function FilesBackup {
# Backup sub directories of recursive directories # Backup sub directories of recursive directories
if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then
# Fix for backup of '/'
if [ "${backupTask#/}" == "/" ]; then
destinationDir="$FILE_STORAGE/${backupTask#/}"
else
destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}")
encryptDir="$FILE_STORAGE/${backupTask#/}" fi
else else
destinationDir="$FILE_STORAGE" destinationDir="$FILE_STORAGE"
encryptDir="$FILE_STORAGE" encryptDir="$FILE_STORAGE"

View File

@ -7,7 +7,7 @@ PROGRAM="obackup"
AUTHOR="(C) 2013-2017 by Orsiris de Jong" AUTHOR="(C) 2013-2017 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.1-beta5 PROGRAM_VERSION=2.1-beta5
PROGRAM_BUILD=2018031501 PROGRAM_BUILD=2018083002
IS_STABLE=no IS_STABLE=no
@ -2539,6 +2539,8 @@ function _ListRecursiveBackupDirectoriesLocal {
IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST" IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
for directory in "${directories[@]}"; do for directory in "${directories[@]}"; do
# Make sure there is only one trailing slash
directory="${directory%/}/"
# No sudo here, assuming you should have all necessary rights for local checks # No sudo here, assuming you should have all necessary rights for local checks
cmd="$FIND_CMD -L $directory/ -mindepth 1 -maxdepth 1 -type d >> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP 2> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID.$TSTAMP" cmd="$FIND_CMD -L $directory/ -mindepth 1 -maxdepth 1 -type d >> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP 2> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID.$TSTAMP"
Logger "Launching command [$cmd]." "DEBUG" Logger "Launching command [$cmd]." "DEBUG"
@ -2697,7 +2699,10 @@ function _ListRecursiveBackupDirectoriesRemoteSub {
IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST" IFS=$PATH_SEPARATOR_CHAR read -r -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
for directory in "${directories[@]}"; do for directory in "${directories[@]}"; do
# Make sure there is only one trailing slash
directory="${directory%/}/"
cmd="$REMOTE_FIND_CMD -L \"$directory\"/ -mindepth 1 -maxdepth 1 -type d" cmd="$REMOTE_FIND_CMD -L \"$directory\"/ -mindepth 1 -maxdepth 1 -type d"
Logger "Launching command [$cmd]." "DEBUG"
eval $cmd eval $cmd
retval=$? retval=$?
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then
@ -4003,8 +4008,12 @@ function FilesBackup {
# Backup directories from simple list # Backup directories from simple list
if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then
# Fix for backup of '/'
if [ "${backupTask#/}" == "/" ]; then
destinationDir="$FILE_STORAGE/${backupTask#/}"
else
destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}")
encryptDir="$FILE_STORAGE/${backupTask#/}" fi
else else
destinationDir="$FILE_STORAGE" destinationDir="$FILE_STORAGE"
encryptDir="$FILE_STORAGE" encryptDir="$FILE_STORAGE"
@ -4034,7 +4043,12 @@ function FilesBackup {
# Backup recursive directories withouht recursion # Backup recursive directories withouht recursion
if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then
# Fix for backup of '/'
if [ "${backupTask#/}" == "/" ]; then
destinationDir="$FILE_STORAGE/${backupTask#/}"
else
destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}")
fi
encryptDir="$FILE_STORAGE/${backupTask#/}" encryptDir="$FILE_STORAGE/${backupTask#/}"
else else
destinationDir="$FILE_STORAGE" destinationDir="$FILE_STORAGE"
@ -4065,8 +4079,12 @@ function FilesBackup {
# Backup sub directories of recursive directories # Backup sub directories of recursive directories
if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then
# Fix for backup of '/'
if [ "${backupTask#/}" == "/" ]; then
destinationDir="$FILE_STORAGE/${backupTask#/}"
else
destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}")
encryptDir="$FILE_STORAGE/${backupTask#/}" fi
else else
destinationDir="$FILE_STORAGE" destinationDir="$FILE_STORAGE"
encryptDir="$FILE_STORAGE" encryptDir="$FILE_STORAGE"