README.markdown in astrails-safe-0.2.7 vs README.markdown in astrails-safe-0.3.0

- old
+ new

@@ -1,15 +1,17 @@ -astrails-safe -============= +# astrails-safe Simple database and filesystem backups with S3 and Rackspace Cloud Files support (with optional encryption) -Home: http://blog.astrails.com/astrails-safe +* Home: [http://astrails.com/opensource/astrails-safe](http://astrails.com/opensource/astrails-safe) +* Code: [http://github.com/astrails/safe](http://github.com/astrails/safe) +* Blog: [http://blog.astrails.com/astrails-safe](http://blog.astrails.com/astrails-safe) -Motivation ----------- +[![Code Climate](https://codeclimate.com/github/astrails/safe.png)](https://codeclimate.com/github/astrails/safe) +## Motivation + We needed a backup solution that will satisfy the following requirements: * opensource * simple to install and configure * support for simple ‘tar’ backups of directories (with includes/excludes) @@ -18,51 +20,46 @@ * support for local filesystem, Amazon S3, and Rackspace Cloud Files for storage * support for backup rotation. we don’t want backups filling all the diskspace or cost a fortune on S3 or Cloud Files And since we didn't find any, we wrote our own :) -Contributions -------------- +## Contributions The following functionality was contributed by astrails-safe users: -* PostgreSQL dump using pg_dump (by Mark Mansour <mark@stateofflux.com>) +* PostgreSQL dump using `pg_dump` (by Mark Mansour <mark@stateofflux.com>) * Subversion dump using svndump (by Richard Luther <richard.luther@gmail.com>) * SFTP remote storage (by Adam <adam@mediadrive.ca>) * benchmarking output (By Neer) * README fixes (by Bobby Wilson) * improved config file parsing (by Fedor Kocherga <fkocherga@gmail.com>) * mysql password file quoting (by Jonathan Sutherland <jonathan.sutherland@gmail.com>) * Rackspace Cloud Files support (by H. Wade Minter <minter@lunenburg.org>) Thanks to all :) -Installation ------------- +## Installation sudo gem install astrails-safe --source http://gemcutter.org -Reporting problems ------------------- +## Reporting problems Please report problems at the [Issues tracker](http://github.com/astrails/safe/issues) -Usage ------ +## Usage Usage: astrails-safe [OPTIONS] CONFIG_FILE Options: -h, --help This help screen -v, --verbose be verbose, duh! -n, --dry-run just pretend, don't do anything. -L, --local skip remote storage, only do local backups -Note: CONFIG_FILE will be created from template if missing +Note: CONFIG\_FILE will be created from template if missing -Encryption ----------- +## Encryption If you want to encrypt your backups you have 2 options: * use simple password encryption * use GPG public key encryption @@ -90,28 +87,27 @@ 1. run 'gpg --gen-key' on your local machine and follow onscreen instructions to create the key (you can accept all the defaults). 2. extract your public key into a file (assuming you used test@example.com as your key email): - gpg -a --export test@example.com > test@example.com.pub + `gpg -a --export test@example.com > test@example.com.pub` 3. transfer public key to the server - scp test@example.com.pub root@example.com: + `scp test@example.com.pub root@example.com:` 4. import public key on the remote system: -<pre> - $ gpg --import test@example.com.pub - gpg: key 45CA9403: public key "Test Backup <test@example.com>" imported - gpg: Total number processed: 1 - gpg: imported: 1 -</pre> + $ gpg --import test@example.com.pub + gpg: key 45CA9403: public key "Test Backup <test@example.com>" imported + gpg: Total number processed: 1 + gpg: imported: 1 + 5. since we don't keep the secret part of the key on the remote server, gpg has no way to know its yours and can be trusted. To fix that we can sign it with other trusted key, or just directly modify its trust level in gpg (use level 5): - <pre> + $ gpg --edit-key test@example.com ... Command> trust ... 1 = I don't know or won't say @@ -122,121 +118,120 @@ m = back to the main menu Your decision? 5 ... Command> quit - </pre> 6. export your secret key for backup (we recommend to print it on paper and burn to a CD/DVD and store in a safe place): - <pre> - $ gpg -a --export-secret-key test@example.com > test@example.com.key - </pre> + $ gpg -a --export-secret-key test@example.com > test@example.com.key -Example configuration ---------------------- -<pre> - safe do - local :path => "/backup/:kind/:id" - s3 do - key "...................." - secret "........................................" - bucket "backup.astrails.com" - path "servers/alpha/:kind/:id" - end - cloudfiles do - username "..........." - api_key "................................." - container "safe_backup" - path ":kind/" # this is default - service_net false - end +## Example configuration - sftp do - host "sftp.astrails.com" - user "astrails" - # port 8023 - password "ssh password for sftp" - end + safe do + local :path => "/backup/:kind/:id" - gpg do - command "/usr/local/bin/gpg" - options "--no-use-agent" - # symmetric encryption key - # password "qwe" + s3 do + key "...................." + secret "........................................" + bucket "backup.astrails.com" + path "servers/alpha/:kind/:id" + end - # public GPG key (must be known to GPG, i.e. be on the keyring) - key "backup@astrails.com" - end + cloudfiles do + user "..........." + api_key "................................." + container "safe_backup" + path ":kind/" # this is default + service_net false + end - keep do - local 20 - s3 100 - cloudfiles 100 - sftp 100 - end + sftp do + host "sftp.astrails.com" + user "astrails" + # port 8023 + password "ssh password for sftp" + end - mysqldump do - options "-ceKq --single-transaction --create-options" + gpg do + command "/usr/local/bin/gpg" + options "--no-use-agent" + # symmetric encryption key + # password "qwe" - user "root" - password "............" - socket "/var/run/mysqld/mysqld.sock" + # public GPG key (must be known to GPG, i.e. be on the keyring) + key "backup@astrails.com" + end - database :blog - database :servershape - database :astrails_com - database :secret_project_com do - skip_tables "foo" - skip_tables ["bar", "baz"] + keep do + local 20 + s3 100 + cloudfiles 100 + sftp 100 end - end + mysqldump do + options "-ceKq --single-transaction --create-options" - svndump do - repo :my_repo do - repo_path "/home/svn/my_repo" - end - end + user "root" + password "............" + socket "/var/run/mysqld/mysqld.sock" - pgdump do - options "-i -x -O" # -i => ignore version, -x => do not dump privileges (grant/revoke), -O => skip restoration of object ownership in plain text format + database :blog + database :servershape + database :astrails_com + database :secret_project_com do + skip_tables "foo" + skip_tables ["bar", "baz"] + end - user "username" - password "............" # shouldn't be used, instead setup ident. Current functionality exports a password env to the shell which pg_dump uses - untested! + end - database :blog - database :stateofflux_com - end + svndump do + repo :my_repo do + repo_path "/home/svn/my_repo" + end + end - tar do - options "-h" # dereference symlinks - archive "git-repositories", :files => "/home/git/repositories" - archive "dot-configs", :files => "/home/*/.[^.]*" - archive "etc", :files => "/etc", :exclude => "/etc/puppet/other" + pgdump do + options "-i -x -O" # -i => ignore version, -x => do not dump privileges (grant/revoke), -O => skip restoration of object ownership in plain text format - archive "blog-astrails-com" do - files "/var/www/blog.astrails.com/" - exclude "/var/www/blog.astrails.com/log" - exclude "/var/www/blog.astrails.com/tmp" + user "username" + password "............" # shouldn't be used, instead setup ident. Current functionality exports a password env to the shell which pg_dump uses - untested! + + database :blog + database :stateofflux_com end - archive "astrails-com" do - files "/var/www/astrails.com/" - exclude ["/var/www/astrails.com/log", "/var/www/astrails.com/tmp"] + tar do + options "-h" # dereference symlinks + archive "git-repositories", :files => "/home/git/repositories" + archive "dot-configs", :files => "/home/*/.[^.]*" + archive "etc", :files => "/etc", :exclude => "/etc/puppet/other" + + archive "blog-astrails-com" do + files "/var/www/blog.astrails.com/" + exclude "/var/www/blog.astrails.com/log" + exclude "/var/www/blog.astrails.com/tmp" + end + + archive "astrails-com" do + files "/var/www/astrails.com/" + exclude ["/var/www/astrails.com/log", "/var/www/astrails.com/tmp"] + end end end - end -</pre> -Reporting problems ------------------- +## Contributing -http://github.com/astrails/safe/issues +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request -Copyright ---------- +## Copyright -Copyright (c) 2009 Astrails Ltd. See LICENSE for details. +Copyright (c) 2010 Astrails Ltd. See LICENSE.txt for details.