Class: Backup::Storage::Base
- Inherits:
-
Object
- Object
- Backup::Storage::Base
- Includes:
- Configuration::Helpers
- Defined in:
- lib/backup/storage/base.rb
Instance Attribute Summary collapse
-
#keep ⇒ Object
Sets the limit to how many backups to keep in the remote location.
-
#storage_id ⇒ Object
(Optional) User-defined string used to uniquely identify multiple storages of the same type.
Instance Method Summary collapse
-
#initialize(model, storage_id = nil) ⇒ Base
constructor
Creates a new instance of the storage object * Called with super(model, storage_id) from each subclass.
-
#perform! ⇒ Object
Performs the backup transfer.
Methods included from Configuration::Helpers
#clear_defaults!, #load_defaults!
Constructor Details
#initialize(model, storage_id = nil) ⇒ Base
Creates a new instance of the storage object
-
Called with super(model, storage_id) from each subclass
23 24 25 26 27 |
# File 'lib/backup/storage/base.rb', line 23 def initialize(model, storage_id = nil) load_defaults! @model = model @storage_id = storage_id end |
Instance Attribute Details
#keep ⇒ Object
Sets the limit to how many backups to keep in the remote location. If exceeded, the oldest will be removed to make room for the newest
11 12 13 |
# File 'lib/backup/storage/base.rb', line 11 def keep @keep end |
#storage_id ⇒ Object
(Optional) User-defined string used to uniquely identify multiple storages of the same type. This will be appended to the YAML storage file used for cycling backups.
18 19 20 |
# File 'lib/backup/storage/base.rb', line 18 def storage_id @storage_id end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
31 32 33 34 35 36 37 38 39 |
# File 'lib/backup/storage/base.rb', line 31 def perform! @package = @model.package @checksum_creator = @model.checksum_creator if @checksum_creator @checksum_creator.process_checksum_file_before_transfer(file_names_as_hash, @package.checksum_name, local_path) end transfer! cycle! end |