Class: BackupClient::Components::Ftp::Commands::Upload

Inherits:
Object
  • Object
show all
Includes:
Helpers::FtpHelper, Helpers::LogHelper
Defined in:
lib/backup_client/components/ftp/commands/upload.rb

Constant Summary collapse

FTP_PORT =
21

Instance Method Summary collapse

Methods included from Helpers::FtpHelper

#ftp_chdir, #ftp_dir_exists?, #ftp_mkdir, #ftp_mkdir_p, #root_chdir, #to_unix_path, #upload_dir_ftp, #upload_file_ftp

Methods included from Helpers::LogHelper

#log

Constructor Details

#initialize(provider, source_paths, timestamp:, use_timestamp: false) ⇒ Upload

Returns a new instance of Upload.



13
14
15
16
17
18
# File 'lib/backup_client/components/ftp/commands/upload.rb', line 13

def initialize(provider, source_paths, timestamp:, use_timestamp: false)
  @provider      = provider
  @source_paths  = source_paths
  @timestamp     = timestamp
  @use_timestamp = use_timestamp
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
# File 'lib/backup_client/components/ftp/commands/upload.rb', line 20

def call
  ftp_mkdir_p(destination_path)

  ftp_processing

  ftp_client.close
end