About

Backuper is a simple server backup tool written in Ruby. It is aimed to backup a Rails application (file assets and database) to a remote SSH server (using rsync).

Installation

sudo gem install backuper

Configuration

Configure and run the backup :

Backuper.new do
  set :source_path,             '/var/apps/blop/current/shared/system'
  set :local_backup_base_path,  '/var/backups/blop'
  set :remote_backup_ssh_info,  'username@host:/path/to/backups/blop'
  set :max_kept_backups,        30
  set :mysql_params,            YAML::load(File.read('config/database.yml'))['production']
end

Put this in a script (e.g., app/backup.rb).

Don’t forget to set up the public keys, it won’t work with password authentication.

Scheduling

Add a line to your crontab with *crontab -e* to run the script.

Or use whenever :

require 'backuper'

every 12.hours do
  command "script"
end

Credits

© 2009 Aurélien Malisart aurelien.malisart.be

This is open source software released under GNU GPLv3 license. www.gnu.org/copyleft/gpl.html