From a1c29f62d5b9149fbc705b94e062b9ae10c237ab Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 18 Feb 2015 15:03:45 +0100 Subject: [PATCH] Fixed some low severity bugs --- CHANGELOG.md | 2 ++ osync.sh | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c64197..09fdf59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ UNDER WORK RECENT CHANGES -------------- +- Fixed an issue with empty RSYNC_EXCLUDE_FILES +- Lowered default compression level for email alerts (for low end systems - Prevent exclude pattern globbing before the pattern reaches the rsync cmd - Fixed some missing child pids for time control to work - Prevent creation of a sync-id less log file when DEBUG is set diff --git a/osync.sh b/osync.sh index 0504a57..e6f06ad 100755 --- a/osync.sh +++ b/osync.sh @@ -4,7 +4,7 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=0.99RC4 -PROGRAM_BUILD=1202201501 +PROGRAM_BUILD=1802201501 ## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode if ! type -p "$BASH" > /dev/null @@ -722,10 +722,11 @@ function CheckMinimumSpace function RsyncExcludePattern { + # Disable globbing so wildcards from exclusions don't get expanded set -f OLD_IFS=$IFS IFS=$PATH_SEPARATOR_CHAR - for excludedir in $RSYNC_EXCLUDE_PATTERN + for excludedir in "$RSYNC_EXCLUDE_PATTERN" do if [ "$RSYNC_EXCLUDE" == "" ] then @@ -740,7 +741,7 @@ function RsyncExcludePattern function RsyncExcludeFrom { - if [ ! $RSYNC_EXCLUDE_FROM == "" ] + if [ ! "$RSYNC_EXCLUDE_FROM" == "" ] then ## Check if the exclude list has a full path, and if not, add the config file path if there is one if [ "$(basename $RSYNC_EXCLUDE_FROM)" == "$RSYNC_EXCLUDE_FROM" ] @@ -748,7 +749,7 @@ function RsyncExcludeFrom RSYNC_EXCLUDE_FROM=$(dirname $ConfigFile)/$RSYNC_EXCLUDE_FROM fi - if [ -e $RSYNC_EXCLUDE_FROM ] + if [ -e "$RSYNC_EXCLUDE_FROM" ] then RSYNC_EXCLUDE="$RSYNC_EXCLUDE --exclude-from=\"$RSYNC_EXCLUDE_FROM\"" fi @@ -1846,7 +1847,7 @@ function Init ) ## Set compression executable and extension - COMPRESSION_LEVEL=9 + COMPRESSION_LEVEL=3 if type -p xz > /dev/null 2>&1 then COMPRESSION_PROGRAM="| xz -$COMPRESSION_LEVEL"