Methods

Class/Module Index [+]

Quicksearch

Backup::Syncer::RSync::Push

Attributes

additional_ssh_options[RW]

Additional SSH Options

Used to supply a String or Array of options to be passed to the SSH command in `:ssh` and `:ssh_daemon` modes.

For example, if you need to supply a specific SSH key for the `ssh_user`, you would set this to: “-i ‘/path/to/id_rsa’”. Which would produce:

rsync -e "ssh -p 22 -i '/path/to/id_rsa'"

Arguments may be single-quoted, but should not contain any double-quotes.

Used only for `:ssh` and `:ssh_daemon` modes.

compress[RW]

Flag for compressing (only compresses for the transfer)

host[RW]

Server Address

mode[RW]

Mode of operation

:ssh (default)

Connects to the remote via SSH. Does not use an rsync daemon on the remote.

:ssh_daemon

Connects to the remote via SSH. Spawns a single-use daemon on the remote, which allows certain daemon features (like modules) to be used.

:rsync_daemon

Connects directly to an rsync daemon via TCP. Data transferred is not encrypted.

port[RW]

SSH or RSync port

For `:ssh` or `:ssh_daemon` mode, this specifies the SSH port to use and defaults to 22.

For `:rsync_daemon` mode, this specifies the TCP port to use and defaults to 873.

rsync_password[RW]

RSync Password

If specified, Backup will write the password to a temporary file and use it with rsync’s `–password-file` option for daemon authentication.

Note that setting this will override `rsync_password_file`.

Used only for `:ssh_daemon` and `:rsync_daemon` modes.

rsync_password_file[RW]

RSync Password File

If specified, this path will be passed to rsync’s `–password-file` option for daemon authentication.

Used only for `:ssh_daemon` and `:rsync_daemon` modes.

rsync_user[RW]

RSync User

If the user running the backup is not the same user that needs to authenticate with the rsync daemon, specify the user here.

Used only for `:ssh_daemon` and `:rsync_daemon` modes.

ssh_user[RW]

SSH User

If the user running the backup is not the same user that needs to authenticate with the remote server, specify the user here.

The user must have SSH keys setup for passphrase-less access to the remote. If the SSH User does not have passphrase-less keys, or no default keys in their `~/.ssh` directory, you will need to use the `-i` option in `:additional_ssh_options` to specify the passphrase-less key to use.

Used only for `:ssh` and `:ssh_daemon` modes.

Public Class Methods

new(syncer_id = nil) click to toggle source
# File lib/backup/syncer/rsync/push.rb, line 103
def initialize(syncer_id = nil)
  super

  @mode ||= :ssh
  @port ||= mode == :rsync_daemon ? 873 : 22
  @compress ||= false
end

Public Instance Methods

perform!() click to toggle source
# File lib/backup/syncer/rsync/push.rb, line 111
def perform!
  log!(:started)
  write_password_file!

  create_dest_path!
  run("#{ rsync_command } #{ paths_to_push } " +
      "#{ host_options }'#{ dest_path }'")

  log!(:finished)
ensure
  remove_password_file!
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.