server_backups 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/server_backup +6 -1
- 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: b2ff23a2f12db5a71c6743746acc226ab8058703
|
4
|
+
data.tar.gz: 7610fbae4b7f65e72cefbff8bdf9fd1946dc4b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7151788f1f5a94e01c237bb2138ff216916e0a3b1bc7f19149d10cb1be99c8b56a13c658d9e7368233e73e4f4d3edca7dba9aa883c9cbda50fe5ff6d51a47e8
|
7
|
+
data.tar.gz: 8b0639900e4bd58b1218717574b1b2002ed6325f8d598976523cd3ab91538f95f281218fc8b3733bbae4ae18a3ad04c91936cb0cfb02ea981b0104714985f0a6
|
data/Gemfile.lock
CHANGED
data/bin/server_backup
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require 'fileutils'
|
5
|
+
|
4
6
|
lib_dir = File.join(File.dirname(__FILE__), '..', 'lib')
|
5
7
|
$LOAD_PATH.unshift lib_dir if File.directory?(lib_dir)
|
6
8
|
|
@@ -18,9 +20,12 @@ ERRORS = []
|
|
18
20
|
def backup_thread
|
19
21
|
Thread.new do
|
20
22
|
begin
|
21
|
-
|
23
|
+
dir = File.join(Dir.getwd, rand.to_s)
|
24
|
+
yield dir
|
22
25
|
rescue StandardError => error
|
23
26
|
ERRORS << error
|
27
|
+
ensure
|
28
|
+
FileUtils.rm_rf dir
|
24
29
|
end
|
25
30
|
end
|
26
31
|
end
|