= Backup == A Backup Ruby Gem for Rails Backup is a Ruby Gem, written specifically for Ruby on Rails applications. This gem offers a quick and easy way to configure and run backups of your MySQL database (soon PostgreSQL and possibly more) and Archives (any files or folders) to "Amazon S3" or "any remotely accessible server using SCP". Backup handles: Compression, Archiving, Encryption and Backup Cleaning. == Backup just updated to version 2.1.0! This was a major update (read below) and a lot of stuff has changed since version 1.x.x! Notable changes: * Should be a lot more backwards compatible with every update I do. * Does not depend on the separate local SQLite3 file any longer. * Will provide a db migration file for your Rails Application to store backup record data in. * Does not use YAML files to do configuration any longer. * Uses a SINGLE ruby file for "all" configuration (config/backup.rb) using elegant block notations! * Uses a SINGLE rake task to handle the initialization of any backup setting. * Can now configure an unlimited amount of customizable backup settings and run them each "individually"! * HIGHLY IMPROVED USABILITY! == TO ANYONE RUNNING BACKUP VERSION 2.0.0! PLEASE READ! I would like to ask you to install the latest version of Backup, as 2.0.0 has some issues. A few things that were left unchanged in 2.0.0 have been changed in 2.1.0 and I have updated the Wiki page "Getting Started" based on the 2.1.0 release to get everyone up and running! ==== If you have Backup version 2.0.0 installed, please do the following: sudo gem uninstall backup -v 2.0.0 sudo gem install backup And have a quick read through the "Getting Started" Wiki page to see how simple the Backup setup is since 2.1.0! === Refer to the Getting Started page to get up and running incredibly fast with "Backup 2"! http://wiki.github.com/meskyanichi/backup/getting-started ==== 100% Rewrite! This was a 100% rewrite of the gem. So if you discover any issues with it, please report them here so I can fix them as soon as possible! http://github.com/meskyanichi/backup/issues ==== Coded Quickly! I've been going all hardcore on this one, building it in a very small amount of time compared to the first version. As far as I can see it fully works, but it is of course likely that you or anyone else might encounter some issues. Please report them if you do. ==== Updated The Wiki Quickly! So when I finished crafting the Backup Gem, I immediately started working on the Wiki and, as for the gem, updated it very quickly on a late sunday night. I will come back to the Wiki and see if I can improve it even more next weekend when I have more time. I just wanted to get the essentials built in and I think it worked out pretty nicely regardless. If you have any questions though, don't bother asking! ==== More to come! Yes, Backup currently supports the most used backup adapters: MySQL and Archive(Files, Folders). It Archives, Compresses, Encrypts and cleans up old backups if needed. I do have plans for adding the PostgreSQL and Custom adapter for version 2 as well very soon! If there are requests for more/other adapters, I'm all ears! Enjoy. == (Current) Backup's Capabilities More to be added! === Storage Methods - Amazon (S3) - Remote Server (SCP) === Adapters - MySQL - Archive (Any physical files/folders) (More will be added later, such as PostgreSQL and Custom) === Archiving ==== Backup supports Archiving. When you use the Archive adapter to backup a bunch of files and folders, backup will archive and compress these all together. === Encryption ==== Backup supports a simple form of encryption. This is optional. All adapters support encryption. This is very simple to enable. Just add the following method inside on of your backup settings and it will encrypt it with the specified password: encrypt_with_password "mypassword" === Backup Cleaning ==== Backup supports backup cleaning. Backup Cleaning (which is optional) enables you to specify the amount of backups that may be stored on either Amazon S3 or a Remote Server. If you for example tell backup to limit the amount of backups by 20, when the 21st backup gets pushed to the storage location, the oldest version will automatically be destroyed. The idea behind this is to not flood either your backup server, which might resort in possible lack of hard disk space. Another good reason to utilize this would be for Amazon. Although Amazon S3 is extremely cheap, when backing up 1-2GB of MySQL dumps twice a day, it can become quite expensive if you never remove old ones. To enable this you simply call the following method inside the desired "backup setting": keep_backups 20 === Quick Example of a Single Backup Setting inside the Backup Configuration File backup 'mysql-backup-s3' do adapter :mysql do user 'user' password 'password' database 'database' end storage :s3 do access_key_id 'access_key_id' secret_access_key 'secret_access_key' bucket '/bucket/backups/mysql/' end keep_backups 25 encrypt_with_password 'password' end The (backup 'mysql-backup-s3' do) is what I call a "backup setting". The first argument of the block is the so called "trigger". backup 'mysql-backup-s3' do # Configuration Here end This acts as an "identifier" for the "backup setting". The (above) "backup setting" is all pretty straightforward. So now that we've set up a "backup setting", we can run it using a rake task, like so: rake backup:run trigger="mysql-backup-s3" ==== That's it, the MySQL database has been "backed up" to Amazon S3. It has been dumped, compressed and encrypted with password. Note: You can add as many "backup setting" blocks as you want inside the "config/backup.rb" configuration file and invoke each of them by their own "trigger". This means you can have as many backup setups as you want, which "don't" all run simultaneously when you initialize a backup. ==== Runs the backup setting with the trigger "backup-logs" rake backup:run trigger="backup-logs" ==== Runs the backup setting with the trigger "backup-mysql" rake backup:run trigger="backup-mysql" ==== Runs the backup setting with the trigger "backup-assets" rake backup:run trigger="backup-assets" etc. etc. etc. etc. etc. etc... == Interested in trying out Backup? === Check out the following Wiki pages to get up and running: === Getting started http://wiki.github.com/meskyanichi/backup/getting-started === Backup Configuration File (All Adapters, Storage Methods and Options) http://wiki.github.com/meskyanichi/backup/configuration-file === Rake Tasks http://wiki.github.com/meskyanichi/backup/rake-tasks === Automatic Backups http://wiki.github.com/meskyanichi/backup/automatic-backups === Capistrano Recipes http://wiki.github.com/meskyanichi/backup/capistrano-recipes === Capistrano, Whenever! http://wiki.github.com/meskyanichi/backup/capistrano-whenever === Understanding "The Backup Database" http://wiki.github.com/meskyanichi/backup/the-backup-database === Trouble Shooting http://wiki.github.com/meskyanichi/backup/troubleshooting === Requirements http://wiki.github.com/meskyanichi/backup/requirements === Resources http://wiki.github.com/meskyanichi/backup/resources === Requests If anyone has any requests, please send me a message! === Suggestions? Send me a message! Fork the project! === Found a Bug? http://github.com/meskyanichi/backup/issues === Copyright Copyright (c) 2009 Michael van Rooijen | Final Creation. (http://final-creation.com/) See LICENSE for details.