B

backup-file2s3

Cookbook that installs a filesystem-to-s3 backup script.

Public
a962c6c9 Version v0.4.1 · by nollieheel

backup-file2s3-cookbook

Installs script/s that backs up one or more files/directories into an S3 bucket. Also sets up the cronjob to regularly run said script/s.

There is an option to encrypt the backups with OpenSSL. If encryption is used, the contents of the public PEM key must be provided.

There is also a definition aws_tar_extract to recover those backup files and unpack them. This definition can also decrypt the tarballs using private key contents in a node attribute (default), or explicitly passed to the definition.

Supported Platforms

Ubuntu 14.04

Attributes

Key Type Description Default
['backup-file2s3']['bucket'] String The default S3 bucket where backup tarballs will be stored. nil
['backup-file2s3']['region'] String Default AWS region. nil
['backup-file2s3']['backups'] Array An array of hashes that details the script names and directories (or files) that are to be backed up. This is also where you specify whether or not you want to encrypt the backup. Please see the default attribs file for more details. []
['backup-file2s3']['cron']['sched'] String Crontab syntax for scheduling how often the backup script/s will run. '0 0 * * *'
['backup-file2s3']['encrypt']['pub_key'] String If encryption is used by any of the paths under 'backups', then this attribute should contain the public key used to encrypt. nil
['backup-file2s3']['encrypt']['priv_key'] String If an encrypted tarball is fetched using 'aws_tar_extract', then this attribute should contain the default private key to decrypt. Although the private key can also be explicitly passed to the 'aws_tar_extract' definition. nil

Usage

backup-file2s3::default

Include backup-file2s3 in your node's run_list:

{
  "run_list": [
    "recipe[backup-file2s3::default]"
  ]
}

aws_tar_extract

The following example will get mydir.tar.gz from the provided S3 region and bucket and unpack it into the /opt/src.

aws_tar_extract 'mydir' do
  region     'us-east-1'
  bucket     'my-bucket'
  target_dir '/opt/src'
  creates    '/ops/src/mydir/index.html'
end

License and Authors

Author:: Earth U. (sysadmin@chromedia.com)