Skip to content

Instantly share code, notes, and snippets.

@brianstorti
Created September 3, 2011 20:18
Show Gist options
  • Save brianstorti/1191717 to your computer and use it in GitHub Desktop.
Save brianstorti/1191717 to your computer and use it in GitHub Desktop.
Backup configuration file
Backup::Model.new(:backup_name, 'Description') do
##
# PostgreSQL [Database]
#
database PostgreSQL do |db|
db.name = "db_name"
db.username = "username"
db.password = "password"
db.host = "host"
db.port = 5432
db.additional_options = ['-xc', '-E=utf8']
end
##
# Dropbox File Hosting Service [Storage]
#
store_with Dropbox do |db|
db.api_key = 'key'
db.api_secret = 'secret'
db.timeout = 300
db.path = '/backups/path'
db.keep = 25
end
##
# FTP [Storage]
#
store_with FTP do |server|
server.username = 'username'
server.password = 'password'
server.ip = '127.0.0.1'
server.port = 21
server.path = '/backups/path'
server.keep = 5
end
##
# OpenSSL [Encryptor]
#
encrypt_with OpenSSL do |encryption|
encryption.password = 'password'
encryption.base64 = true
encryption.salt = true
end
##
# Gzip [Compressor]
#
compress_with Gzip do |compression|
compression.best = true
compression.fast = false
end
##
# Mail [Notifier]
#
notify_by Mail do |mail|
mail.on_success = true
mail.on_failure = true
mail.from = '[email protected]'
mail.to = '[email protected]'
mail.address = 'smtp.gmail.com'
mail.port = 587
mail.domain = 'gmail.com'
mail.user_name = '[email protected]'
mail.password = 'password'
mail.authentication = 'plain'
mail.enable_starttls_auto = true
end
end
#Perfom backup
backup perfom -t backup_name
#Perfom backup with custom path
backup perform --trigger my_backup --config-file /path/to/other/config.rb
#Decrypt backup (OpenSSL)
backup decrypt --encryptor openssl --base64 --in 2011.09.03.16.15.10.backup_socialfrete.tar.gz.enc --out 2011.09.03.16.15.10.backup_socialfrete.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment