Sha256: a1b5d7c242d51717b10b1eeb296760aff2985d42bb09a4960ed1a926aa771800

Contents?: true

Size: 795 Bytes

Versions: 6

Compression:

Stored size: 795 Bytes

Contents

# encoding: utf-8

module Backup
  module Syncer
    module RSync
      class Pull < Push

        ##
        # Performs the RSync::Pull operation
        # debug options: -vhP
        def perform!
          write_password_file!

          @directories.each do |directory|
            Logger.message("#{ syncer_name } started syncing '#{ directory }'.")
            run("#{ utility(:rsync) } #{ options } " +
                "'#{ username }@#{ ip }:#{ directory.sub(/^\~\//, '') }' " +
                "'#{ dest_path }'")
          end

        ensure
          remove_password_file!
        end

        private

        ##
        # Return expanded @path, since this path is local
        def dest_path
          @dest_path ||= File.expand_path(@path)
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
backup-agoddard-3.0.28 lib/backup/syncer/rsync/pull.rb
backup-agoddard-3.0.27 lib/backup/syncer/rsync/pull.rb
ey-vendored-backup-3.0.27 lib/backup/syncer/rsync/pull.rb
backup-3.0.27 lib/backup/syncer/rsync/pull.rb
backup-3.0.26 lib/backup/syncer/rsync/pull.rb
backup-3.0.25 lib/backup/syncer/rsync/pull.rb