summaryrefslogtreecommitdiff
path: root/bin/byteback-restore
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 10:00:40 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 10:00:40 +0000
commit95c2d95f42385aabdb961593dd9e6d1d5d494457 (patch)
tree1adbe163e27ee3dd0d281f01bbe10ef1af04ca70 /bin/byteback-restore
parentb186a1b6ff0ac7a9558eb3618f2c42a69599c145 (diff)
Changed the word "revision" to "snapshot" everywhere
This is for consistency and understanding. We use btrfs snapshots, so this makes sense. To me at least.
Diffstat (limited to 'bin/byteback-restore')
-rwxr-xr-xbin/byteback-restore15
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/byteback-restore b/bin/byteback-restore
index 0a068a8..6afb1c2 100755
--- a/bin/byteback-restore
+++ b/bin/byteback-restore
@@ -35,8 +35,8 @@ def ssh(*ssh_args)
system(*args)
end
-def list_files(revision, list_all, pattern)
- args = ['byteback-receive', '--revision', revision, '--list']
+def list_files(snapshot, list_all, pattern)
+ args = ['byteback-receive', '--snapshot', snapshot, '--list']
args << "--list-all" if list_all
args << @verbose if @verbose
args += Byteback::Restore.encode_args(pattern)
@@ -51,8 +51,7 @@ end
# do that by setting "rsync-path" to point to a faux script.
#
#
-def restore_files(paths, revision)
-
+def restore_files(paths, snapshot)
#
# Basic args
#
@@ -64,7 +63,7 @@ def restore_files(paths, revision)
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 --revision #{revision}"]
+ args += ['--rsync-path', "byteback-restore --fake-super --snapshot #{snapshot}"]
dst = "#{@destination_user}@#{@destination_host}:"
paths.each do |path|
@@ -93,7 +92,7 @@ if __FILE__ == $PROGRAM_NAME
opt :restore, "Restore the files"
- opt :revision, "The version of the file to restore.",
+ opt :snapshot, "The snaphot to use.",
:type => :string, :default => "*"
opt :destination, 'Backup destination (i.e. user@host:/path).',
@@ -164,10 +163,10 @@ if __FILE__ == $PROGRAM_NAME
#
# Restore a file
#
- restore_files(ARGV.collect{|a| File.expand_path(a)}, opts[:revision])
+ restore_files(ARGV.collect{|a| File.expand_path(a)}, opts[:snapshot])
exit(0)
end
- list_files(opts[:revision], opts[:list_all], ARGV.collect{|a| File.expand_path(a)})
+ list_files(opts[:snapshot], opts[:list_all], ARGV.collect{|a| File.expand_path(a)})
exit(0)
end