summaryrefslogtreecommitdiff
path: root/byteback-restore
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-06-03 12:50:00 +0100
committerSteve Kemp <steve@steve.org.uk>2015-06-03 12:50:00 +0100
commit1877a5d328f918540e75444747a7b3903803c8cc (patch)
treeaeaa663dcccb18633ab359769aa716e977140e23 /byteback-restore
parent30cdbf783417b74c3c1a2a07d48bd0ab6399f5c4 (diff)
Working restorations.
Diffstat (limited to 'byteback-restore')
-rwxr-xr-xbyteback-restore15
1 files changed, 14 insertions, 1 deletions
diff --git a/byteback-restore b/byteback-restore
index 00964f1..4972cf4 100755
--- a/byteback-restore
+++ b/byteback-restore
@@ -47,8 +47,21 @@ def list_files( pattern )
end
+#
+# We cannot use plain 'rsync' here because the receiver command will
+# see that, and rewrite our arguments.
+#
+# To cater to this we have to wrap the rsync for the restore and we
+# do that by setting "rsync-path" to point to the receiver program.
+#
+#
def restore_file( path, revision )
- puts "Restoring revision #{revision} of file #{path}"
+ cmd = %w( rsync )
+ cmd += [ "--rsh", "ssh -o BatchMode=yes -x -a -i /etc/byteback/key -l byteback" ]
+ cmd += [ "--rsync-path", "restore" ]
+ cmd += [ "#{@destination_host}:/#{revision}/#{path}", "." ]
+ system(*cmd)
+
end