Class: Martilla::Scp

Inherits:
Storage show all
Defined in:
lib/martilla/storages/scp.rb

Instance Attribute Summary

Attributes inherited from Storage

#options

Instance Method Summary collapse

Methods inherited from Storage

#append_datetime_suffix, #config_error, create, #initialize, #invalid_options_msg, #output_filename, #suffix?

Methods inherited from Component

#bash

Constructor Details

This class inherits a constructor from Martilla::Storage

Instance Method Details

#persist(tmp_file:, gzip:) ⇒ Object

Raises:



3
4
5
6
7
# File 'lib/martilla/storages/scp.rb', line 3

def persist(tmp_file:, gzip:)
  `scp -i #{identity_file} #{user}@#{host}:#{output_filename(gzip)}`
  return nil if $?.success?
  raise Error.new("SCP storage failed with code #{$?.exitstatus}")
end