mondupe 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mondupe +1 -1
- data/lib/mondupe.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14039c9391a91da785e7e8b837a23fd7d6eab971
|
4
|
+
data.tar.gz: 585a0cea931df1fc3e5d580e8344c88369c38754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bb20d98cc526259c70aa8dfd8d218ced240a66be6e3c3d6a062d7990306c61bc14a44b6603340c12ff2f5783daa1e2c24b0be8f55314da6f4eea5e6102a5c22
|
7
|
+
data.tar.gz: e0e33aec7535e6400b8f5524b50a6ee54a7381d788583930c831729f7b971447531c5f19168f5e7d4b4a49c95179695eeb8b85d3f2fb022fa505dace4f65ee86
|
data/bin/mondupe
CHANGED
data/lib/mondupe.rb
CHANGED
@@ -121,22 +121,22 @@ class Mondupe
|
|
121
121
|
# TODO - Fail the process if any step fails
|
122
122
|
puts "#{Time.now.to_s} - Dropping existing database"
|
123
123
|
`ssh -i #{ssh_key} #{ssh_user}@#{instance_ip} "echo 'db.dropDatabase()' | mongo cde_production"`
|
124
|
-
if $?.success? then puts "#{Time.now.to_s} - Database drop complete" else
|
124
|
+
if $?.success? then puts "#{Time.now.to_s} - Database drop complete" else abort("Error dropping database") end
|
125
125
|
puts "Extracting database dump archive file..."
|
126
126
|
`ssh -i #{ssh_key} #{ssh_user}@#{instance_ip} "cd #{dump_tmp_path}; tar xf #{dump_file_name}"`
|
127
|
-
if $?.success? then puts "#{Time.now.to_s} - Extraction complete!" else
|
127
|
+
if $?.success? then puts "#{Time.now.to_s} - Extraction complete!" else abort("Error extracting archive") end
|
128
128
|
puts "Restoring Mongo Database from extracted dump: #{File.join(dump_tmp_path, "cde_production")}"
|
129
129
|
`ssh -i #{ssh_key} #{ssh_user}@#{instance_ip} "time mongorestore #{File.join(dump_tmp_path, "cde_production")}"`
|
130
|
-
if $?.success? then puts "#{Time.now.to_s} - Database restore complete!" else
|
130
|
+
if $?.success? then puts "#{Time.now.to_s} - Database restore complete!" else abort("Error restoring databse") end
|
131
131
|
puts "Removing database archive file"
|
132
132
|
`ssh -i #{ssh_key} #{ssh_user}@#{instance_ip} "rm -rf #{File.join(dump_tmp_path, dump_file_name)}"`
|
133
|
-
if $?.success? then puts "#{Time.now.to_s} - Archive removed!" else
|
133
|
+
if $?.success? then puts "#{Time.now.to_s} - Archive removed!" else abort("Error removing archive") end
|
134
134
|
puts "#{Time.now.to_s} - Removing saved searches"
|
135
135
|
`ssh -i #{ssh_key} #{ssh_user}@#{instance_ip} "mongo cde_production --eval \\"db.users.update({save_searches: {$ne: null}}, {$unset: {save_searches: ''}}, {multi: true})\\""`
|
136
|
-
if $?.success? then puts "#{Time.now.to_s} - Saved searches removed" else
|
136
|
+
if $?.success? then puts "#{Time.now.to_s} - Saved searches removed" else abort("Error removing saved searches") end
|
137
137
|
puts "#{Time.now.to_s} - Cleaning up our mess..."
|
138
138
|
`ssh -i #{ssh_key} #{ssh_user}@#{instance_ip} "rm -rf #{File.join(dump_tmp_path, 'cde_production')}"`
|
139
|
-
if $?.success? then puts "#{Time.now.to_s} - Mess cleaned up!" else
|
139
|
+
if $?.success? then puts "#{Time.now.to_s} - Mess cleaned up!" else abort("Error cleaning up after myself...") end
|
140
140
|
end
|
141
141
|
|
142
142
|
def terminate(instance_id)
|