Class: Siba::Destination::Dir::Init

Inherits:
Object
  • Object
show all
Defined in:
lib/siba/plugins/destination/dir/init.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Init

Returns a new instance of Init.



10
11
12
13
# File 'lib/siba/plugins/destination/dir/init.rb', line 10

def initialize(options)
  dir = Siba::SibaCheck.options_string options, "dir"
  @dest_dir = Siba::Destination::Dir::DestDir.new dir
end

Instance Attribute Details

#dest_dirObject

Returns the value of attribute dest_dir.



8
9
10
# File 'lib/siba/plugins/destination/dir/init.rb', line 8

def dest_dir
  @dest_dir
end

Instance Method Details

#backup(path_to_backup_file) ⇒ Object



15
16
17
# File 'lib/siba/plugins/destination/dir/init.rb', line 15

def backup(path_to_backup_file)
  @dest_dir.copy_backup_to_dest path_to_backup_file
end

#get_backups_list(backup_name) ⇒ Object

Returns an array of two-element arrays:

backup_file_name, modification_time


26
27
28
# File 'lib/siba/plugins/destination/dir/init.rb', line 26

def get_backups_list(backup_name)
  @dest_dir.get_backups_list backup_name
end

#restore(backup_name, dir) ⇒ Object

Put backup file into dir



20
21
22
# File 'lib/siba/plugins/destination/dir/init.rb', line 20

def restore(backup_name, dir)
  @dest_dir.restore_backup_to_dir backup_name, dir
end