Class: Backup::Storage::Local

Inherits:
Base show all
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



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

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)



7
8
9
# File 'lib/backup/storage/local.rb', line 7

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)



7
8
9
# File 'lib/backup/storage/local.rb', line 7

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)



7
8
9
# File 'lib/backup/storage/local.rb', line 7

def tmp_path
  @tmp_path
end