|
# 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>] |
|
# |
|
Backup::Model.new(:my_backup, 'Description for my_backup') 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 |
|
## |
|
# Archive [Archive] |
|
# |
|
# Adding a file or directory (including sub-directories): |
|
# archive.add "/path/to/a/file.rb" |
|
# archive.add "/path/to/a/directory/" |
|
# |
|
# Excluding a file or directory (including sub-directories): |
|
# archive.exclude "/path/to/an/excluded_file.rb" |
|
# archive.exclude "/path/to/an/excluded_directory |
|
# |
|
# By default, relative paths will be relative to the directory |
|
# where `backup perform` is executed, and they will be expanded |
|
# to the root of the filesystem when added to the archive. |
|
# |
|
# If a `root` path is set, relative paths will be relative to the |
|
# given `root` path and will not be expanded when added to the archive. |
|
# |
|
# archive.root '/path/to/archive/root' |
|
# |
|
# For more details, please see: |
|
# https://github.com/meskyanichi/backup/wiki/Archives |
|
# |
|
archive :my_archive do |archive| |
|
# Run the `tar` command using `sudo` |
|
# archive.use_sudo |
|
archive.add "/path/to/a/file.rb" |
|
archive.add "/path/to/a/folder/" |
|
archive.exclude "/path/to/a/excluded_file.rb" |
|
archive.exclude "/path/to/a/excluded_folder" |
|
end |
|
|
|
## |
|
# PostgreSQL [Database] |
|
# |
|
database PostgreSQL do |db| |
|
db.name = "my_database_name" |
|
db.username = "my_username" |
|
db.password = "my_password" |
|
db.host = "localhost" |
|
db.port = 5432 |
|
db.socket = "/tmp/pg.sock" |
|
db.skip_tables = ["skip", "these", "tables"] |
|
db.only_tables = ["only", "these", "tables"] |
|
db.additional_options = ["-xc", "-E=utf8"] |
|
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 = "my_api_key" |
|
db.api_secret = "my_api_secret" |
|
db.access_type = :app_folder |
|
db.path = "/path/to/my/backups" |
|
db.keep = 25 |
|
end |
|
|
|
## |
|
# Gzip [Compressor] |
|
# |
|
compress_with Gzip |
|
|
|
## |
|
# 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 = "your.host.name" |
|
mail.user_name = "[email protected]" |
|
mail.password = "my_password" |
|
mail.authentication = "plain" |
|
mail.encryption = :starttls |
|
end |
|
|
|
end |