Cookbook to perform application backups. This cookbook uses backup gem to run the backups. Please check the gem documentation for valid options on each supported type.
This cookbook is still in development but can be used if current features cover your needs.
For now, this cookbook:
- Supports installing rbenv globally and the backup gem inside it.
- Provides a method to generate the backup configuration file (the model) for:
- Application files.
- MySQL, MongoDB and Redis databases.
- Supports:
- Dropbox, Amazon S3, SCP and SFTP as storages.
- Backup scheduling.
- Compression with Gzip.
- Mail relay configuration.
- Encryption with OpenSSL.
- Synchronization using Rsync.
Features to be implemented:
- Notifiers: not all alternatives are implemented
- Storages: not all alternatives are implemented
- Syncers: not all alternatives are implemented
Tested on Ubuntu 14.04, should work on:
- Centos / Redhat / Fedora / Ubuntu / Debian.
This cookbook has only one recipe which is install
, the one that sets up the
global rbenv environment and the backup gem inside that environment. Must be
run on every server that will execute backups with this cookbook.
###mo_backup
Creates a model for backup specified archives to be backed up daily, weekly and monthly. Unless a storage specifies a keep value, each period can specify a different keep values
Supported attributes are:
name
: name of this backup. Name must not contain spacesdescription
: description for this backupuser
: user to run backups as. Defaults to rootbackup_directory
: directory relative to user's home directory where backup configuration will be stored. Defaults toBackup/models
notifiers
: hash of notifiers specificationsuse_sudo
: will run tar using sudoroot
: specifies base path where relatives archives will be consideredarchives
: array or string of archives to backupexclude
: array or string of archives to excludecompress
: compress backed up datastorages
: hash of storages specificationsdatabases
: hash of databases specificationsdaily_keeps
: how many backups will be kept for daily backups. May be overwritten by storages definitionweekly_keeps
: how many backups will be kept for weekly backups. May be overwritten by storages definitionmonthly_keeps
: how many backups will be kept for monthly backups. May be overwritten by storages definitionstart_hour
: start hour to calculate a random backup hour range. Defaults to 1end_hour
: end hour to calculate a random hour range. Defaults to 7week_day
: default week day to backup data weekly. Defaults to Sunday (0)month_day
: default month day to backup data monthly
###mo_backup_sync
Creates a model for syncing specified directories
Supported attributes are:
name
: name of this backup. Name must not contain spacesdescription
: description for this backupuser
: user to run backups as. Defaults to rootbackup_directory
: directory relative to user's home directory wheredirectories
: array or string of directories to be syncedexclude
: array or string exclude directories to be excludedsyncers
: hash of syncers specifications. If you specify irectories and exclude attributes inside a syncer definition, these attributes will be overwritten by resource valuesevery_minutes
: number used to specify when sync will be done every number minutes. When false sync minutes will be disabledevery_hours
: number used to specify when sync will be done every number hours. When false sync by hours will be disabled
Are hashes of keys valid for backup gem with its values. For more information
view gem documentation and library/mo_backu_*.rb
files
MIT (see LICENSE.md)
- Author:: Christian Rodriguez ([email protected])
- Author:: Leandro Di Tommaso ([email protected])
- Author:: Nahuel Cuesta Luengo ([email protected])