summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 16:02:14 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 16:02:14 +0000
commitb2dfcbf7169bc14ca6d08cee10df23f220c5aca1 (patch)
tree7309b425af6887330a68185901da93b0af9436d6
parent76a4942dfa6d00b763391b0a05d6bb006b0d877d (diff)
Added "all" flag to restore_files in byteback-restore
Also updated the signatures of list_files and restore_files to match.
-rwxr-xr-xbin/byteback-restore10
1 files 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