class SimpleBackup::Engine::Engine

Public Instance Methods

mailer=(mailer) click to toggle source
# File lib/simple_backup/engine.rb, line 10
def mailer=(mailer)
  @mailer = mailer
end
notify() click to toggle source
# File lib/simple_backup/engine.rb, line 29
def notify
  return unless @mailer
  @@logger.scope_start :info, "Sending e-mail notification"

  @mailer.send

  @@logger.scope_end :info, "Notifications for backup #{TIMESTAMP} finished"
rescue StandardError => e
  SimpleBackup.handle_exception(e)
end
run() click to toggle source
# File lib/simple_backup/engine.rb, line 14
def run
  usage = Utils::Disk::usage

  @@logger.error "Disk high usage treshold exceeded #{usage[:high_usage]}" if usage[:high_usage_exceeded]
  @@logger.scope_start :info, "Backup"

  @@sources.backup
  @@backends.save_and_cleanup
  @@sources.cleanup

  @@logger.scope_end
ensure
  @@mysql.close
end