Sha256: 46250b617c643d34115a33ba1af0e3d19a75a5cf2d90fb63936f734510c6b97c

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

class PgExport
  class RemoveOldDumpsFromFtp
    include Logging

    def initialize(dump, ftp_service, keep_dumps)
      @dump = dump
      @ftp_service = ftp_service
      @keep_dumps = keep_dumps.to_i
    end

    def call
      ftp_service.list(dump.ftp_regexp).drop(keep_dumps).each do |filename|
        ftp_service.delete(filename)
        logger.info "Remove file #{filename} from FTP"
      end
    end

    private

    attr_accessor :dump, :ftp_service, :keep_dumps
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pg_export-0.2.0 lib/pg_export/actions/remove_old_dumps_from_ftp.rb
pg_export-0.1.3 lib/pg_export/actions/remove_old_dumps_from_ftp.rb