class SyncJobs
- SyncJobs
- Reference
- Object
Overview
confmgr = ConfigManager.new("sample_config.yaml")
syncjobs = SyncJobs.new(confmgr)
crawl(confmgr.config.crawl_dir) do |batch|
batch.files.each do |f|
syncjobs.add(f)
end
syncjobs.sync
puts syncjobs.summary
# If any hardlinks available then sync it
if batch.hardlinks.size > 0
batch.hardlinks.each do |_, hls|
syncjobs.add(hls)
end
syncjobs.sync
puts syncjobs.summary
end
end
Defined in:
syncjobs.crConstructors
Instance Method Summary
-
#add(entry : String)
Add one entry to a Rsync job then switch to next job
-
#add(entries : Array(String))
Add all entries to single Rsync Job Very useful for syncing Hardlinks To use
-H
or preserve hardlinks options with rsync, all hardlinks should be synced in the same process. - #rsync_job
- #rsync_ssh_opts
- #speed(total_bytes, elapsed_time)
- #summary : Array(JobSummary)
-
#sync
Start N rsync jobs and add the files to each jobs stdin.
Constructor Detail
Instance Method Detail
def add(entries : Array(String))
#
Add all entries to single Rsync Job
Very useful for syncing Hardlinks
To use -H
or preserve hardlinks options with rsync,
all hardlinks should be synced in the same process.
def sync
#
Start N rsync jobs and add the files to each jobs stdin. Once all the jobs are started, wait for the completion and then return response.