server_backups 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55cf8d25682ff8ed9109cbba146d0bc6c401e793
4
- data.tar.gz: 6d813fc1f41d21306be76c81b3d2ca2abb9e7099
3
+ metadata.gz: 6bbe471e2cac24b388fe6d97450da0c42e7c93be
4
+ data.tar.gz: 87e672ccfa51e7a03f07e18431661db750df9c26
5
5
  SHA512:
6
- metadata.gz: 91ba5f8c8abe776d465dd2295c8d35168bb3c557274e10d1ef53a60946456a1fa72410d0e6b35b7427c7d7d038800de35cf8f751dd849a7416668fe619a89417
7
- data.tar.gz: 5a6c5870270b33264082455d92874cf76519a1297a37d6678b4a4d417e1ae3d5cdd3c1d76113fdb8319acf698c8de168c341faa22e8b4b685a9088e149750ab7
6
+ metadata.gz: 3c247e3be593ae9538a1ad28c8ebfa46c5140e07e76c3d345bea9006a65f2b817f70c091eb1e6f97616d42c77f88ec800813028393490849c636c258b14e4d4c
7
+ data.tar.gz: 53c9860952db72da8c98d0be71e58b72d9b6e1138cc9aee2625f8b1fd81de34b381c7494d8fb93dcf2516ff71cbc7fd9d92ce7a589f490c8588ac93488bdf1bd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- server_backups (0.1.20)
4
+ server_backups (0.1.21)
5
5
  activesupport (~> 5.1)
6
6
  aws-sdk-s3 (~> 1.8)
7
7
  main (~> 6.2)
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
- website_backup = unless db_only
50
- backup_thread do |tmp_dir|
51
- ServerBackups::WebsiteBackup.new(config_file,
52
- tmp_dir, backup_type).do_backup
53
- end
54
- end
55
- database_backup = unless files_only
56
- backup_thread do |tmp_dir|
57
- ServerBackups::MysqlBackup.send(backup_type,
58
- config_file,
59
- tmp_dir, database).do_backup
60
- end
61
- end
62
- [website_backup, database_backup].compact.each(&:join)
63
- handle_errors(config_file)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ServerBackups
4
- VERSION = '0.1.20'
4
+ VERSION = '0.1.21'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server_backups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Gannon