s3backup 0.8.5 → 0.8.6

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.
data/History.txt CHANGED
@@ -62,3 +62,7 @@ gem install sqlite3
62
62
  === 0.8.5 2010-02-15
63
63
  * mod bug if symbolic link was differed before, backup is failed.
64
64
  * tar command output information level.
65
+
66
+ === 0.8.6 2010-02-17
67
+ * add GC.start each directory send.
68
+ * change resume timing to each 10 send times. before each 10 directory
data/lib/s3backup.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
  module S3backup
4
- VERSION = '0.8.5'
4
+ VERSION = '0.8.6'
5
5
  end
@@ -23,6 +23,7 @@ module S3backup
23
23
  @target = target
24
24
  @resume = false
25
25
  @temporary = "/tmp"
26
+ @resume_counter = 0
26
27
  set_config(config)
27
28
  end
28
29
  def set_config(config)
@@ -177,6 +178,7 @@ module S3backup
177
178
  end
178
179
  @target.post(key_name,data)
179
180
  i+=1
181
+ @resume_counter += 1
180
182
  end
181
183
  rescue EOFError
182
184
  end
@@ -221,20 +223,20 @@ module S3backup
221
223
  end
222
224
  data = nil;
223
225
  GC.start
224
- cnt=0
225
226
  #前回と今回のファイル・ツリーを比較
226
227
  tree_info.modify(old_tree) do |dir_info|
227
- cnt+=1
228
228
  S3log.debug("diff_info=#{dir_info[:name]}")
229
229
  #更新されたディレクトリをアップロード
230
230
  store_directory(dir_info[:name])
231
231
  #前回のファイル・ツリー情報のうち、今回アップデートしたディレクトリ情報ファイル情報を更新
232
232
  old_dir_map = old_tree.update_dir(dir_info)
233
- if cnt != 0 and cnt % 10 == 0
233
+ if @resume_counter >= 10
234
234
  #更新したファイル・ツリー情報をアップロード(途中で失敗しても、resumeできるようにするため。)
235
235
  to_gz(old_tree.db_name,true)
236
236
  @target.post(target_db_name,File.read(old_tree.db_name + ".gz"))
237
+ @resume_counter = 0
237
238
  end
239
+ GC.start
238
240
  end
239
241
  tree_info.remove(old_tree) do |dir_info|
240
242
  delete_direcory(dir_info[:name])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takeshi Morita
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-15 00:00:00 +09:00
12
+ date: 2010-02-17 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency