From 1877a5d328f918540e75444747a7b3903803c8cc Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 3 Jun 2015 12:50:00 +0100 Subject: Working restorations. --- byteback-restore | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'byteback-restore') 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 -- cgit v1.2.3