1
0
mirror of https://github.com/deajan/obackup.git synced 2024-12-25 23:13:41 +01:00

Minor fixes

This commit is contained in:
deajan 2016-08-30 18:11:54 +02:00
parent b1fafab1f7
commit a9077af7bb

View File

@ -5,7 +5,7 @@ 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.1-dev PROGRAM_VERSION=2.1-dev
PROGRAM_BUILD=2016083001 PROGRAM_BUILD=2016083002
IS_STABLE=yes IS_STABLE=yes
source "./ofunctions.sh" source "./ofunctions.sh"
@ -327,6 +327,7 @@ function _ListRecursiveBackupDirectoriesRemote {
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
#TODO(med): Uses local home directory for remote lookup...
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" &
@ -353,6 +354,8 @@ function ListRecursiveBackupDirectories {
local output_file local output_file
local file_exclude local file_exclude
local excluded
local fileArray local fileArray
Logger "Listing directories to backup." "NOTICE" Logger "Listing directories to backup." "NOTICE"
@ -376,8 +379,8 @@ function ListRecursiveBackupDirectories {
while read -r line; do while read -r line; do
file_exclude=0 file_exclude=0
IFS=$PATH_SEPARATOR_CHAR read -r -a fileArray <<< "$RECURSIVE_EXCLUDE_LIST" IFS=$PATH_SEPARATOR_CHAR read -r -a fileArray <<< "$RECURSIVE_EXCLUDE_LIST"
for k in "${fileArray[@]}"; do for excluded in "${fileArray[@]}"; do
if [ "$k" == "$line" ]; then if [ "$excluded" == "$line" ]; then
file_exclude=1 file_exclude=1
fi fi
done done
@ -1350,8 +1353,8 @@ LoadConfigFile "$1"
if [ "$LOGFILE" == "" ]; then if [ "$LOGFILE" == "" ]; then
if [ -w /var/log ]; then if [ -w /var/log ]; then
LOG_FILE="/var/log/$PROGRAM.$INSTANCE_ID.log" LOG_FILE="/var/log/$PROGRAM.$INSTANCE_ID.log"
elif ([ "$HOME" != "" ] && [ -w "$HOME" ]); then elif ([ "${HOME}" != "" ] && [ -w "{$HOME}" ]); then
LOG_FILE="$HOME/$PROGRAM.$INSTANCE_ID.log" LOG_FILE="${HOME}/$PROGRAM.$INSTANCE_ID.log"
else else
LOG_FILE=./$PROGRAM.$INSTANCE_ID.log LOG_FILE=./$PROGRAM.$INSTANCE_ID.log
fi fi