Class: Backup::Storage::Local

Inherits:
Object
  • Object
show all
Includes:
CommandHelper
Defined in:
lib/backup/storage/local.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommandHelper

#log, #run

Constructor Details

#initialize(adapter) ⇒ Local

Stores the backup file on local machine



12
13
14
15
16
17
18
19
# File 'lib/backup/storage/local.rb', line 12

def initialize(adapter)
  self.path = adapter.procedure.get_storage_configuration.attributes['path']
  self.tmp_path   = adapter.tmp_path
  self.final_file = adapter.final_file
  
  run "mkdir -p #{path}"
  run "cp #{File.join(tmp_path, final_file).gsub('\ ', ' ')} #{File.join(path, final_file)}"
end

Instance Attribute Details

#final_fileObject

Store on same machine, preferentially in a different hard drive or in a mounted network path (NFS, Samba, etc)



9
10
11
# File 'lib/backup/storage/local.rb', line 9

def final_file
  @final_file
end

#pathObject

Store on same machine, preferentially in a different hard drive or in a mounted network path (NFS, Samba, etc)



9
10
11
# File 'lib/backup/storage/local.rb', line 9

def path
  @path
end

#tmp_pathObject

Store on same machine, preferentially in a different hard drive or in a mounted network path (NFS, Samba, etc)



9
10
11
# File 'lib/backup/storage/local.rb', line 9

def tmp_path
  @tmp_path
end