pgbackups-archive 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +11 -3
- data/lib/pgbackups-archive/railtie.rb +9 -6
- data/lib/pgbackups-archive/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Install Heroku addons:
|
|
21
21
|
|
22
22
|
heroku addons:add pgbackups:plus
|
23
23
|
heroku addons:add scheduler:standard
|
24
|
-
|
24
|
+
|
25
25
|
Note: You can use paid-for versions of pgbackups if you'd like, however the dev and basic database offerings only support the free (plus) version.
|
26
26
|
|
27
27
|
Apply environment variables:
|
@@ -30,15 +30,23 @@ Apply environment variables:
|
|
30
30
|
heroku config:add PGBACKUPS_AWS_SECRET_ACCESS_KEY="YYY"
|
31
31
|
heroku config:add PGBACKUPS_BUCKET="myapp-backups"
|
32
32
|
heroku config:add PGBACKUPS_REGION="us-west-2"
|
33
|
-
|
33
|
+
|
34
34
|
Note: A good security measure would be to use a dedicated set of AWS credentials with a security policy only allowing access to the bucket you're specifying.
|
35
35
|
|
36
36
|
Add the rake task to scheduler:
|
37
37
|
|
38
38
|
heroku addons:open scheduler
|
39
|
-
|
39
|
+
|
40
40
|
Then specify `rake pgbackups:archive` as a task you would like to run at any of the available intervals.
|
41
41
|
|
42
|
+
## Loading the Rake task
|
43
|
+
|
44
|
+
If you're using this gem in a Rails 3 app the rake task will be automatically loaded via a Railtie.
|
45
|
+
|
46
|
+
If you're using this gem with a Rails 2 app, or non-Rails app, add the following to your Rakefile:
|
47
|
+
|
48
|
+
require "pgbackups-archive"
|
49
|
+
|
42
50
|
## Disclaimer
|
43
51
|
|
44
52
|
I shouldn't have to say this, but I will. Your backups are your responsibility. Take charge of ensuring that they run, archive and can be restored periodically as expected. Don't rely on Heroku, this gem, or anything else out there to substitute for a regimented database backup and restore testing strategy.
|
@@ -1,10 +1,13 @@
|
|
1
1
|
if defined?(Rails)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
if Rails.version < "3"
|
3
|
+
load "tasks/pgbackups_archive.rake"
|
4
|
+
else
|
5
|
+
module PgbackupsArchive
|
6
|
+
class Railtie < Rails::Railtie
|
7
|
+
railtie_name :pgbackups_archive
|
8
|
+
rake_tasks do
|
9
|
+
load "tasks/pgbackups_archive.rake"
|
10
|
+
end
|
8
11
|
end
|
9
12
|
end
|
10
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgbackups-archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|