1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
metastore(1) General Commands Manual metastore(1)
NAME
metastore - stores and restores filesystem metadata
SYNOPSIS
metastore ACTION [OPTION...] [PATH...]
DESCRIPTION
Stores or restores metadata (owner, group, permissions, xattrs and op‐
tionally mtime) for a filesystem tree. This can be used to preserve the
metadata in situations where it is usually not stored (git and tar for
example) or as a tripwire like mechanism to detect any changes to meta‐
data. Note that e.g. SELinux stores its labels in xattrs so care
should be taken when applying stored metadata to make sure that system
security is not compromised.
ACTIONS
-c, --compare
Shows the difference between the stored and real metadata.
-s, --save
Saves the current metadata to ./.metadata or to the specified
file (see --file option below).
-a, --apply
Attempts to apply the stored metadata to the file system.
-d, --dump
Dumps stored (if no PATH is given) or real metadata (if PATH is
present, e.g. ./) in human-readable form.
This action is meant only as a helpful debugging facility or
merge conflict helper. Do not ever compare its output generated
using different metastore version. Do not rely on current output
format (especially in batch scripts), because it may change in
future without prior notice.
-h, --help
Prints a help message and exits.
OPTIONS
-v, --verbose
Causes metastore to print more verbose messages. Can be repeated
more than once for even more verbosity.
-q, --quiet
Causes metastore to print less verbose messages. Can be repeated
more than once for even less verbosity.
-m, --mtime
Causes metastore to take mtime into account for the compare or
apply actions.
-M, --no-mtime
Causes metastore to not take mtime into account for the dump or
save actions.
-e, --empty-dirs
Also attempts to recreate missing empty directories. May be use‐
ful where empty directories are not tracked (e.g. by git or
cvs). Only works in combination with the apply option.
-E, --remove-empty-dirs
Also attempts to remove empty directories missing from the meta‐
data. May be useful where empty directories are not tracked
(e.g. by git or cvs). Only works in combination with the apply
option.
-g, --git
Prevents metastore from omitting .git directories.
-f <file>, --file <file>
Causes the metadata to be saved, read from the specified file
rather than ./.metadata.
-r <foRmat>, --format <foRmat>
Causes the metadata to be saved in format <foRmat>. See FORMATS
below.
PATHS
If no path is specified, metastore will use the current directory as
the basis for the actions. This is the recommended way of executing
metastore. Alternatively, one or more paths can be specified and they
will each be examined. Later invocations should be made using the exact
same paths to ensure that the stored metadata is interpreted correctly.
EXIT STATUS
metastore returns an exit status of 0 on success, or 1 if an error oc‐
curred. If the compare action is selected and differences are found,
the exit status is 2.
FORMATS
0 The original and default format, it is a compact binary repre‐
sentation of the file metadata stored.
1 This format is a tab-separated, line-based text representation
of the file metadata stored. Is is not as compact as Format 0,
but is designed to integrate with text-based version control
mechanisms, like diffs, patches, merges, and conflicts.
After the signature/version header line, the format is:
<path> <owner> <group> <mode> <mtime> [<xattr name> <xattr value> ...]
Where owner and group are names, not ids, mode is the octal rep‐
resentation of the 16-bit "file type and mode" field described
in inode(7), and mtime is the ISO-8601 extended format represen‐
tation of the last-modified time in UTC, with nanosecond preci‐
sion, or a literal "0" if mtime is not saved.
Strings are URL-encoded, and all characters from 0x00 to 0x20
(inclusive), 0x25 (%) and 0x7F must be encoded.
As mentioned above, the format is primarily designed to be com‐
patible with version control tools. It is secondarily designed
to be mostly-readable by humans like you, because humans use
those tools. It is not specifically designed to be written by
humans. In the case of merge conflicts that require intervention
it is recommended that you pick one existing version of an en‐
try, rather than trying to edit one of your own with aspects of
both. (Or manually reset the file permissions, and re-generate
the metainfo file.) Particularly, because bytes >= 0x80 are not
URL-encoded, binary xattr data probably won't be UTF-8 clean, so
you may have a hard time doing anything other than deleting un‐
wanted lines with many editors.
AUTHORS
metastore was created by David Härdeman in 2007-2008. Now it is main‐
tained by Przemysław Pawełczyk. All source code contributors are
listed in the AUTHORS file.
January 2016 metastore(1)
|