]> git.notmuchmail.org Git - notmuch/blob - man/man1/notmuch-dump.1
man: reference notmuch-insert.1
[notmuch] / man / man1 / notmuch-dump.1
1 .TH NOTMUCH-DUMP 1 2013-02-17 "Notmuch 0.15.2"
2 .SH NAME
3 notmuch-dump \- creates a plain-text dump of the tags of each message
4
5 .SH SYNOPSIS
6
7 .B "notmuch dump"
8 .RB  [ "\-\-format=(sup|batch-tag)"  "] [--]"
9 .RI "[ --output=<" filename "> ] [--]"
10 .RI "[ <" search-term ">...]"
11
12 .SH DESCRIPTION
13
14 Dump tags for messages matching the given search terms.
15
16 Output is to the given filename, if any, or to stdout.
17
18 These tags are the only data in the notmuch database that can't be
19 recreated from the messages themselves.  The output of notmuch dump is
20 therefore the only critical thing to backup (and much more friendly to
21 incremental backup than the native database files.)
22
23 .TP 4
24 .B \-\-format=(sup|batch-tag)
25
26 Notmuch restore supports two plain text dump formats, both with one message-id
27 per line, followed by a list of tags.
28
29 .RS 4
30 .TP 4
31 .B sup
32
33 The
34 .B sup
35 dump file format is specifically chosen to be
36 compatible with the format of files produced by sup-dump.
37 So if you've previously been using sup for mail, then the
38 .B "notmuch restore"
39 command provides you a way to import all of your tags (or labels as
40 sup calls them).
41 Each line has the following form
42
43 .RS 4
44 .RI < message-id >
45 .B (
46 .RI < tag "> ..."
47 .B )
48
49 with zero or more tags are separated by spaces. Note that (malformed)
50 message-ids may contain arbitrary non-null characters. Note also
51 that tags with spaces will not be correctly restored with this format.
52
53 .RE
54
55 .RE
56 .RS 4
57 .TP 4
58 .B batch-tag
59
60 The
61 .B batch-tag
62 dump format is intended to more robust against malformed message-ids
63 and tags containing whitespace or non-\fBascii\fR(7) characters.
64 Each line has the form
65
66 .RS 4
67 .RI "+<" "encoded-tag" "> " "" "+<" "encoded-tag" "> ... -- " "" " id:<" quoted-message-id >
68
69 Tags are hex-encoded by replacing every byte not matching the regex
70 .B [A-Za-z0-9@=.,_+-]
71 with
72 .B %nn
73 where nn is the two digit hex encoding.  The message ID is a valid Xapian
74 query, quoted using Xapian boolean term quoting rules: if the ID contains
75 whitespace or a close paren or starts with a double quote, it must be
76 enclosed in double quotes and double quotes inside the ID must be doubled.
77 The astute reader will notice this is a special case of the batch input
78 format for \fBnotmuch-tag\fR(1); note that the single message-id query is
79 mandatory for \fBnotmuch-restore\fR(1).
80
81 .RE
82
83
84 With no search terms, a dump of all messages in the database will be
85 generated.  A "--" argument instructs notmuch that the
86 remaining arguments are search terms.
87
88 See \fBnotmuch-search-terms\fR(7)
89 for details of the supported syntax for <search-terms>.
90
91 .RE
92 .SH SEE ALSO
93
94 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
95 \fBnotmuch-hooks\fR(5), \fBnotmuch-insert\fR(1), \fBnotmuch-new\fR(1),
96 \fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1), \fBnotmuch-search\fR(1),
97 \fBnotmuch-search-terms\fR(7), \fBnotmuch-show\fR(1),
98 \fBnotmuch-tag\fR(1)