heroku-s3-backup-zinergia 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -15,13 +15,13 @@ class HerokuDatabaseBackupToS3
|
|
15
15
|
db = ENV['DATABASE_URL'].match(/postgres:\/\/([^:]+):([^@]+)@([^\/]+)\/(.+)/)
|
16
16
|
system "PGPASSWORD=#{db[2]} pg_dump -Fc --username=#{db[1]} --host=#{db[3]} #{db[4]} > tmp/#{name}"
|
17
17
|
bucket_name = "#{ENV['APP_NAME']}-heroku-backups"
|
18
|
-
create_bucket_if_it_does_not_exist(bucket_name)
|
19
|
-
|
20
18
|
AWS::S3::Base.establish_connection!(
|
21
19
|
:access_key_id => ENV['s3_access_key_id'],
|
22
20
|
:secret_access_key => ENV['s3_secret_access_key']
|
23
21
|
)
|
24
22
|
|
23
|
+
create_bucket_if_it_does_not_exist(bucket_name)
|
24
|
+
|
25
25
|
AWS::S3::S3Object.store(name, open("tmp/#{name}"),
|
26
26
|
bucket_name,
|
27
27
|
:access => :private)
|