Adds a source to the Sup source list.
Usage:
- sup-add [options] <source>+
+ sup-add [options] <source uri>+
-where <source>+ is one or more sources.
+where <source uri>+ is one or more source URIs.
For mbox files on local disk, use the form:
+ mbox:<path to mbox file>, or
mbox://<path to mbox file>
-or simply
- <path to mbox file>
For mbox files on remote machines, use the form:
mbox+ssh://<machine name>/<path to mbox file>
imaps://<machine name>/<folder> # secure, arbitrary folder
For Maildir folders, use the form:
+ maildir:<path to Maildir directory>; or
maildir://<path to Maildir directory>
Options are:
index.load
ARGV.each do |uri|
- uri = "mbox://#{uri}" unless uri =~ %r!://!
-
if !$opts[:force_new] && index.source_for(uri)
say "Already know about #{uri}; skipping."
next
sup-sync [options] <source>*
where <source>* is zero or more source URIs. If no sources are given,
-sync from all usual sources.
-
-Supported source URIs:
- mbox://<path to mbox file>, e.g. mbox:///var/spool/mail/me
- maildir://<path to maildir dir>, e.g. maildir:///home/me/Maildir
- mbox+ssh://<machine>/<path to mbox file>
- imap://<machine>/[<folder>]
- imaps://<machine>/[<folder>]
+sync from all usual sources. All supported source URI schemes can
+be seen by running "sup-add --help".
Options controlling WHICH messages sup-sync operates on:
EOS
$stderr.puts "Scanned #{num_scanned}, added #{num_added}, updated #{num_updated} messages from #{source}."
$stderr.puts "Restored state on #{num_restored} (#{100.0 * num_restored / num_scanned}%) messages." if num_restored > 0
end
+rescue Exception => e
+ File.open("sup-exception-log.txt", "w") { |f| f.puts e.backtrace }
+ raise
ensure
index.save
Redwood::finish