Class: Restic::Service::Targets::Rsync
- Inherits:
-
Base
- Object
- Base
- Restic::Service::Targets::Rsync
show all
- Includes:
- SSHTarget
- Defined in:
- lib/restic/service/targets/rsync.rb
Instance Attribute Summary
Attributes inherited from Base
#name
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from SSHTarget
#available?, #initialize, #valid?, #with_ssh_config
Methods inherited from Base
#available?, #initialize, #nice_commands
Class Method Details
.normalize_yaml(yaml) ⇒ Object
Instance Method Details
#run(*args, **options) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/restic/service/targets/rsync.rb', line 27
def run(*args, **options)
= []
if @one_file_system
<< "--one-file-system"
end
if @bandwidth_limit
limit_KiB = @bandwidth_limit / 1000
<< "--bwlimit=#{limit_KiB}"
end
home = ENV['HOME'] || '/root'
with_ssh_config do |ssh_config_name|
system(Hash['HOME' => home], *nice_commands,
'rsync', '-a', '--delete-during', '--delete-excluded',
*@filters.map { |arg| "--filter=#{arg}" },
*, @source, "#{ssh_config_name}:#{@target}")
end
end
|
#setup_from_conf(conf, yaml) ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/restic/service/targets/rsync.rb', line 19
def setup_from_conf(conf, yaml)
super
@source = yaml.fetch('source')
@target = yaml.fetch('target')
@one_file_system = yaml.fetch('one_file_system', false)
@filters = yaml.fetch('filters', [])
end
|