Sha256: 4d5e4ce4f1e6919ee8c7a0fab1ba6dbdeb7639d79a65103065fe888a37369a44

Contents?: true

Size: 482 Bytes

Versions: 3

Compression:

Stored size: 482 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
    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

3 entries across 3 versions & 1 rubygems

Version Path
pg_export-0.1.2 lib/pg_export/actions/remove_old_dumps_from_ftp.rb
pg_export-0.1.1 lib/pg_export/actions/remove_old_dumps_from_ftp.rb
pg_export-0.1.0 lib/pg_export/actions/remove_old_dumps_from_ftp.rb