Module: Bitferry::Restic
Defined Under Namespace
Classes: Backup, Restore, Task
Class Method Summary
collapse
Methods included from Logging
log, log, log=
Class Method Details
.exec(*args) ⇒ Object
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
|
# File 'lib/bitferry.rb', line 1064
def self.exec(*args)
cmd = [executable] + args
log.debug(cmd.collect(&:shellescape).join(' '))
stdout, status = Open3.capture2(*cmd)
unless status.success?
msg = "restic exit code #{status.to_i}"
log.error(msg)
raise RuntimeError, msg
end
stdout.strip
end
|
.executable ⇒ Object
1061
|
# File 'lib/bitferry.rb', line 1061
def self.executable = @executable ||= (restic = ENV['RESTIC']).nil? ? 'restic' : restic
|