backuper 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +2 -0
  2. data/VERSION +1 -1
  3. data/lib/backuper.rb +4 -4
  4. metadata +4 -4
@@ -17,6 +17,8 @@ Configure and run the backup :
17
17
  set :max_kept_backups, 30
18
18
  set :mysql_params, YAML::load(File.read('config/database.yml'))['production']
19
19
  end
20
+
21
+ No trailing slashes anywhere. The path in *remote_backup_ssh_info* must be the parent directory where different backups are stored (other applications).
20
22
 
21
23
  Put this in a script (e.g., *script/backup.rb*) and make it executable (*chmod +x*).
22
24
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.4
1
+ 2.0.5
@@ -23,7 +23,7 @@ class Backuper
23
23
  def perform_files_backup
24
24
  timestamp = "#{Time.now.strftime('%Y-%m-%d-%s')}"
25
25
  local_current_backup_path = "#{local_backup_base_path}/files/#{timestamp}"
26
- local_latest_backup_path = Dir["#{local_backup_base_path}/files/*"].last
26
+ local_latest_backup_path = Dir["#{local_backup_base_path}/files/*"].sort.last
27
27
  system "mkdir -p #{local_current_backup_path}"
28
28
 
29
29
  # Local backup
@@ -38,7 +38,7 @@ class Backuper
38
38
 
39
39
  # Cleanup of old versions
40
40
 
41
- Dir["#{local_backup_base_path}/files/*"].reverse.each_with_index do |backup_version, index|
41
+ Dir["#{local_backup_base_path}/files/*"].sort.reverse.each_with_index do |backup_version, index|
42
42
  if index >= max_kept_backups
43
43
  system "rm -rf #{backup_version}"
44
44
  end
@@ -53,7 +53,7 @@ class Backuper
53
53
 
54
54
  timestamp = "#{Time.now.strftime('%Y-%m-%d-%s')}"
55
55
  local_current_backup_path = "#{local_backup_base_path}/mysql/#{timestamp}.sql"
56
- local_latest_backup_path = Dir["#{local_backup_base_path}/mysql/*.sql"].last
56
+ local_latest_backup_path = Dir["#{local_backup_base_path}/mysql/*.sql"].sort.last
57
57
 
58
58
  unless File.exist?("#{local_backup_base_path}/mysql")
59
59
  system "mkdir #{local_backup_base_path}/mysql"
@@ -66,7 +66,7 @@ class Backuper
66
66
 
67
67
  # Cleanup of old versions
68
68
 
69
- Dir["#{local_backup_base_path}/mysql/*"].reverse.each_with_index do |backup_version, index|
69
+ Dir["#{local_backup_base_path}/mysql/*"].sort.reverse.each_with_index do |backup_version, index|
70
70
  if index >= max_kept_backups
71
71
  system "rm -rf #{backup_version}"
72
72
  end
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: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 4
10
- version: 2.0.4
9
+ - 5
10
+ version: 2.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Aur\xC3\xA9lien Malisart"
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  requirements: []
65
65
 
66
66
  rubyforge_project:
67
- rubygems_version: 1.4.1
67
+ rubygems_version: 1.5.3
68
68
  signing_key:
69
69
  specification_version: 3
70
70
  summary: simple server backup tool