Sha256: 3abfee104eec4488b8aa1df8956b3f7bbff8f0a0125c0b8562f8640d2e0b951d

Contents?: true

Size: 703 Bytes

Versions: 11

Compression:

Stored size: 703 Bytes

Contents

module Backup
  module Connection
    class SSH < Backup::Connection::Base
      
      def initialize(options = {})
        super(options)
      end
      
      # Initializes the transfer to the specified server using SSH.
      # This will first ensure there is a directory, if there is not, a new one will be created
      # After the directory has been confirmed, the transfer process will be initialized.
      def transfer
        %x{ ssh #{options[:ssh][:user]}@#{options[:ssh][:ip]} mkdir -p #{options[:ssh][:path]} }
        %x{ scp #{File.join(options[:backup_path], options[:backup_file])} #{options[:ssh][:user]}@#{options[:ssh][:ip]}:#{options[:ssh][:path]} }
      end

    end
  end 
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
backup-1.3.4 lib/backup/connection/ssh.rb
backup-1.3.3 lib/backup/connection/ssh.rb
backup-1.3.2 lib/backup/connection/ssh.rb
backup-1.3.1 lib/backup/connection/ssh.rb
backup-1.3.0 lib/backup/connection/ssh.rb
backup-1.2.2 lib/backup/connection/ssh.rb
backup-1.2.1 lib/backup/connection/ssh.rb
backup-1.2.0 lib/backup/connection/ssh.rb
backup-1.1.0 lib/backup/connection/ssh.rb
backup-1.0.0 lib/backup/connection/ssh.rb
backup-0.2.0 lib/backup/connection/ssh.rb