]> git.notmuchmail.org Git - notmuch/blob - man/man1/notmuch-dump.1
Merge tag 'debian/0.17-5'
[notmuch] / man / man1 / notmuch-dump.1
1 .TH NOTMUCH-DUMP 1 2013-12-30 "Notmuch 0.17"
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 batch-tag
32
33 The default
34 .B batch-tag
35 dump format is intended to more robust against malformed message-ids
36 and tags containing whitespace or non-\fBascii\fR(7) characters.
37 Each line has the form
38
39 .RS 4
40 .RI "+<" "encoded-tag" "> " "" "+<" "encoded-tag" "> ... -- " "" " id:<" quoted-message-id >
41
42 Tags are hex-encoded by replacing every byte not matching the regex
43 .B [A-Za-z0-9@=.,_+-]
44 with
45 .B %nn
46 where nn is the two digit hex encoding.  The message ID is a valid Xapian
47 query, quoted using Xapian boolean term quoting rules: if the ID contains
48 whitespace or a close paren or starts with a double quote, it must be
49 enclosed in double quotes and double quotes inside the ID must be doubled.
50 The astute reader will notice this is a special case of the batch input
51 format for \fBnotmuch-tag\fR(1); note that the single message-id query is
52 mandatory for \fBnotmuch-restore\fR(1).
53
54 .RE
55 .RE
56
57 .RS 4
58 .TP 4
59 .B sup
60
61 The
62 .B sup
63 dump file format is specifically chosen to be
64 compatible with the format of files produced by sup-dump.
65 So if you've previously been using sup for mail, then the
66 .B "notmuch restore"
67 command provides you a way to import all of your tags (or labels as
68 sup calls them).
69 Each line has the following form
70
71 .RS 4
72 .RI < message-id >
73 .B (
74 .RI < tag "> ..."
75 .B )
76
77 with zero or more tags are separated by spaces. Note that (malformed)
78 message-ids may contain arbitrary non-null characters. Note also
79 that tags with spaces will not be correctly restored with this format.
80
81 .RE
82
83 .RE
84
85
86 With no search terms, a dump of all messages in the database will be
87 generated.  A "--" argument instructs notmuch that the
88 remaining arguments are search terms.
89
90 See \fBnotmuch-search-terms\fR(7)
91 for details of the supported syntax for <search-terms>.
92
93 .RE
94 .SH SEE ALSO
95
96 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
97 \fBnotmuch-hooks\fR(5), \fBnotmuch-insert\fR(1), \fBnotmuch-new\fR(1),
98 \fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1), \fBnotmuch-search\fR(1),
99 \fBnotmuch-search-terms\fR(7), \fBnotmuch-show\fR(1),
100 \fBnotmuch-tag\fR(1)