Class: Backup::Storage::Local
Instance Attribute Summary collapse
-
#final_file ⇒ Object
Store on same machine, preferentially in a different hard drive or in a mounted network path (NFS, Samba, etc).
-
#path ⇒ Object
Store on same machine, preferentially in a different hard drive or in a mounted network path (NFS, Samba, etc).
-
#tmp_path ⇒ Object
Store on same machine, preferentially in a different hard drive or in a mounted network path (NFS, Samba, etc).
Instance Method Summary collapse
-
#initialize(adapter) ⇒ Local
constructor
Stores the backup file on local machine.
Methods included from CommandHelper
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_file ⇒ Object
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 |
#path ⇒ Object
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_path ⇒ Object
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 |