From 1472fba4bce888e6df2427e46bee3843cf7ed5aa Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 9 Aug 2016 13:44:43 +0200 Subject: [PATCH] Added initial preserve permissions --- CHANGELOG.md | 2 ++ dev/ofunctions.sh | 13 +++++++++++-- sync.conf | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d517095..59b5945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ KNOWN ISSUES RECENT CHANGES -------------- +- Added options to ignore permissions, ownership and groups +- Refactored WaitFor... functions into one - Improved execution speed - Added parallel execution for most secondary fuctions - Lowered sleep time in wait functions diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 309ea1d..62f2dc9 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,6 +1,6 @@ #### MINIMAL-FUNCTION-SET BEGIN #### -## FUNC_BUILD=2016080806 +## FUNC_BUILD=2016080901 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr #TODO: set _LOGGER_PREFIX in other apps, specially for osync daemon mode @@ -1148,7 +1148,6 @@ function PreInit { ## Set rsync default arguments RSYNC_ARGS="-rltD" - RSYNC_ATTR_ARGS="-pgo" if [ "$_DRYRUN" -eq 1 ]; then RSYNC_DRY_ARG="-n" DRY_WARNING="/!\ DRY RUN" @@ -1156,6 +1155,16 @@ function PreInit { RSYNC_DRY_ARG="" fi + RSYNC_ATTR_ARGS="" + if [ "$PRESERVE_PERMISSIONS" != "no" ]; then + RSYNC_ATTR_ARGS=$RSYNC_ATTR_ARGS" -p" + fi + if [ "$PRESERVE_OWNER" != "no" ]; then + RSYNC_ATTR_ARGS=$RSYNC_ATTR_ARGS" -o" + fi + if [ "$PRESERVE_GROUP" != "no" ]; then + RSYNC_ATTR_ARGS=$RSYNC_ATTR_ARGS" -g" + if [ "$PRESERVE_ACL" == "yes" ]; then RSYNC_ATTR_ARGS=$RSYNC_ATTR_ARGS" -A" fi diff --git a/sync.conf b/sync.conf index 90a5845..c9dad7d 100644 --- a/sync.conf +++ b/sync.conf @@ -2,7 +2,7 @@ ###### osync - Rsync based two way sync engine with fault tolerance ###### (C) 2013-2016 by Orsiris de Jong (www.netpower.fr) -###### osync v1.1x / v1.2x config file rev 2016080301 +###### osync v1.1x / v1.2x config file rev 2016080901 ## ---------- GENERAL OPTIONS @@ -76,6 +76,10 @@ REMOTE_3RD_PARTY_HOSTS="www.kernel.org www.google.com" ## ---------- MISC OPTIONS +## Preserve basic linux permissions +PRESERVE_PERMISSIONS=yes +PRESERVE_OWNER=yes +PRESERVE_GROUP=yes ## Preserve ACLS. Make sure source and target FS can manage same ACLs or you'll get loads of errors. PRESERVE_ACL=no ## Preserve Xattr. Make sure source and target FS can manage same Xattrs or you'll get loads of errors.