backup2s3 0.4.2.pre → 0.4.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/backup2s3.rb +1 -1
- data/lib/db_adapters/mysql_adapter.rb +4 -0
- data/lib/db_adapters/postgresql_adapter.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36041043eb3ba624bd28f457b85e96fb61b4ef3d
|
4
|
+
data.tar.gz: 8a7ff25bdb6ba1d8239af24e36088d4859a021b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a06f860c82ace6add1ae131b8a49d3c1bbb55f1466d28904663c2c15e560ca7558d9d638fb3389f54013240f6246d5dcdc1a7be258e4fe5b2c26ed574a0f110
|
7
|
+
data.tar.gz: 499d3121ab0fb1094b9062fc081ee040ec8694ab9610151db003131541d98a0fd87acc0425f33cdb03d68646bebfe23de3a28e46b9e5df507e78b3419a63b464
|
data/lib/backup2s3.rb
CHANGED
@@ -63,7 +63,7 @@ class Backup2s3
|
|
63
63
|
# information.
|
64
64
|
def create_backup(comment)
|
65
65
|
if @conf[:backups][:backup_database]
|
66
|
-
@database_file = System.clean("#{@time}-#{System.db_credentials['database']}-database") <<
|
66
|
+
@database_file = System.clean("#{@time}-#{System.db_credentials['database']}-database") << @db_adapter.backup_extension
|
67
67
|
print "\nDumping database..."
|
68
68
|
database_temp = @db_adapter.db_dump
|
69
69
|
puts "\ndone\n- Database dump file size: " << database_temp.size.to_s << " B"; print "Backing up database dump file..."
|
@@ -22,12 +22,15 @@ class PostgresqlAdapter
|
|
22
22
|
host = @db_credentials['host'] || 'localhost'
|
23
23
|
superuser = System.prompt "Postgres superuser: "
|
24
24
|
su_password = System.prompt "#{superuser} password: "
|
25
|
-
cmd = "PGPASSWORD=\"#{su_password}\"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"pg_restore --host #{host} -Ft --dbname=#{database} #{dump_file.path}"
|
25
|
+
cmd = "PGPASSWORD=\"#{su_password}\" PGUSER=\"#{superuser}\" dropdb --host #{host} #{database} && " +
|
26
|
+
"PGPASSWORD=\"#{su_password}\" PGUSER=\"#{superuser}\" createdb --host #{host} -T template0 #{database} && " +
|
27
|
+
"PGPASSWORD=\"#{su_password}\" PGUSER=\"#{superuser}\" pg_restore --host #{host} -Ft --dbname=#{database} #{dump_file.path}"
|
29
28
|
System.run(cmd)
|
30
29
|
end
|
31
30
|
|
31
|
+
def backup_extension
|
32
|
+
return ".tar"
|
33
|
+
end
|
34
|
+
|
32
35
|
end
|
33
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup2s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aric Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|