From 01ddddcb499e60358afa3c8fe3d8ddf09b88b6f8 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 17 Aug 2016 09:14:09 +0200 Subject: [PATCH] Added keep logging preflight check --- dev/n_obackup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/n_obackup.sh b/dev/n_obackup.sh index 37a3a3e..87f4b6a 100755 --- a/dev/n_obackup.sh +++ b/dev/n_obackup.sh @@ -1,13 +1,15 @@ #!/usr/bin/env bash -#TODO: test bad return of _GetDirectoriesSizeLocal & Remote +#TODO: test bad return of _GetDirectoriesSizeRemote +#TODO(critical): fix double path in rotate functions (switching from ls to find) +#TODO(high): check paths with spaces (again) ###### Remote push/pull (or local) backup script for files & databases PROGRAM="obackup" AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" PROGRAM_VERSION=2.1-dev -PROGRAM_BUILD=2016081603 +PROGRAM_BUILD=2016081701 IS_STABLE=no source "./ofunctions.sh" @@ -128,7 +130,7 @@ function CheckCurrentConfig { fi # Check all variables that should contain a numerical value >= 0 - declare -a num_vars=(BACKUP_SIZE_MINIMUM SQL_WARN_MIN_SPACE FILE_WARN_MIN_SPACE SOFT_MAX_EXEC_TIME_DB_TASK HARD_MAX_EXEC_TIME_DB_TASK COMPRESSION_LEVEL SOFT_MAX_EXEC_TIME_FILE_TASK HARD_MAX_EXEC_TIME_FILE_TASK BANDWIDTH SOFT_MAX_EXEC_TIME_TOTAL HARD_MAX_EXEC_TIME_TOTAL ROTATE_SQL_COPIES ROTATE_FILE_COPIES MAX_EXEC_TIME_PER_CMD_BEFORE MAX_EXEC_TIME_PER_CMD_AFTER) + declare -a num_vars=(BACKUP_SIZE_MINIMUM SQL_WARN_MIN_SPACE FILE_WARN_MIN_SPACE SOFT_MAX_EXEC_TIME_DB_TASK HARD_MAX_EXEC_TIME_DB_TASK COMPRESSION_LEVEL SOFT_MAX_EXEC_TIME_FILE_TASK HARD_MAX_EXEC_TIME_FILE_TASK BANDWIDTH SOFT_MAX_EXEC_TIME_TOTAL HARD_MAX_EXEC_TIME_TOTAL ROTATE_SQL_COPIES ROTATE_FILE_COPIES KEEP_LOGGING MAX_EXEC_TIME_PER_CMD_BEFORE MAX_EXEC_TIME_PER_CMD_AFTER) for i in "${num_vars[@]}"; do test="if [ $(IsNumeric \"\$$i\") -eq 0 ]; then Logger \"Bogus $i value defined in config file. Correct your config file or update it with the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" eval "$test"