rubypond-s3backup-manager 0.1.3 → 0.1.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.
@@ -18,14 +18,20 @@ module S3BackupManager
18
18
  end
19
19
 
20
20
  def restore_database_from_file(username, database, directory)
21
- system "chown -R #{username} #{directory}"
21
+ system "chown -R #{username} /tmp/#{database}"
22
22
  user_file = "#{directory}/globals.pgsql"
23
23
  system "cd /tmp && sudo -u #{username} psql -f #{user_file} >/dev/null 2>&1"
24
- exit(1) unless $?.success?
24
+ unless $?.success?
25
+ puts "Unable to load in the users"
26
+ exit(1)
27
+ end
25
28
  dump_file = "#{directory}/#{database}.pgsql"
26
29
  recreate_database!(username, database)
27
30
  system "cd /tmp && sudo -u #{username} pg_restore --format=t -d #{database} #{dump_file} >/dev/null 2>&1"
28
- exit(1) unless $?.success?
31
+ unless $?.success?
32
+ puts "Unable to restore database. Did you provide a username that has permission?"
33
+ exit(1)
34
+ end
29
35
  end
30
36
 
31
37
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypond-s3backup-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glenn Gillen