pgbackups-archive 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -18
- data/lib/pgbackups-archive/job.rb +1 -1
- data/lib/pgbackups-archive/storage.rb +7 -1
- data/lib/pgbackups-archive/version.rb +1 -1
- data/test/lib/pgbackups-archive/job_test.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17f8e909b82f674ad68531d9b6b1c9836567fb3a
|
4
|
+
data.tar.gz: 29befbf32307acb76631d57e2d85d5ecd0b2b5e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac7b7d112bed636bc0e702a31e4eafeba75487bba81322bf16d3a55e72e27c389a263b7e24554a3ec47b9fb8200e70565f8c7ae3bcfb51530999f1c89e51d42a
|
7
|
+
data.tar.gz: 43d0e6be014a117f10cd9d7823e44ab91a342f865667a7adafaef735e17ea4c41db9dabab58c4417c741e2e5f786f8ffdb97e1df085a53a59eacaa8bbd85a71b
|
data/README.md
CHANGED
@@ -13,8 +13,7 @@ If you're still using an older version of `pgbackups-archive`, it's time to upgr
|
|
13
13
|
|
14
14
|
Read more about this transition in Heroku's offerings on the Heroku Blog: [PG Backups Levels Up](https://blog.heroku.com/archives/2015/3/11/pgbackups-levels-up)
|
15
15
|
|
16
|
-
Please note that the environment variables that need to be defined have changed with
|
17
|
-
v1.0.0.
|
16
|
+
Please note that the environment variables that need to be defined have changed with v1.0.0.
|
18
17
|
|
19
18
|
## Overview
|
20
19
|
|
@@ -37,7 +36,7 @@ Add the gem to your Gemfile and bundle:
|
|
37
36
|
|
38
37
|
### Install Heroku Scheduler add-on
|
39
38
|
|
40
|
-
heroku addons:
|
39
|
+
heroku addons:create scheduler
|
41
40
|
|
42
41
|
### Setup an AWS IAM user, S3 bucket and policy
|
43
42
|
|
@@ -64,9 +63,13 @@ A good security measure would be to use a dedicated set of AWS credentials with
|
|
64
63
|
|
65
64
|
Then specify `rake pgbackups:archive` as a task you would like to run at any of the available intervals.
|
66
65
|
|
66
|
+
In case you would like to make backups at different intervals simply "protect" a daily task using a bash if-statement, for example to run a task every 1st day in a month:
|
67
|
+
|
68
|
+
if [ "$(date +%d)" = 01 ]; then rake pgbackups:archive; fi
|
69
|
+
|
67
70
|
### Loading the Rake task
|
68
71
|
|
69
|
-
If you're using this gem in a Rails 3 app the rake task will be automatically loaded via a Railtie.
|
72
|
+
If you're using this gem in a Rails 3+ app the rake task will be automatically loaded via a Railtie.
|
70
73
|
|
71
74
|
If you're using this gem with a Rails 2 app, or non-Rails app, add the following to your Rakefile:
|
72
75
|
|
@@ -96,22 +99,25 @@ I shouldn't have to say this, but I will. Your backups are your responsibility.
|
|
96
99
|
|
97
100
|
Many thanks go to the following who have contributed to making this gem even better:
|
98
101
|
|
99
|
-
*
|
100
|
-
* Autoload rake task into Rails 2.x once the gem has been loaded
|
101
|
-
*
|
102
|
-
* Ruby 1.8-compatible hash syntax
|
103
|
-
*
|
104
|
-
* Custom setting for database to backup
|
105
|
-
* Streaming support to handle large backup files
|
106
|
-
*
|
102
|
+
* Robert Bousquet ([@bousquet](https://github.com/bousquet))
|
103
|
+
* Autoload rake task into Rails 2.x once the gem has been loaded
|
104
|
+
* Daniel Morrison ([@danielmorrison](https://github.com/danielmorrison))
|
105
|
+
* Ruby 1.8-compatible hash syntax
|
106
|
+
* Karl Baum ([@kbaum](https://github.com/kbaum))
|
107
|
+
* Custom setting for database to backup
|
108
|
+
* Streaming support to handle large backup files
|
109
|
+
* Conroy Whitney ([@conroywhitney](https://github.com/conroywhitney))
|
107
110
|
* Use S3 server-side encryption by default
|
108
|
-
*
|
109
|
-
* Switch from fog to fog-aws
|
110
|
-
* Gem config improvements
|
111
|
-
*
|
112
|
-
* Fix for reading env var
|
111
|
+
* Chris Gaffney ([@gaffneyc](https://github.com/gaffneyc))
|
112
|
+
* Switch from fog to fog-aws
|
113
|
+
* Gem config improvements
|
114
|
+
* Juraj Masar ([@jurajmasar](https://github.com/jurajmasar))
|
115
|
+
* Fix for reading env var
|
116
|
+
* Cutom multipart chunk size
|
117
|
+
* Jan Stastny ([@jstastny](https://github.com/jstastny))
|
118
|
+
* Custom multipart chunk size
|
113
119
|
|
114
120
|
## License
|
115
121
|
|
116
122
|
* Freely distributable and licensed under the [MIT license](http://kjohnston.mit-license.org/license.html).
|
117
|
-
* Copyright (c) 2012-
|
123
|
+
* Copyright (c) 2012-2016 [Kenny Johnston](https://github.com/kjohnston)
|
@@ -23,7 +23,13 @@ class PgbackupsArchive::Storage
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def store
|
26
|
-
|
26
|
+
options = {:key => @key, :body => @file, :public => false, :encryption => "AES256"}
|
27
|
+
|
28
|
+
if ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"]
|
29
|
+
options.merge!(:multipart_chunk_size => ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"].to_i)
|
30
|
+
end
|
31
|
+
|
32
|
+
bucket.files.create(options)
|
27
33
|
end
|
28
34
|
|
29
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgbackups-archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenny Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heroku
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3.32'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: heroku-api
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.3.23
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.3.23
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: fog-aws
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -215,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
229
|
version: '0'
|
216
230
|
requirements: []
|
217
231
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.
|
232
|
+
rubygems_version: 2.5.1
|
219
233
|
signing_key:
|
220
234
|
specification_version: 4
|
221
235
|
summary: Automates archival of Heroku PGBackups to S3
|