Method: Backup::Model#perform!
- Defined in:
- lib/backup/model.rb
#perform! ⇒ Object
Performs the backup process
Once complete, #exit_status will indicate the result of this process.
If any errors occur during the backup process, all temporary files will be left in place. If the error occurs before Packaging, then the temporary folder (tmp_path/trigger) will remain and may contain all or some of the configured Archives and/or Database dumps. If the error occurs after Packaging, but before the Storages complete, then the final packaged files (located in the root of tmp_path) will remain.
*** Important *** If an error occurs and any of the above mentioned temporary files remain, those files *** will be removed *** before the next scheduled backup for the same trigger.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/backup/model.rb', line 261 def perform! @started_at = Time.now.utc @time = package.time = started_at.strftime("%Y.%m.%d.%H.%M.%S") log!(:started) before_hook procedures.each do |procedure| procedure.is_a?(Proc) ? procedure.call : procedure.each(&:perform!) end syncers.each(&:perform!) rescue Interrupt @interrupted = true raise rescue Exception => err @exception = err ensure unless @interrupted set_exit_status @finished_at = Time.now.utc log!(:finished) after_hook end end |