Class: Backup::Storage::Local
- Inherits:
-
Object
- Object
- Backup::Storage::Local
- Includes:
- CommandHelper
- Defined in:
- lib/backup/storage/local.rb
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
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_file ⇒ Object
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 |
#path ⇒ Object
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_path ⇒ Object
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 |