]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-dump.rst
dump: support gzipped and atomic output
[notmuch] / doc / man1 / notmuch-dump.rst
1 ============
2 notmuch-dump
3 ============
4
5 SYNOPSIS
6 ========
7
8 **notmuch** **dump** [--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 ``--gzip``
23     Compress the output in a format compatible with **gzip(1)**.
24
25 ``--format=(sup|batch-tag)``
26     Notmuch restore supports two plain text dump formats, both with one
27     message-id per line, followed by a list of tags.
28
29     **batch-tag**
30         The default **batch-tag** dump format is intended to more robust
31         against malformed message-ids and tags containing whitespace or
32         non-\ **ascii(7)** characters. Each line has the form
33
34             +<*encoded-tag*\ > +<*encoded-tag*\ > ... --
35             id:<*quoted-message-id*\ >
36
37         Tags are hex-encoded by replacing every byte not matching the
38         regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is the two
39         digit hex encoding. The message ID is a valid Xapian query,
40         quoted using Xapian boolean term quoting rules: if the ID
41         contains whitespace or a close paren or starts with a double
42         quote, it must be enclosed in double quotes and double quotes
43         inside the ID must be doubled. The astute reader will notice
44         this is a special case of the batch input format for
45         **notmuch-tag(1)**; note that the single message-id query is
46         mandatory for **notmuch-restore(1)**.
47
48     **sup**
49         The **sup** dump file format is specifically chosen to be
50         compatible with the format of files produced by sup-dump. So if
51         you've previously been using sup for mail, then the **notmuch
52         restore** command provides you a way to import all of your tags
53         (or labels as sup calls them). Each line has the following form
54
55             <*message-id*\ > **(** <*tag*\ > ... **)**
56
57         with zero or more tags are separated by spaces. Note that
58         (malformed) message-ids may contain arbitrary non-null
59         characters. Note also that tags with spaces will not be
60         correctly restored with this format.
61
62     With no search terms, a dump of all messages in the database will be
63     generated. A "--" argument instructs notmuch that the remaining
64     arguments are search terms.
65
66     See **notmuch-search-terms(7)** for details of the supported syntax
67     for <search-terms>.
68
69 SEE ALSO
70 ========
71
72 **notmuch(1)**, **notmuch-config(1)**, **notmuch-count(1)**,
73 **notmuch-hooks(5)**, **notmuch-insert(1)**, **notmuch-new(1)**,
74 **notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
75 **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**