rsync backup: Add option for specifying custom rsync options.

This commit is contained in:
Ossi Herrala 2014-05-05 09:35:14 +00:00
parent bb0bd73076
commit 159484ec3e
2 changed files with 6 additions and 2 deletions

View file

@ -7,7 +7,7 @@ FLOCK_OPTS="--exclusive --nonblock"
FLOCK_FILE="/var/lock/<%= @name -%>"
RSYNC="/usr/bin/rsync"
RSYNC_OPTS=( -ax <%= @acl ? "-A" : "" -%> --delete --itemize-changes <%= @_excludes -%> )
RSYNC_OPTS=( -ax <%= @acl ? "-A" : "" -%> <%= @options ? options : "" -%> --delete --itemize-changes <%= @_excludes -%> )
(
$FLOCK $FLOCK_OPTS 200 || exit $?
@ -16,7 +16,7 @@ RSYNC_OPTS=( -ax <%= @acl ? "-A" : "" -%> --delete --itemize-changes <%= @_exclu
/usr/bin/time -p $RSYNC "${RSYNC_OPTS[@]}" <%= @_source -%> <%= @_target %>
RSYNCEXIT=$?
if [ $RSYNCEXIT -ne 0 ]; then
echo "ERROR: rsync job (<%= @name -%>) process returned $RSYNCEXIT"
echo "ERROR: rsync job (<%= @name -%>) process returned $RSYNCEXIT"
fi
/usr/bin/printf "\n***** Backup ended %s\n" "$(date +"%F %T UTC")"
) 200>$FLOCK_FILE >$LOGFILE 2>&1