Class: PgExport::RemoveOldDumpsFromFtp
- Inherits:
-
Object
- Object
- PgExport::RemoveOldDumpsFromFtp
- Includes:
- Logging
- Defined in:
- lib/pg_export/actions/remove_old_dumps_from_ftp.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(dump, ftp_service, keep_dumps) ⇒ RemoveOldDumpsFromFtp
constructor
A new instance of RemoveOldDumpsFromFtp.
Methods included from Logging
Constructor Details
#initialize(dump, ftp_service, keep_dumps) ⇒ RemoveOldDumpsFromFtp
Returns a new instance of RemoveOldDumpsFromFtp.
5 6 7 8 9 |
# File 'lib/pg_export/actions/remove_old_dumps_from_ftp.rb', line 5 def initialize(dump, ftp_service, keep_dumps) @dump = dump @ftp_service = ftp_service @keep_dumps = keep_dumps end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 |
# File 'lib/pg_export/actions/remove_old_dumps_from_ftp.rb', line 11 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 |