1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-12 19:03:42 +01:00

Bumped version to dev

This commit is contained in:
deajan 2016-08-06 14:04:35 +02:00
parent 69d1729b2e
commit 9ef1841543
4 changed files with 94 additions and 44 deletions

View File

@ -4,8 +4,8 @@
PROGRAM="obackup"
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.0
PROGRAM_BUILD=2016080601
PROGRAM_VERSION=2.1-dev
PROGRAM_BUILD=2016080602
IS_STABLE=yes
## FUNC_BUILD=2016072703
@ -1337,6 +1337,8 @@ function InitRemoteOSSettings {
## END Generic functions
_LOGGER_PREFIX="time"
## Working directory for partial downloads
PARTIAL_DIR=".obackup_workdir_partial"
@ -1610,11 +1612,16 @@ function _ListRecursiveBackupDirectoriesLocal {
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
local cmd
local directories
local directory
local retval
OLD_IFS=$IFS
IFS=$PATH_SEPARATOR_CHAR
for directory in $RECURSIVE_DIRECTORY_LIST
do
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
#OLD_IFS=$IFS
#IFS=$PATH_SEPARATOR_CHAR
#TODO CHECK THIS
#for directory in $RECURSIVE_DIRECTORY_LIST
for directory in "${directories[@]}"; do
# 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 2> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID"
Logger "cmd: $cmd" "DEBUG"
@ -1633,7 +1640,7 @@ function _ListRecursiveBackupDirectoriesLocal {
retval=0
fi
done
IFS=$OLD_IFS
#IFS=$OLD_IFS
return $retval
}
@ -1641,11 +1648,16 @@ function _ListRecursiveBackupDirectoriesRemote {
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
local cmd
local directories
local directory
local retval
OLD_IFS=$IFS
IFS=$PATH_SEPARATOR_CHAR
for directory in $RECURSIVE_DIRECTORY_LIST
do
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
#OLD_IFS=$IFS
#IFS=$PATH_SEPARATOR_CHAR
#TODO CHECK THIS
#for directory in $RECURSIVE_DIRECTORY_LIST
for directory in "${directories[@]}"; do
cmd=$SSH_CMD' "'$COMMAND_SUDO' '$REMOTE_FIND_CMD' -L '$directory'/ -mindepth 1 -maxdepth 1 -type d" >> '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID' 2> '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID
Logger "cmd: $cmd" "DEBUG"
eval "$cmd" &
@ -1663,7 +1675,7 @@ function _ListRecursiveBackupDirectoriesRemote {
retval=0
fi
done
IFS=$OLD_IFS
#IFS=$OLD_IFS
return $retval
}
@ -2247,11 +2259,18 @@ function Duplicity {
function FilesBackup {
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
OLD_IFS=$IFS
IFS=$PATH_SEPARATOR_CHAR
local backupTask
local backupTasks
#TODO: check this new behavior
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$FILE_BACKUP_TASKS"
for backupTask in "${backupTasks[@]}"; do
#OLD_IFS=$IFS
#IFS=$PATH_SEPARATOR_CHAR
# Backup non recursive directories
for BACKUP_TASK in $FILE_BACKUP_TASKS
do
#for BACKUP_TASK in $FILE_BACKUP_TASKS
#do
Logger "Beginning file backup of [$BACKUP_TASK]." "NOTICE"
if [ "$ENCRYPTION" == "yes" ]; then
Duplicity "$BACKUP_TASK" "recurse"
@ -2261,9 +2280,12 @@ function FilesBackup {
CheckTotalExecutionTime
done
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$RECURSIVE_DIRECTORY_LIST"
for backupTask in "${backupTasks[@]}"; do
## Backup files at root of DIRECTORIES_RECURSE_LIST directories
for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
do
#for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
#do
Logger "Beginning non recursive file backup of [$BACKUP_TASK]." "NOTICE"
if [ "$ENCRYPTION" == "yes" ]; then
Duplicity "$BACKUP_TASK" "no-recurse"
@ -2273,9 +2295,12 @@ function FilesBackup {
CheckTotalExecutionTime
done
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$FILE_RECURSIVE_BACKUP_TASKS"
for backupTask in "${backupTasks[@]}"; do
# Backup sub directories of recursive directories
for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
do
#for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
#do
Logger "Beginning recursive file backup of [$BACKUP_TASK]." "NOTICE"
if [ "$ENCRYPTION" == "yes" ]; then
Duplicity "$BACKUP_TASK" "recurse"
@ -2284,7 +2309,7 @@ function FilesBackup {
fi
CheckTotalExecutionTime
done
IFS=$OLD_IFS
#IFS=$OLD_IFS
}
function CheckTotalExecutionTime {

View File

@ -4,7 +4,7 @@
PROGRAM="obackup"
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.0-dev
PROGRAM_VERSION=2.1-dev
PROGRAM_BUILD=2016080602
IS_STABLE=yes

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
PROGRAM=obackup
PROGRAM_VERSION=2.0-RC1
PROGRAM_VERSION=2.1-dev
PROGRAM_BINARY=$PROGRAM".sh"
PROGRAM_BATCH=$PROGRAM"-batch.sh"
SCRIPT_BUILD=2016052601

View File

@ -4,8 +4,8 @@
PROGRAM="obackup"
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.0
PROGRAM_BUILD=2016080601
PROGRAM_VERSION=2.1-dev
PROGRAM_BUILD=2016080602
IS_STABLE=yes
## FUNC_BUILD=2016072703
@ -1263,6 +1263,8 @@ function InitRemoteOSSettings {
## END Generic functions
_LOGGER_PREFIX="time"
## Working directory for partial downloads
PARTIAL_DIR=".obackup_workdir_partial"
@ -1529,11 +1531,16 @@ function ListDatabases {
function _ListRecursiveBackupDirectoriesLocal {
local cmd
local directories
local directory
local retval
OLD_IFS=$IFS
IFS=$PATH_SEPARATOR_CHAR
for directory in $RECURSIVE_DIRECTORY_LIST
do
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
#OLD_IFS=$IFS
#IFS=$PATH_SEPARATOR_CHAR
#TODO CHECK THIS
#for directory in $RECURSIVE_DIRECTORY_LIST
for directory in "${directories[@]}"; do
# 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 2> $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID"
Logger "cmd: $cmd" "DEBUG"
@ -1552,18 +1559,23 @@ function _ListRecursiveBackupDirectoriesLocal {
retval=0
fi
done
IFS=$OLD_IFS
#IFS=$OLD_IFS
return $retval
}
function _ListRecursiveBackupDirectoriesRemote {
local cmd
local directories
local directory
local retval
OLD_IFS=$IFS
IFS=$PATH_SEPARATOR_CHAR
for directory in $RECURSIVE_DIRECTORY_LIST
do
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
#OLD_IFS=$IFS
#IFS=$PATH_SEPARATOR_CHAR
#TODO CHECK THIS
#for directory in $RECURSIVE_DIRECTORY_LIST
for directory in "${directories[@]}"; do
cmd=$SSH_CMD' "'$COMMAND_SUDO' '$REMOTE_FIND_CMD' -L '$directory'/ -mindepth 1 -maxdepth 1 -type d" >> '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID' 2> '$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID
Logger "cmd: $cmd" "DEBUG"
eval "$cmd" &
@ -1581,7 +1593,7 @@ function _ListRecursiveBackupDirectoriesRemote {
retval=0
fi
done
IFS=$OLD_IFS
#IFS=$OLD_IFS
return $retval
}
@ -2147,11 +2159,18 @@ function Duplicity {
function FilesBackup {
OLD_IFS=$IFS
IFS=$PATH_SEPARATOR_CHAR
local backupTask
local backupTasks
#TODO: check this new behavior
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$FILE_BACKUP_TASKS"
for backupTask in "${backupTasks[@]}"; do
#OLD_IFS=$IFS
#IFS=$PATH_SEPARATOR_CHAR
# Backup non recursive directories
for BACKUP_TASK in $FILE_BACKUP_TASKS
do
#for BACKUP_TASK in $FILE_BACKUP_TASKS
#do
Logger "Beginning file backup of [$BACKUP_TASK]." "NOTICE"
if [ "$ENCRYPTION" == "yes" ]; then
Duplicity "$BACKUP_TASK" "recurse"
@ -2161,9 +2180,12 @@ function FilesBackup {
CheckTotalExecutionTime
done
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$RECURSIVE_DIRECTORY_LIST"
for backupTask in "${backupTasks[@]}"; do
## Backup files at root of DIRECTORIES_RECURSE_LIST directories
for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
do
#for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
#do
Logger "Beginning non recursive file backup of [$BACKUP_TASK]." "NOTICE"
if [ "$ENCRYPTION" == "yes" ]; then
Duplicity "$BACKUP_TASK" "no-recurse"
@ -2173,9 +2195,12 @@ function FilesBackup {
CheckTotalExecutionTime
done
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$FILE_RECURSIVE_BACKUP_TASKS"
for backupTask in "${backupTasks[@]}"; do
# Backup sub directories of recursive directories
for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
do
#for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
#do
Logger "Beginning recursive file backup of [$BACKUP_TASK]." "NOTICE"
if [ "$ENCRYPTION" == "yes" ]; then
Duplicity "$BACKUP_TASK" "recurse"
@ -2184,7 +2209,7 @@ function FilesBackup {
fi
CheckTotalExecutionTime
done
IFS=$OLD_IFS
#IFS=$OLD_IFS
}
function CheckTotalExecutionTime {