version.sh: Fix sed error on BSDs: bad flag in substitute command: '}'.
[metastore.git] / README
blob0249433c10db65f4b91c9a418da82da540893f46
1 metastore
2 =========
4 metastore is a tool to store the metadata of files/directories/links in
5 a file tree to a separate file and to later compare and apply the stored
6 metadata to said file tree.
8 It was written as a supplement to git which does not store all metadata,
9 making it unsuitable for e.g. storing /etc in a repository.
11 metastore can also be helpful if you want to create a tarball of a file
12 tree and make sure that "everything" (e.g. xattrs, mtime, owner, group)
13 is stored along with the files.
16 Stored metadata
17 ---------------
19 metastore stores following metadata in its files:
21 - owner,
22 - group,
23 - permissions,
24 - xattrs,
25 - mtime - optionally.
28 Usage
29 -----
31 See the manual page (metastore.1) for details on usage.
34 File format
35 -----------
37 Following sections explain internals of metastore file (.metadata).
40 ### Data types
42     CSTRING     = NUL-terminated binary string
43     BSTRING(N)  = binary string of length N
44     INT(N)      = N byte integer in big endian byte order
47 ### File layout
49     HEADER
50     N * ENTRY
53 ### HEADER format
55     BSTRING(10) - Magic header - "MeTaSt00r3"
56     BSTRING(8)  - Version - "\0\0\0\0\0\0\0\0" (currently)
59 ### ENTRY format
61     CSTRING     - Path  (absolute or relative)
62     CSTRING     - Owner (owner name, not uid)
63     CSTRING     - Group (group name, not gid)
65     INT(8)      - Mtime (seconds)
66     INT(8)      - Mtime (nanoseconds)
67     INT(2)      - Mode  (st_mode from struct stat st_mode AND 0177777,
68                          i.e. unix permissions and type of file)
70     INT(4)      - num_xattrs
71     FOR (i = 0; i < num_xattrs; i++) {
72         CSTRING            - xattr name
73         INT(4)             - xattrlen
74         BSTRING(xattrlen)  - xattr value
75     }
78 License
79 -------
81 The project is licensed under the terms of the GNU GPL v2 only license.
82 See LICENSE.GPLv2 file for the full license text.
85 Bug reports
86 -----------
88 Please use the issue tracker provided by GitHub to send bug reports
89 or feature requests.
91 https://github.com/przemoc/metastore/issues