From b2dfcbf7169bc14ca6d08cee10df23f220c5aca1 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 2 Dec 2015 16:02:14 +0000 Subject: Added "all" flag to restore_files in byteback-restore Also updated the signatures of list_files and restore_files to match. --- bin/byteback-restore | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/byteback-restore b/bin/byteback-restore index aaf6081..06fca15 100755 --- a/bin/byteback-restore +++ b/bin/byteback-restore @@ -35,7 +35,7 @@ def ssh(*ssh_args) system(*args) end -def list_files(snapshot, all, pattern) +def list_files(pattern, snapshot, all) args = ['byteback-receive', '--snapshot', snapshot, '--list'] args << "--all" if all args << @verbose if @verbose @@ -51,7 +51,7 @@ end # do that by setting "rsync-path" to point to a faux script. # # -def restore_files(paths, snapshot) +def restore_files(paths, snapshot, all) # # Basic args # @@ -63,7 +63,7 @@ def restore_files(paths, snapshot) args += ['--timeout', @io_timeout.to_s ] unless ( @io_timeout.nil? ) 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}"] + args += ['--rsync-path', "byteback-restore --fake-super --snapshot #{snapshot}" + (all ? " --all" : "")] # # To add extra rsync flags, a file can be used. This can have flags all on one line, or one per line. @@ -179,10 +179,10 @@ if __FILE__ == $PROGRAM_NAME # # Restore a file # - restore_files(ARGV.collect{|a| File.expand_path(a)}, opts[:snapshot]) + restore_files(ARGV.collect{|a| File.expand_path(a)}, opts[:snapshot], opts[:all]) exit(0) end - list_files(opts[:snapshot], opts[:all], ARGV.collect{|a| File.expand_path(a)}) + list_files(ARGV.collect{|a| File.expand_path(a)}, opts[:snapshot], opts[:all]) exit(0) end -- cgit v1.2.1