server_backups 0.1.20 → 0.1.21
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 +4 -4
- data/Gemfile.lock +1 -1
- data/bin/server_backup +19 -15
- data/lib/server_backups/version.rb +1 -1
- 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: 6bbe471e2cac24b388fe6d97450da0c42e7c93be
|
4
|
+
data.tar.gz: 87e672ccfa51e7a03f07e18431661db750df9c26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c247e3be593ae9538a1ad28c8ebfa46c5140e07e76c3d345bea9006a65f2b817f70c091eb1e6f97616d42c77f88ec800813028393490849c636c258b14e4d4c
|
7
|
+
data.tar.gz: 53c9860952db72da8c98d0be71e58b72d9b6e1138cc9aee2625f8b1fd81de34b381c7494d8fb93dcf2516ff71cbc7fd9d92ce7a589f490c8588ac93488bdf1bd
|
data/Gemfile.lock
CHANGED
data/bin/server_backup
CHANGED
@@ -46,21 +46,25 @@ def handle_errors(config_path)
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def run_backups(backup_type, config_file, database, db_only, files_only)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
begin
|
50
|
+
tmp_dir = File.join(Dir.getwd, rand.to_s)
|
51
|
+
FileUtils.mkdir_p tmp_dir
|
52
|
+
unless db_only
|
53
|
+
ServerBackups::WebsiteBackup.new(config_file,
|
54
|
+
tmp_dir, backup_type).do_backup
|
55
|
+
end
|
56
|
+
unless files_only
|
57
|
+
ServerBackups::MysqlBackup.send(backup_type,
|
58
|
+
config_file,
|
59
|
+
tmp_dir, database).do_backup
|
60
|
+
end
|
61
|
+
rescue StandardError => error
|
62
|
+
puts error.message
|
63
|
+
puts "\n\n " + error.backtrace.join("\n ")
|
64
|
+
exit(2)
|
65
|
+
ensure
|
66
|
+
FileUtils.rm_rf tmp_dir
|
67
|
+
end
|
64
68
|
exit_success!
|
65
69
|
end
|
66
70
|
|