Skip to content

kaimi/chef-rdiff-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rdiff-backup Cookbook

This cookbook configures backup using the rdiff-backup backup tool.

Requirements

ssh key

Put a ssh private key into files/default/#{node['rdiff-backup']['key']} and the corresponding public one into files/default/#{node['rdiff-backup']['key']}.pub.

This key will be used for the rdiff-backup user that runs the backups.

Cookbooks:

  • ssh_known_hosts
  • sudo

Attributes

rdiff-backup::default

Key Type Description Default
['rdiff-backup']['backup_dir'] String where to put the backup files /backup
['rdiff-backup']['etc_dir'] String where to put the rdiff-backup config files /etc/rdiff-backup
['rdiff-backup']['user'] Boolean the user to run the backup task as rdiff-backup
['rdiff-backup']['key'] String the ssh key file name id_rsa
['rdiff-backup']['cron']['enable'] Boolean whether to setup a cron job for automated backups true
['rdiff-backup']['cron']['email'] String where to send summary emails nil
['rdiff-backup']['cron']['lockfile'] String where to write the cron job lockfile /tmp/rdiff-backup.lock
['rdiff-backup']['cron']['day'] String `day` component of the cron job definition *
['rdiff-backup']['cron']['hour'] String `hour` component of the cron job definition *
['rdiff-backup']['cron']['minute'] String `minute` component of the cron job definition *
['rdiff-backup']['cron']['month'] String `month` component of the cron job definition *
['rdiff-backup']['cron']['weekday'] String `weekday` component of the cron job definition *
['rdiff-backup']['autotrim']['enable'] Boolean whether to auto trim backups true
['rdiff-backup']['autotrim']['timespan'] String backup retention timespan (in rdiff-backup format) 1y

Definitions

backup_path

Adds a path to the backup directory list.

Usage

recipes

rdiff-backup::default

Used in the other recipes. Do not call directly.

rdiff-backup::client

Sets up the client (= host to be backed up) side.

rdiff-backup::server

Sets up the server (= host to save backups to) side.

This will do things: if enabled, a cron job is created that backs up all configured rdiff-backup clients, and scripts to run on demand backups of each single client.

###definitions

backup_path

backup_path "/var/lib/mailman"

Adds the mailman home directory to be backed up.

pre and post backup scripts

You can put shell scripts into #{node['rdiff-backup']['etc_dir']}/pre.d and #{node['rdiff-backup']['etc_dir']}/post.d folders to be run before and after the backup itself respectively.

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: ka’imi [email protected]