heroku_cloud_backup 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Jack Chu
1
+ Copyright (c) 2011 Jack Chu
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # Heroku Cloud Backup
2
+
3
+ The `heroku_cloud_backup` gem adds a rake task to your project that will take backups stored with Heroku's [PGBackup addon](http://devcenter.heroku.com/articles/pgbackups) and upload them to the cloud.
4
+
5
+ ## Installation
6
+
7
+ It's recommended that you use this gem in conjunction with the [heroku_backup_task](https://github.com/joemsak/heroku_backup_task) gem. heroku_backup_task adds a rake tasks that will create a fresh database capture and expire the oldest backup if you're at your capture limit.
8
+
9
+ First, you need to enable the Heroku PGBackups addon:
10
+
11
+ heroku addons:add pgbackups:basic
12
+
13
+ If you want this to run daily, you'll need to enable the Heroku cron addon:
14
+
15
+ heroku addons:add cron:daily
16
+
17
+ For Rails 3.0 and later, add this to your Gemfile:
18
+
19
+ gem 'heroku_backup_task'
20
+ gem 'heroku_cloud_backup'
21
+
22
+ For Rails 2.1 and later, add this to your in your environment.rb:
23
+
24
+ config.gem 'heroku_backup_task'
25
+ config.gem 'heroku_cloud_backup'
26
+
27
+ In your Rakefile:
28
+
29
+ require "heroku_backup_task"
30
+ task :cron do
31
+ HerokuBackupTask.execute
32
+ HerokuCloudBackupTask.execute
33
+ end
34
+
35
+ ## Usage
36
+
37
+ The first thing you'll want to do is configure the addon.
38
+
39
+ HCB_PROVIDERS (aws, rackspace, google) - Add which providers you're using. Accepts a comma delimited value with each provider so you can store backups in more than 1 provider. **Required**
40
+
41
+ heroku config:add HCB_PROVIDERS='aws' # or 'aws, google, rackspace'
42
+
43
+ HCB_BUCKET (Defaults to "[APP NAME]-heroku-backups") - Select a bucket name to upload to. This the bucket or root directory that your files will be stored in. **Optional**
44
+
45
+ heroku config:add HCB_BUCKET='mywebsite'
46
+
47
+ HCB_PREFIX (Defaults to "db") - The direction prefix for where the backups are stored. This is so you can store your backups within a specific sub directory within the bucket. **Optional**
48
+
49
+ heroku config:add HCB_PREFIX='backups/pg'
50
+
51
+ HCB_MAX_BACKUPS (Defaults to no limit) - The number of backups to store before the script will prune out older backups. A value of 10 will allow you to store 10 of the most recent backups. Newer backups will replace older ones. **Optional**
52
+
53
+ heroku config:add HCB_MAX_BACKUPS=10
54
+
55
+ Depending on which providers you specify, you'll need to provide login credentials.
56
+
57
+ Currently, only Amazon Web Services is supported.
58
+
59
+ heroku config:add HCB_AWS_ACCESS_KEY_ID="your_access_key"
60
+ heroku config:add HCB_AWS_SECRET_ACCESS_KEY="your_secret"
61
+
62
+ You can run this manually like this:
63
+
64
+ rake heroku_backup
65
+ rake heroku:cloud_backup
66
+
67
+ ## Note on Patches/Pull Requests
68
+
69
+ * Fork the project.
70
+ * Make your feature addition or bug fix.
71
+ * Add tests for it. This is important so I don't break it in a
72
+ future version unintentionally.
73
+ * Commit, do not mess with rakefile, version, or history.
74
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
75
+ * Send me a pull request. Bonus points for topic branches.
76
+
77
+ ### Copyright
78
+
79
+ Copyright (c) 2011 Jack Chu. See LICENSE for details.
@@ -2,7 +2,7 @@ require 'heroku_cloud_backup'
2
2
 
3
3
  namespace :heroku do
4
4
  desc "Example showing PostgreSQL database backups from Heroku to Amazon S3"
5
- task :backup => :environment do
5
+ task :cloud_backup => :environment do
6
6
  HerokuCloudBackup.execute
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module HerokuCloudBackup
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: heroku_cloud_backup
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jack Chu
@@ -47,7 +47,7 @@ files:
47
47
  - .gitignore
48
48
  - Gemfile
49
49
  - LICENSE
50
- - README.rdoc
50
+ - README.md
51
51
  - Rakefile
52
52
  - heroku_cloud_backup.gemspec
53
53
  - lib/heroku_cloud_backup.rb
data/README.rdoc DELETED
@@ -1,17 +0,0 @@
1
- = heroku_cloud_backup
2
-
3
- Description goes here.
4
-
5
- == Note on Patches/Pull Requests
6
-
7
- * Fork the project.
8
- * Make your feature addition or bug fix.
9
- * Add tests for it. This is important so I don't break it in a
10
- future version unintentionally.
11
- * Commit, do not mess with rakefile, version, or history.
12
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
- * Send me a pull request. Bonus points for topic branches.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2010 Jack Chu. See LICENSE for details.