|
# encoding: utf-8 |
|
|
|
## |
|
# Backup Generated: app_backup |
|
# Once configured, you can run the backup with the following command: |
|
# |
|
# $ backup perform -t app_backup [-c <path_to_configuration_file>] |
|
# |
|
# For more information about Backup's components, see the documentation at: |
|
# http://backup.github.io/backup |
|
# |
|
|
|
# load login info |
|
db_config = YAML.load_file('/absolute/path/to/your/database.yml')['production'] |
|
|
|
Model.new(:app_backup, 'your backup title') do |
|
|
|
archive :vave_archive do |archive| |
|
# Docs: http://backup.github.io/backup/v4/archives/ |
|
# Run the `tar` command using `sudo` |
|
# archive.use_sudo |
|
archive.add "/add/folders/to/include/in/tar/archive/" |
|
end |
|
|
|
## |
|
# PostgreSQL [Database] |
|
# |
|
database PostgreSQL do |db| |
|
# To dump all databases, set `db.name = :all` (or leave blank) |
|
db.name = db_config['database'] |
|
db.username = db_config['username'] |
|
db.password = db_config['password'] |
|
db.host = "localhost" |
|
#db.port = 5432 |
|
#db.socket = "/tmp/pg.sock" |
|
# When dumping all databases, `skip_tables` and `only_tables` are ignored. |
|
#db.skip_tables = ["skip", "these", "tables"] |
|
#db.only_tables = ["only", "these", "tables"] |
|
#db.additional_options = ["-xc", "-E=utf8"] |
|
end |
|
|
|
## |
|
# Amazon Simple Storage Service [Storage] |
|
# |
|
store_with S3 do |s3| |
|
# AWS Credentials |
|
s3.access_key_id = "YOUR-AWESOME-KEY" |
|
s3.secret_access_key = "YOUR-AWESOME-KEY" |
|
# Or, to use a IAM Profile: |
|
# s3.use_iam_profile = true |
|
|
|
s3.storage_class = :reduced_redundancy |
|
s3.region = "eu-central-1" |
|
s3.bucket = "bucket-name" |
|
s3.path = "/path/in/bucket" |
|
s3.keep = 15 |
|
# s3.keep = Time.now - 2592000 # Remove all backups older than 1 month. |
|
|
|
end |
|
|
|
## |
|
# Gzip [Compressor] |
|
# |
|
compress_with Gzip |
|
|
|
## |
|
# Mail [Notifier] |
|
# |
|
# The default delivery method for Mail Notifiers is 'SMTP'. |
|
# See the documentation for other delivery options. |
|
# |
|
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.cc = "[email protected]" |
|
#mail.bcc = "[email protected]" |
|
#mail.reply_to = "[email protected]" |
|
mail.address = "smtp-host" |
|
mail.port = 587 |
|
#mail.domain = "your.host.name" |
|
mail.user_name = "smtp-user" |
|
mail.password = "smtp-password" |
|
mail.authentication = "plain" |
|
#mail.encryption = :starttls |
|
end |
|
|
|
end |