summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 10:01:53 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 10:01:53 +0000
commit63040f8a67e960eb4589989ad974edfb313660fa (patch)
treeda84f72fbc816fdbe926231e3427d25a8dda1e24 /bin
parent95c2d95f42385aabdb961593dd9e6d1d5d494457 (diff)
Added the ability to use the same rsync_flags as byteback-backup
This allows the user to specify --xattrs --acl --hard-links etc.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/byteback-restore10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/byteback-restore b/bin/byteback-restore
index 6afb1c2..68d3309 100755
--- a/bin/byteback-restore
+++ b/bin/byteback-restore
@@ -55,7 +55,7 @@ def restore_files(paths, snapshot)
#
# Basic args
#
- args = %w(rsync --archive --acls --numeric-ids --inplace --relative --xattrs --compress --no-implied-dirs)
+ args = %w(rsync --archive --numeric-ids --inplace --relative --compress)
#
# Add on the I/O-timeout
@@ -64,6 +64,14 @@ def restore_files(paths, snapshot)
args += ['--rsh', "ssh -o BatchMode=yes -x -a -i #{@ssh_key} -l #{@destination_user}"]
args << '--verbose' if @verbose
args += ['--rsync-path', "byteback-restore --fake-super --snapshot #{snapshot}"]
+
+ #
+ # 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
+
dst = "#{@destination_user}@#{@destination_host}:"
paths.each do |path|