README.md 1.89 KB

backup-file2s3-cookbook

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

There is also a definition aws_tar_extract to recover those backup files and unpack them.

Supported Platforms

Ubuntu 14.04

Attributes

Key Type Description Default
['backup-file2s3']['bucket'] String The S3 bucket where backup tarballs will be stored. nil
['backup-file2s3']['region'] String AWS region of the bucket. 'us-east-1'
['backup-file2s3']['max_backups'] Integer Number of old backup tarballs to retain in S3. 30
['backup-file2s3']['dirs'] Array An array of directories to be backed up. []
['backup-file2s3']['cron']['min'] String Related cron attributes are: `hour`, `day`, `mon`, `wday`, each specifying a corresponding crontab value. This cron job will determine how often the backup script is run. 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)