sweety_backy 0.0.9 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module SweetyBacky
13
13
  FileUtils.mkdir_p( File.dirname( backup_path ) )
14
14
  tmp_sql_file_path = File.join( Dir::tmpdir, "#{File.basename( backup_path, '.tar.gz' )}" )
15
15
 
16
- database_pass = opts[:database_pass].empty? ? '' : "-p#{opts[:database_pass]}"
16
+ database_pass = opts[:database_pass].empty? ? '' : "-p'#{opts[:database_pass]}'"
17
17
 
18
18
  SweetyBacky::Utils::command( "mysqldump -u#{opts[:database_user]} #{database_pass} #{database_name} > #{tmp_sql_file_path}" )
19
19
  SweetyBacky::Utils::command( "tar -cz --same-permissions --file #{backup_path} --directory #{File.dirname(tmp_sql_file_path)} #{File.basename(tmp_sql_file_path)}" )
@@ -34,10 +34,9 @@ module SweetyBacky
34
34
 
35
35
  [:yearly, :monthly, :weekly, :daily].each do |period|
36
36
  paths_in(
37
- "#{opts[:working_path]}/files/#{SweetyBacky::Utils.namerize( path )}.*.#{period.to_s}.*",
37
+ "#{opts[:working_path]}/files/#{SweetyBacky::Utils.namerize( path )}.*.#{period.to_s}.tar.gz",
38
38
  opts
39
39
  ).sort[0..(-1*(opts[period]+1))].each do |file_path|
40
- SweetyBacky::Utils.log "removing: #{file_path}"
41
40
  remove_path( file_path, opts )
42
41
  end
43
42
  end
@@ -52,10 +51,9 @@ module SweetyBacky
52
51
 
53
52
  [:yearly, :monthly, :weekly, :daily].each do |period|
54
53
  paths_in(
55
- "#{opts[:working_path]}/databases/#{database_name}.*.#{period.to_s}.*",
54
+ "#{opts[:working_path]}/databases/#{database_name}.*.#{period.to_s}.sql.tar.gz",
56
55
  opts
57
56
  ).sort[0..(-1*(opts[period]+1))].each do |file_path|
58
- SweetyBacky::Utils.log "removing: #{file_path}"
59
57
  remove_path( file_path, opts )
60
58
  end
61
59
  end
@@ -72,8 +70,10 @@ module SweetyBacky
72
70
 
73
71
  def self.remove_path( path, opts )
74
72
  if( opts[:storage_system].to_sym == :s3 )
73
+ SweetyBacky::Utils.log "cleaning: removing #{opts[:s3_opts][:bucket]}/#{path}"
75
74
  SweetyBacky::S3.delete( path, opts[:s3_opts] )
76
75
  else
76
+ SweetyBacky::Utils.log "cleaning: removing #{path}"
77
77
  File.delete( path )
78
78
  end
79
79
  end
@@ -1,3 +1,3 @@
1
1
  module SweetyBacky
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -12,7 +12,7 @@ class CommanderS3Test < Test::Unit::TestCase
12
12
  :monthly => 2,
13
13
  :weekly => 3,
14
14
  :daily => 4,
15
- :storage_system => :s3,
15
+ :storage_system => 's3',
16
16
  :s3_opts => {
17
17
  :bucket => 'sweety_backy_test',
18
18
  :path => 'test/path',
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweety_backy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 9
10
- version: 0.0.9
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fernando Guillen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-19 00:00:00 +02:00
18
+ date: 2011-07-20 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency