]> git.cworth.org Git - notmuch/blob - doc/man1/notmuch-dump.rst
doc: cross-reference notmuch man pages with actual links
[notmuch] / doc / man1 / notmuch-dump.rst
1 .. _notmuch-dump(1):
2
3 ============
4 notmuch-dump
5 ============
6
7 SYNOPSIS
8 ========
9
10 **notmuch** **dump** [--gzip] [--format=(batch-tag|sup)] [--output=<*file*>] [--] [<*search-term*> ...]
11
12 DESCRIPTION
13 ===========
14
15 Dump tags for messages matching the given search terms.
16
17 Output is to the given filename, if any, or to stdout.
18
19 These tags are the only data in the notmuch database that can't be
20 recreated from the messages themselves. The output of notmuch dump is
21 therefore the only critical thing to backup (and much more friendly to
22 incremental backup than the native database files.)
23
24 See :any:`notmuch-search-terms(7)` for details of the supported syntax
25 for <search-terms>. With no search terms, a dump of all messages in
26 the database will be generated. A ``--`` argument instructs notmuch that
27 the remaining arguments are search terms.
28
29 Supported options for **dump** include
30
31 ``--gzip``
32     Compress the output in a format compatible with :manpage:`gzip(1)`.
33
34 ``--format=(sup|batch-tag)``
35     Notmuch restore supports two plain text dump formats, both with
36     one message-id per line, followed by a list of tags.
37
38     **batch-tag**
39         The default **batch-tag** dump format is intended to more
40         robust against malformed message-ids and tags containing
41         whitespace or non-\ :manpage:`ascii(7)` characters. Each line
42         has the form::
43
44           +<*encoded-tag*\ > +<*encoded-tag*\ > ... -- id:<*quoted-message-id*\ >
45
46         Tags are hex-encoded by replacing every byte not matching the
47         regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is the two
48         digit hex encoding. The message ID is a valid Xapian query,
49         quoted using Xapian boolean term quoting rules: if the ID
50         contains whitespace or a close paren or starts with a double
51         quote, it must be enclosed in double quotes and double quotes
52         inside the ID must be doubled. The astute reader will notice
53         this is a special case of the batch input format for
54         :any:`notmuch-tag(1)`; note that the single message-id query is
55         mandatory for :any:`notmuch-restore(1)`.
56
57     **sup**
58         The **sup** dump file format is specifically chosen to be
59         compatible with the format of files produced by
60         :manpage:`sup-dump(1)`. So if you've previously been using sup
61         for mail, then the :any:`notmuch-restore(1)` command provides
62         you a way to import all of your tags (or labels as sup calls
63         them). Each line has the following form::
64
65           <*message-id*\ > **(** <*tag*\ > ... **)**
66
67         with zero or more tags are separated by spaces. Note that
68         (malformed) message-ids may contain arbitrary non-null
69         characters. Note also that tags with spaces will not be
70         correctly restored with this format.
71
72 ``--include=(config|properties|tags)``
73     Control what kind of metadata is included in the output.
74
75     **config**
76         Output configuration data stored in the database. Each line
77         starts with "#@ ", followed by a space separated key-value
78         pair.  Both key and value are hex encoded if needed.
79
80     **properties**
81         Output per-message (key,value) metadata.  Each line starts
82         with "#= ", followed by a message id, and a space separated
83         list of key=value pairs.  Ids, keys and values are hex encoded
84         if needed.  See :any:`notmuch-properties(7)` for more details.
85
86     **tags**
87         Output per-message boolean metadata, namely tags. See *format* above
88         for description of the output.
89
90     The default is to include all available types of data.  The option
91     can be specified multiple times to select some subset. As of
92     version 3 of the dump format, there is a header line of the
93     following form::
94
95       #notmuch-dump <*format*>:<*version*> <*included*>
96
97     where <*included*> is a comma separated list of the above options.
98
99 ``--output=``\ <filename>
100     Write output to given file instead of stdout.
101
102 SEE ALSO
103 ========
104
105 :any:`notmuch(1)`,
106 :any:`notmuch-config(1)`,
107 :any:`notmuch-count(1)`,
108 :any:`notmuch-hooks(5)`,
109 :any:`notmuch-insert(1)`,
110 :any:`notmuch-new(1)`,
111 :any:`notmuch-properties(7)`,
112 :any:`notmuch-reply(1)`,
113 :any:`notmuch-restore(1)`,
114 :any:`notmuch-search(1)`,
115 :any:`notmuch-search-terms(7)`,
116 :any:`notmuch-show(1)`,
117 :any:`notmuch-tag(1)`