summaryrefslogtreecommitdiff
path: root/bin/byteback-restore
diff options
context:
space:
mode:
Diffstat (limited to 'bin/byteback-restore')
-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