mirror of
https://github.com/deajan/obackup.git
synced 2025-01-12 15:13:53 +01:00
Bumped version to dev
This commit is contained in:
parent
69d1729b2e
commit
9ef1841543
@ -4,8 +4,8 @@
|
|||||||
PROGRAM="obackup"
|
PROGRAM="obackup"
|
||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 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.0
|
PROGRAM_VERSION=2.1-dev
|
||||||
PROGRAM_BUILD=2016080601
|
PROGRAM_BUILD=2016080602
|
||||||
IS_STABLE=yes
|
IS_STABLE=yes
|
||||||
|
|
||||||
## FUNC_BUILD=2016072703
|
## FUNC_BUILD=2016072703
|
||||||
@ -1337,6 +1337,8 @@ function InitRemoteOSSettings {
|
|||||||
|
|
||||||
## END Generic functions
|
## END Generic functions
|
||||||
|
|
||||||
|
_LOGGER_PREFIX="time"
|
||||||
|
|
||||||
## Working directory for partial downloads
|
## Working directory for partial downloads
|
||||||
PARTIAL_DIR=".obackup_workdir_partial"
|
PARTIAL_DIR=".obackup_workdir_partial"
|
||||||
|
|
||||||
@ -1610,11 +1612,16 @@ function _ListRecursiveBackupDirectoriesLocal {
|
|||||||
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||||
|
|
||||||
local cmd
|
local cmd
|
||||||
|
local directories
|
||||||
|
local directory
|
||||||
|
local retval
|
||||||
|
|
||||||
OLD_IFS=$IFS
|
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
|
||||||
IFS=$PATH_SEPARATOR_CHAR
|
#OLD_IFS=$IFS
|
||||||
for directory in $RECURSIVE_DIRECTORY_LIST
|
#IFS=$PATH_SEPARATOR_CHAR
|
||||||
do
|
#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
|
# 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"
|
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"
|
Logger "cmd: $cmd" "DEBUG"
|
||||||
@ -1633,7 +1640,7 @@ function _ListRecursiveBackupDirectoriesLocal {
|
|||||||
retval=0
|
retval=0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
IFS=$OLD_IFS
|
#IFS=$OLD_IFS
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1641,11 +1648,16 @@ function _ListRecursiveBackupDirectoriesRemote {
|
|||||||
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||||
|
|
||||||
local cmd
|
local cmd
|
||||||
|
local directories
|
||||||
|
local directory
|
||||||
|
local retval
|
||||||
|
|
||||||
OLD_IFS=$IFS
|
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
|
||||||
IFS=$PATH_SEPARATOR_CHAR
|
#OLD_IFS=$IFS
|
||||||
for directory in $RECURSIVE_DIRECTORY_LIST
|
#IFS=$PATH_SEPARATOR_CHAR
|
||||||
do
|
#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
|
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"
|
Logger "cmd: $cmd" "DEBUG"
|
||||||
eval "$cmd" &
|
eval "$cmd" &
|
||||||
@ -1663,7 +1675,7 @@ function _ListRecursiveBackupDirectoriesRemote {
|
|||||||
retval=0
|
retval=0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
IFS=$OLD_IFS
|
#IFS=$OLD_IFS
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2247,11 +2259,18 @@ function Duplicity {
|
|||||||
function FilesBackup {
|
function FilesBackup {
|
||||||
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||||
|
|
||||||
OLD_IFS=$IFS
|
local backupTask
|
||||||
IFS=$PATH_SEPARATOR_CHAR
|
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
|
# Backup non recursive directories
|
||||||
for BACKUP_TASK in $FILE_BACKUP_TASKS
|
#for BACKUP_TASK in $FILE_BACKUP_TASKS
|
||||||
do
|
#do
|
||||||
Logger "Beginning file backup of [$BACKUP_TASK]." "NOTICE"
|
Logger "Beginning file backup of [$BACKUP_TASK]." "NOTICE"
|
||||||
if [ "$ENCRYPTION" == "yes" ]; then
|
if [ "$ENCRYPTION" == "yes" ]; then
|
||||||
Duplicity "$BACKUP_TASK" "recurse"
|
Duplicity "$BACKUP_TASK" "recurse"
|
||||||
@ -2261,9 +2280,12 @@ function FilesBackup {
|
|||||||
CheckTotalExecutionTime
|
CheckTotalExecutionTime
|
||||||
done
|
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
|
## Backup files at root of DIRECTORIES_RECURSE_LIST directories
|
||||||
for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
|
#for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
|
||||||
do
|
#do
|
||||||
Logger "Beginning non recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
Logger "Beginning non recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
||||||
if [ "$ENCRYPTION" == "yes" ]; then
|
if [ "$ENCRYPTION" == "yes" ]; then
|
||||||
Duplicity "$BACKUP_TASK" "no-recurse"
|
Duplicity "$BACKUP_TASK" "no-recurse"
|
||||||
@ -2273,9 +2295,12 @@ function FilesBackup {
|
|||||||
CheckTotalExecutionTime
|
CheckTotalExecutionTime
|
||||||
done
|
done
|
||||||
|
|
||||||
|
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$FILE_RECURSIVE_BACKUP_TASKS"
|
||||||
|
for backupTask in "${backupTasks[@]}"; do
|
||||||
|
|
||||||
# Backup sub directories of recursive directories
|
# Backup sub directories of recursive directories
|
||||||
for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
|
#for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
|
||||||
do
|
#do
|
||||||
Logger "Beginning recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
Logger "Beginning recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
||||||
if [ "$ENCRYPTION" == "yes" ]; then
|
if [ "$ENCRYPTION" == "yes" ]; then
|
||||||
Duplicity "$BACKUP_TASK" "recurse"
|
Duplicity "$BACKUP_TASK" "recurse"
|
||||||
@ -2284,7 +2309,7 @@ function FilesBackup {
|
|||||||
fi
|
fi
|
||||||
CheckTotalExecutionTime
|
CheckTotalExecutionTime
|
||||||
done
|
done
|
||||||
IFS=$OLD_IFS
|
#IFS=$OLD_IFS
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckTotalExecutionTime {
|
function CheckTotalExecutionTime {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
PROGRAM="obackup"
|
PROGRAM="obackup"
|
||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 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.0-dev
|
PROGRAM_VERSION=2.1-dev
|
||||||
PROGRAM_BUILD=2016080602
|
PROGRAM_BUILD=2016080602
|
||||||
IS_STABLE=yes
|
IS_STABLE=yes
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PROGRAM=obackup
|
PROGRAM=obackup
|
||||||
PROGRAM_VERSION=2.0-RC1
|
PROGRAM_VERSION=2.1-dev
|
||||||
PROGRAM_BINARY=$PROGRAM".sh"
|
PROGRAM_BINARY=$PROGRAM".sh"
|
||||||
PROGRAM_BATCH=$PROGRAM"-batch.sh"
|
PROGRAM_BATCH=$PROGRAM"-batch.sh"
|
||||||
SCRIPT_BUILD=2016052601
|
SCRIPT_BUILD=2016052601
|
||||||
|
67
obackup.sh
67
obackup.sh
@ -4,8 +4,8 @@
|
|||||||
PROGRAM="obackup"
|
PROGRAM="obackup"
|
||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 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.0
|
PROGRAM_VERSION=2.1-dev
|
||||||
PROGRAM_BUILD=2016080601
|
PROGRAM_BUILD=2016080602
|
||||||
IS_STABLE=yes
|
IS_STABLE=yes
|
||||||
|
|
||||||
## FUNC_BUILD=2016072703
|
## FUNC_BUILD=2016072703
|
||||||
@ -1263,6 +1263,8 @@ function InitRemoteOSSettings {
|
|||||||
|
|
||||||
## END Generic functions
|
## END Generic functions
|
||||||
|
|
||||||
|
_LOGGER_PREFIX="time"
|
||||||
|
|
||||||
## Working directory for partial downloads
|
## Working directory for partial downloads
|
||||||
PARTIAL_DIR=".obackup_workdir_partial"
|
PARTIAL_DIR=".obackup_workdir_partial"
|
||||||
|
|
||||||
@ -1529,11 +1531,16 @@ function ListDatabases {
|
|||||||
function _ListRecursiveBackupDirectoriesLocal {
|
function _ListRecursiveBackupDirectoriesLocal {
|
||||||
|
|
||||||
local cmd
|
local cmd
|
||||||
|
local directories
|
||||||
|
local directory
|
||||||
|
local retval
|
||||||
|
|
||||||
OLD_IFS=$IFS
|
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
|
||||||
IFS=$PATH_SEPARATOR_CHAR
|
#OLD_IFS=$IFS
|
||||||
for directory in $RECURSIVE_DIRECTORY_LIST
|
#IFS=$PATH_SEPARATOR_CHAR
|
||||||
do
|
#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
|
# 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"
|
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"
|
Logger "cmd: $cmd" "DEBUG"
|
||||||
@ -1552,18 +1559,23 @@ function _ListRecursiveBackupDirectoriesLocal {
|
|||||||
retval=0
|
retval=0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
IFS=$OLD_IFS
|
#IFS=$OLD_IFS
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
|
||||||
function _ListRecursiveBackupDirectoriesRemote {
|
function _ListRecursiveBackupDirectoriesRemote {
|
||||||
|
|
||||||
local cmd
|
local cmd
|
||||||
|
local directories
|
||||||
|
local directory
|
||||||
|
local retval
|
||||||
|
|
||||||
OLD_IFS=$IFS
|
IFS=$PATH_SEPARATOR_CHAR read -a directories <<< "$RECURSIVE_DIRECTORY_LIST"
|
||||||
IFS=$PATH_SEPARATOR_CHAR
|
#OLD_IFS=$IFS
|
||||||
for directory in $RECURSIVE_DIRECTORY_LIST
|
#IFS=$PATH_SEPARATOR_CHAR
|
||||||
do
|
#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
|
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"
|
Logger "cmd: $cmd" "DEBUG"
|
||||||
eval "$cmd" &
|
eval "$cmd" &
|
||||||
@ -1581,7 +1593,7 @@ function _ListRecursiveBackupDirectoriesRemote {
|
|||||||
retval=0
|
retval=0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
IFS=$OLD_IFS
|
#IFS=$OLD_IFS
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2147,11 +2159,18 @@ function Duplicity {
|
|||||||
|
|
||||||
function FilesBackup {
|
function FilesBackup {
|
||||||
|
|
||||||
OLD_IFS=$IFS
|
local backupTask
|
||||||
IFS=$PATH_SEPARATOR_CHAR
|
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
|
# Backup non recursive directories
|
||||||
for BACKUP_TASK in $FILE_BACKUP_TASKS
|
#for BACKUP_TASK in $FILE_BACKUP_TASKS
|
||||||
do
|
#do
|
||||||
Logger "Beginning file backup of [$BACKUP_TASK]." "NOTICE"
|
Logger "Beginning file backup of [$BACKUP_TASK]." "NOTICE"
|
||||||
if [ "$ENCRYPTION" == "yes" ]; then
|
if [ "$ENCRYPTION" == "yes" ]; then
|
||||||
Duplicity "$BACKUP_TASK" "recurse"
|
Duplicity "$BACKUP_TASK" "recurse"
|
||||||
@ -2161,9 +2180,12 @@ function FilesBackup {
|
|||||||
CheckTotalExecutionTime
|
CheckTotalExecutionTime
|
||||||
done
|
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
|
## Backup files at root of DIRECTORIES_RECURSE_LIST directories
|
||||||
for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
|
#for BACKUP_TASK in $RECURSIVE_DIRECTORY_LIST
|
||||||
do
|
#do
|
||||||
Logger "Beginning non recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
Logger "Beginning non recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
||||||
if [ "$ENCRYPTION" == "yes" ]; then
|
if [ "$ENCRYPTION" == "yes" ]; then
|
||||||
Duplicity "$BACKUP_TASK" "no-recurse"
|
Duplicity "$BACKUP_TASK" "no-recurse"
|
||||||
@ -2173,9 +2195,12 @@ function FilesBackup {
|
|||||||
CheckTotalExecutionTime
|
CheckTotalExecutionTime
|
||||||
done
|
done
|
||||||
|
|
||||||
|
IFS=$PATH_SEPARATOR_CHAR read -a backupTasks <<< "$FILE_RECURSIVE_BACKUP_TASKS"
|
||||||
|
for backupTask in "${backupTasks[@]}"; do
|
||||||
|
|
||||||
# Backup sub directories of recursive directories
|
# Backup sub directories of recursive directories
|
||||||
for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
|
#for BACKUP_TASK in $FILE_RECURSIVE_BACKUP_TASKS
|
||||||
do
|
#do
|
||||||
Logger "Beginning recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
Logger "Beginning recursive file backup of [$BACKUP_TASK]." "NOTICE"
|
||||||
if [ "$ENCRYPTION" == "yes" ]; then
|
if [ "$ENCRYPTION" == "yes" ]; then
|
||||||
Duplicity "$BACKUP_TASK" "recurse"
|
Duplicity "$BACKUP_TASK" "recurse"
|
||||||
@ -2184,7 +2209,7 @@ function FilesBackup {
|
|||||||
fi
|
fi
|
||||||
CheckTotalExecutionTime
|
CheckTotalExecutionTime
|
||||||
done
|
done
|
||||||
IFS=$OLD_IFS
|
#IFS=$OLD_IFS
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckTotalExecutionTime {
|
function CheckTotalExecutionTime {
|
||||||
|
Loading…
Reference in New Issue
Block a user