From fa19036de633386a3a4671e943a1f7403e36a34b Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 27 May 2014 11:35:45 +0200 Subject: [PATCH] Added follow symlink option + other minor fixes --- CHANGELOG.md | 5 ++++- osync.sh | 18 +++++++++++------- sync.conf | 6 ++++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e05180a..b3a9106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,16 +14,19 @@ FAR FUTURE IMPROVEMENTS KNOWN ISSUES ------------ -- Still need more testing on BSD, MacOSX and Windows MSYS +- RC3 is tested against Linux, FreeBSD and MacOS X. More testing needed in MSYS Windows environment. - Cannot finish sync if one replica contains a directory and the other replica contains a file named the same way (Unix doesn't allow this) UNDER WORK ---------- +- sync test automation RECENT CHANGES -------------- +- Added follow symlink parameter +- Minor fixes in parameter list when bandwidth parameter is used - Added some additionnal checks for *BSD and MacOS environments - Changed /bin/bash to /usr/bin/env bash for sanity on other systems, also check for bash presence before running - Changed default behavior for quick sync tasks: Will try to resume failed sync tasks once diff --git a/osync.sh b/osync.sh index 52f79ee..ea80dbb 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.99RC3 -PROGRAM_BUILD=2605201403 +PROGRAM_BUILD=2705201401 if ! type -p "$BASH" > /dev/null then @@ -1712,23 +1712,27 @@ function Init if [ "$PRESERVE_ACL" == "yes" ] then - RSYNC_ARGS=$RSYNC_ARGS"A" + RSYNC_ARGS=$RSYNC_ARGS" -A" fi if [ "$PRESERVE_XATTR" == "yes" ] then - RSYNC_ARGS=$RSYNC_ARGS"X" + RSYNC_ARGS=$RSYNC_ARGS" -X" fi if [ "$RSYNC_COMPRESS" == "yes" ] then - RSYNC_ARGS=$RSYNC_ARGS"z" + RSYNC_ARGS=$RSYNC_ARGS" -z" fi + if [ "$COPY_SYMLINKS" == "yes" ] + then + RSYNC_ARGS=$RSYNC_ARGS" -L" + fi if [ "$PRESERVE_HARDLINKS" == "yes" ] then - RSYNC_ARGS=$RSYNC_ARGS"H" + RSYNC_ARGS=$RSYNC_ARGS" -H" fi if [ $dryrun -eq 1 ] then - RSYNC_ARGS=$RSYNC_ARGS"n" + RSYNC_ARGS=$RSYNC_ARGS" -n" DRY_WARNING="/!\ DRY RUN" fi @@ -1830,7 +1834,7 @@ function InitRemoteOSSettings ## MacOSX does not use the -E parameter like Linux or BSD does (-E is mapped to extended attrs instead of preserve executability) if [ "$LOCAL_OS" != "MacOSX" ] && [ "$REMOTE_OS" != "MacOSX" ] then - RSYNC_ARGS=$RSYNC_ARGS"E" + RSYNC_ARGS=$RSYNC_ARGS" -E" fi if [ "$REMOTE_OS" == "msys" ] diff --git a/sync.conf b/sync.conf index 5b97ada..36b03da 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 2605201401 +###### Config file rev 2705201401 ## ---------- GENERAL OPTIONS @@ -67,6 +67,8 @@ RSYNC_REMOTE_PATH="" PRESERVE_ACL=no ## Preserve Xattr. Make sure source and target FS can manage same Xattrs or you'll get loads of errors. PRESERVE_XATTR=no +## Transforms symlinks into referent files/dirs +COPY_SYMLINKS=no ## Preserve hard links. Make sure source and target FS can manage hard links or you will lose them. PRESERVE_HARDLINKS=no @@ -80,7 +82,7 @@ HARD_MAX_EXEC_TIME=10600 ## Minimum time (in seconds) in file monitor mode between modification detection and sync task in order to let copy operations finish. MIN_WAIT=60 -## ---------- BACKUP AND TRASH OPTIONS +## ---------- BACKUP AND DELETION OPTIONS ## Enabling this option will keep a backup of a file on the target replica if it gets updated from the source replica. Backups will be made to .osync_workdir/backups CONFLICT_BACKUP=yes