Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

aurels/backuper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

No trailing slashes anywhere. The path in remote_backup_ssh_info must be the parent directory where different backups are stored (other applications). Put this in a script (e.g., script/backup.rb) and make it executable (*chmod +x*).

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 with in your config/schedule.rb :

every 1.day, :at => '4am' do

command “cd #{File.dirname(File.expand_path(__FILE__))} && ruby script/backup.rb” 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

About

Simple unix server backup tool

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages