mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-11 06:23:47 -05:00
now has DELETE variable in rysnc config
This commit is contained in:
@@ -243,6 +243,11 @@ UNISONPROFILE=""
|
|||||||
# Anything listed within this file will be ignored during sync.
|
# Anything listed within this file will be ignored during sync.
|
||||||
EXCLUDE=""
|
EXCLUDE=""
|
||||||
|
|
||||||
|
# DELETE sets the variable to delete files in the target directory that are deleted from
|
||||||
|
# the source directory. Defaults to equal "--delete" which sets that flag. Set to null
|
||||||
|
# to ensure all files on the target remain when deleted from the source.
|
||||||
|
DELETE="--delete"
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
# ADDITIONAL OPTIONS
|
# ADDITIONAL OPTIONS
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
@@ -366,11 +371,11 @@ function testSources() {
|
|||||||
function runRsync() {
|
function runRsync() {
|
||||||
if [ "${METHOD}" = "rsync" ]; then
|
if [ "${METHOD}" = "rsync" ]; then
|
||||||
if [ "${debug}" = "1" ]; then
|
if [ "${debug}" = "1" ]; then
|
||||||
verbose "/usr/bin/rsync -vahh${DRYRUN}${COMPRESS} --progress --force --delete --exclude-from=${EXCLUDE} ${SOURCEDIRECTORY} ${TARGETDIRECTORY} --log-file=${logFile}"
|
verbose "/usr/bin/rsync -vahh${DRYRUN}${COMPRESS} --progress --force ${DELETE} --exclude-from=${EXCLUDE} ${SOURCEDIRECTORY} ${TARGETDIRECTORY} --log-file=${logFile}"
|
||||||
else
|
else
|
||||||
notice "Commencing rsync"
|
notice "Commencing rsync"
|
||||||
/usr/bin/rsync -vahh"${DRYRUN}""${COMPRESS}" --progress --force --delete --exclude-from="${EXCLUDE}" "${SOURCEDIRECTORY}" "${TARGETDIRECTORY}" --log-file="${logFile}"
|
/usr/bin/rsync -vahh"${DRYRUN}""${COMPRESS}" --progress --force ${DELETE} --exclude-from="${EXCLUDE}" "${SOURCEDIRECTORY}" "${TARGETDIRECTORY}" --log-file="${logFile}"
|
||||||
verbose "/usr/bin/rsync -vahh${DRYRUN}${COMPRESS} --progress --force --delete --exclude-from=${EXCLUDE} ${SOURCEDIRECTORY} ${TARGETDIRECTORY} --log-file=${logFile}"
|
verbose "/usr/bin/rsync -vahh${DRYRUN}${COMPRESS} --progress --force ${DELETE} --exclude-from=${EXCLUDE} ${SOURCEDIRECTORY} ${TARGETDIRECTORY} --log-file=${logFile}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user