summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2015-02-01 22:12:35 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2015-02-01 22:12:35 +0000
commit3758ee8660246450d19b88147c64901b833333ee (patch)
treeb21739ababd0951ff37613a7db3e4c1fded0c42f
parente74d1b49c5d14c57a2704f353f705cbfce4d37f3 (diff)
Moved added rsync options file so xattrs etc can be specified in there
-rwxr-xr-xbyteback-backup12
1 files changed, 10 insertions, 2 deletions
diff --git a/byteback-backup b/byteback-backup
index 3b6a040..cbf6f7b 100755
--- a/byteback-backup
+++ b/byteback-backup
@@ -190,8 +190,7 @@ def rsync(*sources)
# given filesystem, daily backups (with this tool) are out of the question.
#
args = %w( rsync --archive --numeric-ids --delete-delay --inplace --relative --timeout 43200 )
- args += [ "--xattrs", "--hard-links", "--acls" ]
- args += [ "--rsync-path", "rsync --fake-super"]
+
args += [ "--rsh", "ssh -o BatchMode=yes -x -a -i #{@ssh_key} -l #{@destination_user}"]
args << "--verbose" if @verbose
args += @excludes.map { |x| ["--exclude", x] }.flatten
@@ -210,6 +209,15 @@ def rsync(*sources)
args += ["--filter", "merge /etc/byteback/rsync_filter"]
end
+ #
+ # To add extra rsync flags, a file can be used. This can have flags all on one line, or one per line.
+ #
+ if File.exists?("/etc/byteback/rsync_flags")
+ args += File.readlines("/etc/byteback/rsync_flags").map(&:chomp)
+ end
+
+ args += [ "--rsync-path", "rsync --fake-super"]
+
args += sources
args << @destination