This cookbook help you to setup backup-manager.
You can setup the folder you want to backup. It allows to modify and configure the backup-manager configuration through Chef.
The cookbook can be tested using kitchen
and Vagrant
is preconfigured with a minimal Ubuntu Server 14.04 LTS and Centos 6.5 image. See:
kitchen list
kitchen converge [INSTANCE|REGEXP|all]
Ubuntu
>= 8.04Debian
>= 4.0VirtualBox
andChef DK
if you want to contribute and/or test the cookbook.
The OpenNMS cookbook depends on the cookbook java
and postgresql
. The cookbook dependencies are handled by Berkshelf
. The Java and Postgres cookbooks are preconfigured to met the requirements for running OpenNMS. The following default attributes are set:
The default configuration installs backup-manager
from the distribution provided package management system yum
or apt
. The following attributes can be modified to configure backup-manager
through Chef.
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['repository_root'] | String | Where to store the archives | /var/archives |
['backup_manager']['tmp_dir'] | String | Where to place temporary files | /tmp |
['backup_manager']['repository_secure'] | String | For security reasons, the archive repository and the generated archives will be readable/writable by a given user/group. This is recommended to set this to true. | true |
['backup_manager']['user'] | String | The repository will be readable/writable only by a specific user if repository_secure is set to true. | root |
['backup_manager']['group'] | String | The repository will be readable/writable only by a specific group if repository_secure is set to true. | root |
['backup_manager']['repository_chmod'] | String | You can also choose the permission to set the repository, pay attention to what you do there! | 770 |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['archive_chmod'] | String | Each archive generated will be chmoded for security reasons (repository_secure should be enabled for this). | 660 |
['backup_manager']['archive_ttl'] | Integer | Number of days we have to keep an archive (Time To Live) | 7 |
['backup_manager']['repository_recursivepurge'] | Boolean | Number of days we have to keep an archive (Time To Live) | false |
['backup_manager']['archive_purgedups'] | Boolean | Do you want to replace duplicates by symlinks? | true |
['backup_manager']['archive_prefix'] | String | Prefix of every archive on that box | $HOSTNAME |
['backup_manager']['archive_strictpurge'] | Boolean | Should we purge only archives built with archive_prefix | true |
['backup_manager']['archive_nice_level'] | Integer | Choose a nice level from -20 (most favorable scheduling) to 19 (least favorable). | 10 |
['backup_manager']['archive_method'] | String | The backup method to use. Available methods are: tarball, tarball-incremental, mysql, svn, pipe, none | tarball |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['encryption_method'] | String | Uncomment the following line if you want to enable encryption available method: gpg | |
['backup_manager']['encryption_recipient'] | String | The encryption will be made using a GPG ID |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['tarball_nameformat'] | String | Archive filename format. long (host-full-path-to-folder.tar.gz), short (parentfolder.tar.gz) | long |
['backup_manager']['tarball_filetype'] | String | Type of archives. Available types are: tar, tar.gz, tar.bz2, tar.lz, dar, zip. | tar.gz |
['backup_manager']['tarball_over_ssh'] | Boolean | You can choose to build archives remotely over SSH. You will then need to fill the upload_ssh variables (upload_ssh_hosts, upload_ssh_user, upload_ssh_key). If this boolean is set to true, archive will be saved locally (in repository_root but will be built by the remote host). Thus, tarball_directories will be used to backup remote directories. Those archive will be prefixed with the remote host name. | false |
['backup_manager']['tarball_dumpsymlinks'] | Boolean | Do you want to dereference the files pointed by symlinks? true can lead to huge archives, be careful. | false |
['backup_manager']['tarball_directories'] | Array | Paths without spaces in their name. Atttention: It is not possible to put in paths with apsces! | /etc /home |
['backup_manager']['tarball_blacklist'] | String | Files to exclude when generating tarballs, you can put absolute or relative paths, Bash wildcards are possible. | /var/archives |
['backup_manager']['tarball_slicesize'] | String | With the "dar" filetype, you can choose a maximum slice limit. | 1000M |
['backup_manager']['tarballinc_masterdatetype'] | String | Which frequency to use for the master tarball? possible values: weekly, monthly | weekly |
['backup_manager']['tarballinc_masterdatevalue'] | Integer | Number of the day, in the tarballinc_masterdatetype frequency when master tarballs should be made | 1 |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['mysql_databases'] | String | This method is dedicated to MySQL databases. You should not use the tarball method for backing up database directories or you may have corrupted archives. Enter here the list of databases to backup. Wildcard: __ALL__ (will dump all the databases in one archive). If you want *all* databases in a seperate archive use LISTDB instead. | __ALL__ |
['backup_manager']['mysql_safedumps'] | Boolean | The best way to produce MySQL dump is done by using the --opt switch of mysqldump. This make the dump directly usable with mysql (add the drop table statements), lock the tables during the dump and other things. This is recommended for full-clean-safe backups, but needs a privileged user (for the lock permissions). | true |
['backup_manager']['mysql_adminlogin'] | String | The user who is allowed to read every databases filled in mysql_databases | root |
['backup_manager']['mysql_adminpass'] | String | Password for given mysql_adminlogin | |
['backup_manager']['mysql_host'] | String | Host where the database is | localhost |
['backup_manager']['mysql_port'] | Integer | Port where MySQL is listen on the host | 3306 |
['backup_manager']['mysql_filetype'] | String | Which compression format to use? (gzip or bzip2) | bzip2 |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['svn_repositories'] | String | Absolute paths to the svn repositories to archive | |
['backup_manager']['svn_compresswith'] | String | Which compression format to use? (gzip or bzip2) | bzip2 |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['upload_method'] | String | Which method to use for uploading archives, you can put multiple methods here. Available methods: scp, ssh-gpg, ftp, rsync, s3, none. If you don't want to use any upload method (you don't want to upload files to remote hosts) then choose none | none |
['backup_manager']['upload_host'] | String | Which compression format to use? (gzip or bzip2) | |
['backup_manager']['upload_destination'] | String | Where to put archives on the remote hosts (global) |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['upload_ssh_key'] | String | The private key to use for opening the connection | |
['backup_manager']['upload_ssh_hosts'] | String | Specific ssh hosts | |
['backup_manager']['upload_ssh_port'] | Integer | Specific ssh hosts | |
['backup_manager']['upload_ssh_destination'] | String | Port to use for SSH connections (leave blank for default 22) | |
['backup_manager']['upload_ssh_purge'] | String | Destination for ssh uploads (overrides upload_destination) | true |
['backup_manager']['upload_ssh_ttl'] | Integer | If you set upload_ssh_purge, you can specify a time to live for archives uploaded with SSH. This can let you use different ttl's locally and remotely By default, archive_ttl will be used. | |
['backup_manager']['upload_sshgpg_recipient'] | Integer | The gpg public key used for encryption, this can be a short or long key id, or a descriptive name. See gpg man page for all possibilities how to specify a key. |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['upload_ftp_secure'] | Boolean | Use FTP secured transfers (FTP over TLS) User, password and data will be uploaded encrypted with SSL. Passive mode will be automaticaly activated | false |
['backup_manager']['upload_ftp_passive'] | Boolean | Do you want to use FTP passive mode? This is mandatory for NATed/firewalled environments | true |
['backup_manager']['upload_ftp_user'] | String | User to use for the FTP connections/transfers | |
['backup_manager']['upload_ftp_password'] | String | FTP user's password | |
['backup_manager']['upload_ftp_host'] | String | FTP specific remote hosts | |
['backup_manager']['upload_ftp_purge'] | Boolean | Purge archives on remote hosts before uploading? | true |
['backup_manager']['upload_ftp_ttl'] | Integer | You can specify a time to live for archives uploaded with FTP. This can let you use different ttl's locally and remotely. By default, archive_ttl will be used. | |
['backup_manager']['upload_ftp_destination'] | String | Destination for FTP uploads (overrides upload_destination) |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['upload_s3_destination'] | String | The bucket to upload to. This bucket must be dedicated to backup-manager | |
['backup_manager']['upload_s3_access_key'] | String | The S3 access key provided to you | |
['backup_manager']['upload_s3_secret_key'] | String | The S3 secret key provided to you | |
['backup_manager']['upload_s3_purge'] | String | Purge archives on remote hosts before uploading? |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['upload_rsync_directories'] | String | Which directories should be backuped with | |
['backup_manager']['upload_rsync_destination'] | String | Destination for rsync uploads (overrides BM_UPLOAD_DESTINATION) | |
['backup_manager']['upload_rsync_hosts'] | String | The list of remote hosts, if you want to enable the upload system, just put some remote hosts here (fqdn or IPs). Leave it empty if you want to use the hosts that are defined in upload_host | |
['backup_manager']['upload_rsync_dumpsymlinks'] | String | Do you want to dereference the files pointed by symlinks? Enter true or false (true can lead to huge archives, be careful). | false |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['upload_burning_method'] | String | Method of burning archives from the list: DVD, DVD-RW, CDRW, CDR, none. Note that if backup-manager is run from interactive prompt you will be asked to insert disc(s) when needed | |
['backup_manager']['upload_burning_chkmd5'] | String | When the CD is burnt, it is possible to check every file's MD5 checksum to see if the CD is not corrupted. | false |
['backup_manager']['upload_burning_device'] | String | The device to use for mounting the cdrom | |
['backup_manager']['upload_burning_devforced'] | String | You can force cdrecord to use a specific device. Fill in the full path to the device to use or even e.g. burning_devforced="/dev/cdrom". If none specified, the default cdrecord device will be used. | |
['backup_manager']['upload_burning_iso_flags'] | String | By default backup-manager will make Joliet media (using the mkisofs switches "-R -J"). You can change these if you want to use non-Joliet disc images. Change this only if you know what you're doing. Refer to mkisofs(8) for details. | -R -J |
['backup_manager']['upload_burning_maxsize'] | Integer | Enter here the max size of your media (usual sizes are 4200 for DVD media and 700 or 800 for CDR media) |
We will cron the job at midnight by default.
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['cron_minute'] | String | Use the con syntax to set the minutes | 0 |
['backup_manager']['cron_hour'] | String | Use the con syntax to set the minutes | 0 |
['backup_manager']['cron_day'] | String | Use the con syntax to set the day | * |
['backup_manager']['cron_month'] | String | Use the con syntax to set the month | * |
['backup_manager']['cron_week'] | String | Use the con syntax to set the week | * |
Key | Type | Description | Default |
---|---|---|---|
['backup_manager']['logger'] | Boolean | Every output made can be sent to syslog set this to true or false | true |
['backup_manager']['logger_level'] | String | Which level of messages do you want to log to syslog? Possible values are: debug, info, warning, error | warning |
['backup_manager']['logger_facility'] | String | You can choose which facility to use. | user |
['backup_manager']['pre_backup_command'] | String | Enter here some shell script. It will be executed before the first action of backup-manager. | |
['backup_manager']['post_backup_command'] | String | Enter here some shell script. It will be executed after the last action of backup-manager. |
This cookbook will install backup-manager
with all default settings. You have just include backup-manager
in your node's run_list
:
{
"name":"my_node",
"run_list": [
"recipe[backup-manager]"
]
}
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Authors:
- Nacer Laradji https://github.com/laradji
- Ronny Tromer https://github.com/indigo423