pgbackups_s3 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/pgbackups_s3/client.rb +9 -0
- data/lib/tasks/pgbackups_s3.rake +3 -0
- data/pgbackups_s3.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00f0176066e7495a7357c6f77301bf61c418f260
|
4
|
+
data.tar.gz: ad92b069dadfdafa482124f6c221170a646e7f75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb7a1611706d3bc580e8656dda72b3e77bcb0611b703e423f600cfce128beac9ce643ab1b11966598b3e83c5ec7fae643e5c8f3b72e3ca4efdfaa67dd4ce679
|
7
|
+
data.tar.gz: 6f9647f53f6451156e40e401095f60e03cae49ddd9cc07a678ac06cf886ec724332309c736051dcd96efffc7884ed0f17025ec0fb6aa161cd920f517c7713424
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ allows you restore your current database from any of the backups on S3.
|
|
8
8
|
|
9
9
|
To install on your system
|
10
10
|
|
11
|
-
`gem install
|
11
|
+
`gem install pgbackups_s3`
|
12
12
|
|
13
13
|
To install in rails app, add the following line to your Gemfile
|
14
14
|
|
@@ -22,6 +22,12 @@ Then create the initialzer that will hold all the settings for the packups
|
|
22
22
|
|
23
23
|
Go to `config/initializers/pgbackups_s3.rb` and follow the documentation to get your backups cranking!
|
24
24
|
|
25
|
+
After the initializer is all setup, run:
|
26
|
+
|
27
|
+
`rake pgbackups_s3:setup`
|
28
|
+
|
29
|
+
if you need to create the bucket on S3
|
30
|
+
|
25
31
|
## Using the gem
|
26
32
|
|
27
33
|
### Back dat database up
|
@@ -80,4 +86,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
80
86
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
81
87
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
82
88
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
83
|
-
THE SOFTWARE.
|
89
|
+
THE SOFTWARE.
|
data/lib/pgbackups_s3/client.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
class PgbackupsS3
|
2
2
|
include HTTParty
|
3
3
|
|
4
|
+
def self.setup
|
5
|
+
p = new
|
6
|
+
p.create_bucket
|
7
|
+
end
|
4
8
|
|
5
9
|
def self.backup
|
6
10
|
p = new
|
@@ -43,6 +47,11 @@ class PgbackupsS3
|
|
43
47
|
)
|
44
48
|
end
|
45
49
|
|
50
|
+
def create_bucket
|
51
|
+
bucket = @s3.buckets.create(@bucket)
|
52
|
+
bucket.acl = :private
|
53
|
+
end
|
54
|
+
|
46
55
|
def get_latest_backup
|
47
56
|
@backup_url = self.class.get("#{@host}/client/latest_backup")['public_url']
|
48
57
|
end
|
data/lib/tasks/pgbackups_s3.rake
CHANGED
data/pgbackups_s3.gemspec
CHANGED