backuper 2.0.1 → 2.0.2

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/backuper.rb +6 -3
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
@@ -21,7 +21,7 @@ class Backuper
21
21
  end
22
22
 
23
23
  def perform_files_backup
24
- timestamp = "#{Time.now.strftime('%Y-%-m-%d-%s')}"
24
+ timestamp = "#{Time.now.strftime('%Y-%m-%d-%s')}"
25
25
  local_current_backup_path = "#{local_backup_base_path}/files/#{timestamp}"
26
26
  local_latest_backup_path = Dir["#{local_backup_base_path}/files/*"].last
27
27
  system "mkdir -p #{local_current_backup_path}"
@@ -46,7 +46,10 @@ class Backuper
46
46
  end
47
47
 
48
48
  def perform_database_backup
49
- return if mysql_params['database'] == '' || !(mysql_params['adapter'] =~ /mysql/)
49
+ if mysql_params == {} mysql_params['database'] == '' || !(mysql_params['adapter'] =~ /mysql/)
50
+ puts "Skipping MySQL backup as no configurtion given"
51
+ return
52
+ end
50
53
 
51
54
  timestamp = "#{Time.now.strftime('%Y-%-m-%d-%s')}"
52
55
  local_current_backup_path = "#{local_backup_base_path}/mysql/#{timestamp}.sql"
@@ -58,7 +61,7 @@ class Backuper
58
61
 
59
62
  # Local backup
60
63
 
61
- puts "Performing local backup of database #{mysql_params['database']} as user #{mysql_params['username']}"
64
+ puts "Performing local backup of database '#{mysql_params['database']}' as user '#{mysql_params['username']}'"
62
65
  system "mysqldump #{mysql_params['database']} --user=#{mysql_params['username']} --password=#{mysql_params['password']} > #{local_current_backup_path}"
63
66
 
64
67
  # Cleanup of old versions
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backuper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 1
10
- version: 2.0.1
9
+ - 2
10
+ version: 2.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Aur\xC3\xA9lien Malisart"