Sha256: 4c431868f9ac63dcdb44c0ae07e0005f0ba05d357ac0ca6d5aa60c6acffc7981

Contents?: true

Size: 842 Bytes

Versions: 1

Compression:

Stored size: 842 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 }'.")
            Logger.silent(
              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

1 entries across 1 versions & 1 rubygems

Version Path
backup-3.0.24 lib/backup/syncer/rsync/pull.rb