]> git.notmuchmail.org Git - notmuch/blob - man/man1/notmuch-dump.1
notmuch-{dump,restore}.1: document new format options
[notmuch] / man / man1 / notmuch-dump.1
1 .TH NOTMUCH-DUMP 1 2012-08-20 "Notmuch 0.14"
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:<" encoded-message-id >
68
69 where encoded means that every byte not matching the regex
70 .B [A-Za-z0-9@=.,_+-]
71 is replace by
72 .B %nn
73 where nn is the two digit hex encoding.
74 The astute reader will notice this is a special case of the batch input
75 format for \fBnotmuch-tag\fR(1); note that the single message-id query is
76 mandatory for \fBnotmuch-restore\fR(1).
77
78 .RE
79
80
81 With no search terms, a dump of all messages in the database will be
82 generated.  A "--" argument instructs notmuch that the
83 remaining arguments are search terms.
84
85 See \fBnotmuch-search-terms\fR(7)
86 for details of the supported syntax for <search-terms>.
87
88 .RE
89 .SH SEE ALSO
90
91 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
92 \fBnotmuch-hooks\fR(5), \fBnotmuch-new\fR(1), \fBnotmuch-reply\fR(1),
93 \fBnotmuch-restore\fR(1), \fBnotmuch-search\fR(1),
94 \fBnotmuch-search-terms\fR(7), \fBnotmuch-show\fR(1),
95 \fBnotmuch-tag\fR(1)