Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
161 lines (128 sloc) 4.36 KB

Welcome to Outback

Outback is a Ruby backup tool, enabling you to create backups of your server files and databases and storing them in a local or remote repository. Using a simple DSL, you can specify multiple sources that generate backup data, as well as multiple targets, where backups are going to be stored.

Outback configuration files are pure Ruby, so writing dynamic configurations or even customized backup sources and targets is a piece of cake.


$ gem install outback

Then you can invoke outback from the command line:

$ outback --help

A simple configuration example

You can instantiate as many configurations as you like. Outback will enqueue and execute all configurations that were instantiated during a single run. 'name' do
  source :directory, '/var/www' do
    exclude '/var/www/foo'
    exclude '/var/www/icons/*.png'

  source :mysql do
    user 'mysqlusername'
    password 'mysqlpassword'
    host 'localhost'
    exclude 'mysql', 'information_schema'

    # If you do not specify a specific database, all databases
    # will be dumped and included in the backup
    # database 'specific_database'  

  processor :encryption do
    password 'very secure encryption password'
    # The default cipher is aes-256-cbc
    #cipher 'openssl supported cipher'

  # Amazon S3 storage
  target :s3 do
    access_key  'S3 access key'
    secret_key  'S3 secret key'
    bucket_name 'bucketname'
    prefix      'backups/daily'

    # Backups will be purged after the time specified here.
    # Just omit the definition to keep archives forever.
    ttl         1.month
  # SFTP storage
  target :sftp, '' do
    user 'backupuser'
    # Usually, SSH keys will be used to connect to the server.
    # Alternatively, a password can be given here.
    #password 'your password'

    # Default port is 22
    # port 1234
    path '/backups'

  # Store on a local filesystem path
  target :directory, '/media/backups/daily' do
    # If you specify the move option, archives will be moved from the temporary
    # filesystem location in order to speed up things. Otherwise, archives will
    # be copied. Note that a 'move'-to target must be specified last in the target
    # chain.
    move  true
    user  'root'
    group 'root'
    directory_permissions 0700
    archive_permissions   0600

Default configurations and commandline options

If you place your backup configurations in the file /etc/outback.conf they will be read automatically when the outback executable is invoked. Make sure to have correct permissions on the configuration files, as they might include database and encryption passwords.

Alternatively, you can pass in the configuration file to read as a commandline argument. The default configuration file in /etc will then be ignored:

$ outback ./my_config.rb

If you have several backup configurations in a single file, say, for daily and monthly backups, you can use the -c commandline option to select the backup to be invoked:

$ outback -c 'myservername-daily'

This will run only the backup with the specified name, which enables you to write DRY configurations like this:

{ :daily => [14.days, 5.days], :monthly	=> [1.year, 1.year] }.each do |frequency, ttls|
  s3_ttl, directory_ttl = ttls "yourserver-#{frequency}" do
    source :directory, '/home'
    source :directory, '/var/svn'

    target :s3 do
      access_key  'foo'
      secret_key  'foo'
      bucket_name 'somebucket'
      prefix      "yourserver/#{frequency}"
      ttl         s3_ttl

    target :directory, "/media/backups/#{frequency}" do
      move  true
      ttl   directory_ttl
      user  'root'
      group 'root'
      directory_permissions 0700
      archive_permissions   0600

Other commandline options are:

  • -v --verbose be talky
  • -s --silent be silent
  • -t --test test configuration, then exit
  • -l --list list available configurations, then exit
  • -h --help display help
  • --version display version

Known Issues

The s3 gem currently doesn't support V4 signatures, which are required for s3 regions introduced after January 2014.