Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change backup_mailer parameters to be configured by application const…

  • Loading branch information...
commit c4c3d7b199ff372412d2483e565f040e1220c71b 1 parent 9543c1b
@lazylester authored
8 README.rdoc
@@ -28,3 +28,11 @@ The location of the backup files is defined by the global constant BACKUP_DIR. T
Suggest keeping backup files in a location that will survive code updates, for example in a typical Capistrano configuration there might be a 'shared' directory. Include in the main application an initializer in config/initializers with the following:
BACKUP_DIR = Rails.env.production? ? Rails.root.join("../../shared/backups") : "#{Rails.root}/db/backups/"
+If it is intended to use the rake tasks for periodically emailing the backup file (e.g. driven by cron), the following global constants must be defined in your application:
+ BACKUP_RECIPIENTS (text string in the format "firstname lastname<>")
+ ORGANIZATION_NAME (text string, name of the application owner organization)
+ ADMIN_EMAIL (text string, for example: "")
+ SITE_URL (text string, for example "")
8 app/models/backup_mailer.rb
@@ -1,9 +1,9 @@
class BackupMailer < ActionMailer::Base
def backup_file(zipfile)
- recipients 'Les Nightingill<>'
- from "ORI Database Administrator<#{ADMIN_EMAIL}>"
- headers "Reply-to" => "#{ADMIN_EMAIL}", "Message-ID"=>"<#{}>"
- subject "ORI daily backup file"
+ from "#{ORGANIZATION_NAME} Database Administrator<#{ADMIN_EMAIL}>"
+ headers "Reply-to" => "#{ADMIN_EMAIL}", "Message-ID"=>"<#{}@#{SITE_URL}>"
+ subject "#{ORGANIZATION_NAME} daily backup file"
attachment :content_type => "application/x-gzip", :body => zipfile, :filename =>""
4 lib/tasks/get_back_tasks.rake
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :get_back do
-# # Task goes here
-# end
Please sign in to comment.
Something went wrong with that request. Please try again.