backup2s3 0.4.2.pre → 0.4.3.pre

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: dbe9babacb955bdce764bb078bfbd06e41dab9a3
4
- data.tar.gz: b51bca66befe63ed2533e1e5695a81053fbc1e67
3
+ metadata.gz: 36041043eb3ba624bd28f457b85e96fb61b4ef3d
4
+ data.tar.gz: 8a7ff25bdb6ba1d8239af24e36088d4859a021b0
5
5
  SHA512:
6
- metadata.gz: ab0dae65db967e3b99a5b5c4ad1266bbcd1c5d6bf70134da3e88c91708be4a87b454442dee3e2a5b2a79f8e1cb216ea89bcc169385128cde16bf3c47c982151f
7
- data.tar.gz: 334327c31b23a580a48e72a02c57e18833c543a7c3d6c3ad37c2c29b26659324d0f5f28933d07eac8a7c5fdc48ebc2b4c78732870606b5bd98f4e5998fe54879
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") << ".sql"
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..."
@@ -23,6 +23,10 @@ class MysqlAdapter
23
23
  true
24
24
  end
25
25
 
26
+ def backup_extension
27
+ return ".sql"
28
+ end
29
+
26
30
  private
27
31
 
28
32
  def db_options
@@ -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}\" && PGUSER=\"#{superuser}\"; " +
26
- "dropdb --host #{host} #{database}; " +
27
- "createdb --host #{host} -T template0 #{database}; " +
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.2.pre
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: 2014-12-31 00:00:00.000000000 Z
11
+ date: 2015-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk