pgbackups_s3 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f3e02a429a4865906ce2a2c7e71536b37c4b56f
4
- data.tar.gz: 466bf011cb825f7629652cda050b3efb0e401e07
3
+ metadata.gz: c319d7e73ee0cbd5e4fe2cf6bc7622d3b2d1d7f4
4
+ data.tar.gz: e1b293fde436f534da3259428fb2256df7a106ae
5
5
  SHA512:
6
- metadata.gz: 2c6e95c5016df6f82d50cd021e8296cf4f58fe15f7364e658ddebeb3d3f76b21ec060cace318ca37317de5c0e5308d710286275494242bc7cd4cfc205fcf01a3
7
- data.tar.gz: 945f6f695848976b0c471a3e039041f47a2550568c1f21c5fb1ace1fe7966a8fbfe14ce9827d5a9af45a0132feb9416b1c37af5219d8985e2e171c845a413277
6
+ metadata.gz: 1e9a3d682dcba23caa5b6088d63aac054b408a4d9a150f3b7633550972fe1639575eea025842cdb6f959b98461df40fe0327dbbea059bc2ce012b121b4abe8db
7
+ data.tar.gz: 52d14d88344fee1d8889e0b69fa2e5f78531c03ba49f6e60af8dfc5b07169f2ee8c521dc7fb5dfed6dec4f8b4b5c9ecc722cb0b2ff071159a8ce3cd89dca3ddb
data/README.md CHANGED
@@ -46,6 +46,38 @@ To specify a specific day of backups, run:
46
46
 
47
47
  `PgbackupsS3.list_backups(YEAR, MONTH, DAY)`
48
48
 
49
- This command will print out the keys of all the backups
49
+ This command will print out the keys of all the backups like so:
50
50
 
51
- ###
51
+ <pre><code>Backups for 7-25-2014 -----------------------
52
+ -- backups/2014/7/25/21:16:14.dump
53
+ -- backups/2014/7/25/21:17:52.dump
54
+ -- backups/2014/7/25/21:19:00.dump
55
+ -- backups/2014/7/25/21:19:43.dump
56
+ -- backups/2014/7/25/21:20:22.dump
57
+ -- backups/2014/7/25/21:21:32.dump
58
+ -- backups/2014/7/25/21:22:13.dump
59
+ </code></pre>
60
+
61
+ ### To restore from a backup
62
+
63
+ WARNING: This will wipe out all data in your specified restore database, 'DATABASE_URL' is the default, with the backup.
64
+
65
+ Take one of the above keys and enter it as the param for the following function
66
+
67
+ `PgbackupsS3.restore('backups/2014/7/25/21:22:13.dump')`
68
+
69
+ You will have to confirm the restore but the database specified will be overwritten with your backup data.
70
+
71
+ ## Contributions
72
+
73
+ Feel free to contribute or improve the code. Just fork the repo and open a pull request with you code. Also if you there are any issues just go ahead and create a new issue.
74
+
75
+ ## License
76
+
77
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
78
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
79
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
80
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
82
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
83
+ THE SOFTWARE.
@@ -77,7 +77,10 @@ class PgbackupsS3
77
77
  def send_to_s3
78
78
  print "Shipping that sucka to S3\t"
79
79
  key = File.basename(@tmp_file)
80
- @s3.buckets[@bucket].objects["#{@directories}/#{Date.today.year}/#{Date.today.month}/#{Date.today.day}/#{key}"].write(:file => @tmp_file)
80
+ object = @s3.buckets[@bucket]
81
+ .objects["#{@directories}/#{Date.today.year}/#{Date.today.month}/#{Date.today.day}/#{key}"]
82
+ .write(:file => @tmp_file)
83
+ object.acl = :private
81
84
  puts "Backup uploaded to #{@bucket} bucket."
82
85
  end
83
86
 
data/pgbackups_s3.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'pgbackups_s3'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.date = '2014-07-25'
5
5
  s.summary = %w{Send pgbackups to S3 using aws_sdk}
6
6
  s.description = %w{Send pgbackups to S3 using aws_sdk. This gem also allows
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbackups_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Leonard