Backport RsyncPattern function from v1.2
This commit is contained in:
parent
b66b9669fa
commit
e3894d3a9d
|
@ -1,4 +1,4 @@
|
|||
## FUNC_BUILD=2016071902-f
|
||||
## FUNC_BUILD=2016071902-g
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
|
@ -1008,7 +1008,7 @@ function RsyncPatternsAdd {
|
|||
local pattern="${2}"
|
||||
__CheckArguments 2 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||
|
||||
local rest=
|
||||
local rest
|
||||
|
||||
# Disable globbing so wildcards from exclusions do not get expanded
|
||||
set -f
|
||||
|
@ -1052,20 +1052,29 @@ function RsyncPatterns {
|
|||
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||
|
||||
if [ "$RSYNC_PATTERN_FIRST" == "exclude" ]; then
|
||||
if [ "$RSYNC_EXCLUDE_PATTERN" != "" ]; then
|
||||
RsyncPatternsAdd "exclude" "$RSYNC_EXCLUDE_PATTERN"
|
||||
fi
|
||||
if [ "$RSYNC_EXCLUDE_FROM" != "" ]; then
|
||||
RsyncPatternsFromAdd "exclude" "$RSYNC_EXCLUDE_FROM"
|
||||
fi
|
||||
if [ "$RSYNC_INCLUDE_PATTERN" != "" ]; then
|
||||
RsyncPatternsAdd "$RSYNC_INCLUDE_PATTERN" "include"
|
||||
fi
|
||||
if [ "$RSYNC_INCLUDE_FROM" != "" ]; then
|
||||
RsyncPatternsFromAdd "include" "$RSYNC_INCLUDE_FROM"
|
||||
fi
|
||||
# Use default include first for quicksync runs
|
||||
elif [ "$RSYNC_PATTERN_FIRST" == "include" ] || [ "$_QUICK_SYNC" == "2" ]; then
|
||||
if [ "$RSYNC_INCLUDE_PATTERN" != "" ]; then
|
||||
RsyncPatternsAdd "include" "$RSYNC_INCLUDE_PATTERN"
|
||||
fi
|
||||
if [ "$RSYNC_INCLUDE_FROM" != "" ]; then
|
||||
RsyncPatternsFromAdd "include" "$RSYNC_INCLUDE_FROM"
|
||||
fi
|
||||
if [ "$RSYNC_EXCLUDE_PATTERN" != "" ]; then
|
||||
RsyncPatternsAdd "exclude" "$RSYNC_EXCLUDE_PATTERN"
|
||||
fi
|
||||
if [ "$RSYNC_EXCLUDE_FROM" != "" ]; then
|
||||
RsyncPatternsFromAdd "exclude" "$RSYNC_EXCLUDE_FROM"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue