2 $stderr.sync
= $stdout.sync
= true
8 mfs_opts
= { hosts
: %w(127.0.0.1:7001), domain
: "test" }
10 opts
= OptionParser
.new
do |opts
|
11 opts
.banner
= "Usage: omgdav-sync [options] <uri|path>"
12 opts
.separator
"Examples:"
13 opts
.separator
" omgdav-sync -t 127.0.0.1:7001 -d domain sqlite://foo.db"
15 opts
.on('-t', '--trackers=host1[,host2]', '--hosts=host1[,host2]', Array
,
16 'hostnames/IP addresses of trackers') do |hosts
|
17 mfs_opts
[:hosts] = hosts
19 opts
.on('-d', '--domain=s', 'domain') do |domain
|
20 mfs_opts
[:domain] = domain
26 db
= Sequel
.connect(db
)
27 db
.pragma_set(:synchronous, :off) if db
.respond_to
?(:pragma_set)
28 db
.transaction_mode
= :immediate if db
.respond_to
?(:transaction_mode=)
29 mogc
= MogileFS
::MogileFS.new(mfs_opts
)
31 OMGDAV
::Sync.new(db
, mogc
).sync