diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e53208..24042d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ UNDER WORK RECENT CHANGES -------------- +- Added path detection for exclude list file - Added a simple init script working for RHEL / CentOS and an install script - Fixed an issue with MacOSX using rsync -E differently than other *nix (Thanks to Pierre Clement) - Multislave asynchronous task support (Thanks to Ulrich Norbisrath) diff --git a/install.sh b/install.sh index 8b4ece3..8b38309 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,8 @@ ## Please adapt this to fit your distro needs mkdir /etc/osync -cp ./sync.conf /etc/osync +cp ./sync.conf /etc/osync/sync.conf.example +cp ./exclude.list.example /etc/osync cp ./osync.sh /usr/local/bin cp ./osync-srv /etc/init.d diff --git a/osync.sh b/osync.sh index 6b5e658..1f574f9 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-2014 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=0.99preRC3 -PROGRAM_BUILD=2105201401 +PROGRAM_BUILD=2205201401 ## allow debugging from command line with preceding ocsync with DEBUG=yes if [ ! "$DEBUG" == "yes" ] @@ -744,6 +744,12 @@ function RsyncExcludeFrom { if [ ! $RSYNC_EXCLUDE_FROM == "" ] && [ -e $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" ] + then + $RSYNC_EXCLUDE_FROM=$(dirname $cfgfile)/$RSYNC_EXCLUDE_FROM + fi + RSYNC_EXCLUDE="$RSYNC_EXCLUDE --exclude-from=\"$RSYNC_EXCLUDE_FROM\"" fi } diff --git a/sync.conf b/sync.conf index 84a62bc..0bc835f 100755 --- a/sync.conf +++ b/sync.conf @@ -2,7 +2,7 @@ ###### Osync - Rsync based two way sync engine with fault tolerance ###### (L) 2013-2014 by Orsiris "Ozy" de Jong (www.netpower.fr) -###### Config file rev 2105201401 +###### Config file rev 2205201401 ## ---------- GENERAL OPTIONS @@ -26,8 +26,10 @@ LOGFILE="" ## Paths are relative to sync dirs. List elements are separated by a semicolon. RSYNC_EXCLUDE_PATTERN="tmp;archives" ## File that contains the list of directories or files to exclude from sync on both sides. Leave this empty if you don't want to use an exclusion file. +## This file has to be in the same directory as the config file ## Paths are relative to sync dirs. One element per line. -RSYNC_EXCLUDE_FROM="exclude.list" +RSYNC_EXCLUDE_FROM="" +#RSYNC_EXCLUDE_FROM="exclude.list" ## List elements separator char. You may set an alternative seperator char for your directories lists above. PATH_SEPARATOR_CHAR=";"