rbsync 0.0.2 → 0.0.3
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/README.rdoc +6 -6
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/rbsync.gemspec +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -3,36 +3,36 @@
|
|
3
3
|
rbsync is sync files utility
|
4
4
|
== usage
|
5
5
|
=== mirror files
|
6
|
-
|
6
|
+
同期元と同期先を同じにする
|
7
7
|
require 'rbsync'
|
8
8
|
rsync =RbSync.new
|
9
9
|
rsync.sync( "src", "dest" )
|
10
10
|
=== mirror updated only files
|
11
|
-
|
11
|
+
同期先に、同期元と同名のファイルがあったら、更新日時を調べる。新しいモノだけをコピーする.
|
12
12
|
require 'rbsync'
|
13
13
|
rsync =RbSync.new
|
14
14
|
rsync.sync( "src", "dest",{:update=>true} )
|
15
15
|
=== using exclude pattern
|
16
|
-
|
16
|
+
同期先と同期元を同じにする,但し、*.rb / *.log の拡張子は除外する.
|
17
17
|
require 'rbsync'
|
18
18
|
rsync =RbSync.new
|
19
19
|
rsync.sync( "src", "dest",{:excludes=>["*.log","*.bak"]} )
|
20
20
|
==special usage , sync by file cotetets
|
21
21
|
if directory has a same file with different file name. insted of filename , sync file by file hash
|
22
|
-
|
22
|
+
ディレクトリ内のファイル名をうっかり変えてしまったときに使う.ファイル名でなく、ファイルの中身を比較して同期する.
|
23
23
|
require 'rbsync'
|
24
24
|
rsync =RbSync.new
|
25
25
|
rsync.sync( "src", "dest",{:check_hash=>true} )
|
26
26
|
=== directory has very large file ,such as mpeg video
|
27
27
|
checking only head of 1024*1024 bytes to distinguish src / dest files.this is for speed up.
|
28
28
|
FileUtils::cmp is reading whole file. large file will take time.With :hash_limit_size Rbsync read only head of files for comparing.
|
29
|
-
|
29
|
+
巨大なファイルだと,全部読み込むのに時間が掛かるので、先頭1024*1024 バイトを比較してOKとする.写真とかはコレで十分
|
30
30
|
require 'rbsync'
|
31
31
|
rsync =RbSync.new
|
32
32
|
rsync.sync( "src", "dest",{:check_hash=>true,:hash_limit_size=1024*1024} )
|
33
33
|
|
34
34
|
=== sync both updated files
|
35
|
-
|
35
|
+
双方向に同期させたい場合は2回起動する.
|
36
36
|
require 'rbsync'
|
37
37
|
rsync =RbSync.new
|
38
38
|
rsync.updated_file_only = true
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/rbsync.gemspec
CHANGED
metadata
CHANGED