Created
July 6, 2012 04:13
-
-
Save FernandoEscher/3058027 to your computer and use it in GitHub Desktop.
Backup file for the backup of Postgresql to Dropbox account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
## | |
# Backup Generated: my_backup | |
# Once configured, you can run the backup with the following command: | |
# | |
# $ backup perform -t my_backup [-c <path_to_configuration_file>] | |
# | |
database_yml = File.expand_path('/opt/deployed/application/current/config/database.yml', __FILE__) | |
RAILS_ENV = ENV['RAILS_ENV'] || 'production' | |
require 'yaml' | |
config = YAML.load_file(database_yml) | |
Backup::Model.new(:my_backup, 'Backup for the my\'s production instance') do | |
## | |
# Split [Splitter] | |
# | |
# Split the backup file in to chunks of 250 megabytes | |
# if the backup file size exceeds 250 megabytes | |
# | |
split_into_chunks_of 250 | |
## | |
# PostgreSQL [Database] | |
# | |
database PostgreSQL do |db| | |
db.name = config[RAILS_ENV]["database"] | |
db.username = config[RAILS_ENV]["username"] | |
db.password = config[RAILS_ENV]["password"] | |
db.host = config[RAILS_ENV]["host"] | |
db.port = config[RAILS_ENV]["port"] | |
db.skip_tables = [] | |
db.additional_options = ["-xc", "-E=utf8"] | |
# Optional: Use to set the location of this utility | |
# if it cannot be found by name in your $PATH | |
# db.pg_dump_utility = "/opt/local/bin/pg_dump" | |
end | |
## | |
# Dropbox File Hosting Service [Storage] | |
# | |
# Access Type: | |
# | |
# - :app_folder (Default) | |
# - :dropbox | |
# | |
# Note: | |
# | |
# Initial backup must be performed manually to authorize | |
# this machine with your Dropbox account. | |
# | |
store_with Dropbox do |db| | |
db.api_key = "api_key" | |
db.api_secret = "api_secret" | |
db.access_type = :app_folder | |
db.path = "backups" | |
db.keep = 25 | |
end | |
## | |
# Mail [Notifier] | |
# | |
# The default delivery method for Mail Notifiers is 'SMTP'. | |
# See the Wiki for other delivery options. | |
# https://github.com/meskyanichi/backup/wiki/Notifiers | |
# | |
notify_by Mail do |mail| | |
mail.on_success = true | |
mail.on_warning = true | |
mail.on_failure = true | |
mail.from = "[email protected]" | |
mail.to = "[email protected]" | |
mail.address = "smtp.gmail.com" | |
mail.port = 587 | |
mail.domain = "dominio" | |
mail.user_name = "[email protected]" | |
mail.password = "pa$$word" | |
mail.authentication = "plain" | |
mail.enable_starttls_auto = true | |
end | |
compress_with Gzip do |compression| | |
compression.level = 6 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment