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