forked from rfjakob/cshatag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cshatag.1
81 lines (61 loc) · 2.01 KB
/
cshatag.1
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
.\"Generate README file for github: MANWIDTH=80 man ./cshatag.1 > README
.TH CSHATAG 1 "MAY 2012" Linux "User Manuals"
.SH NAME
cshatag \- shatag in C
.SH SYNOPSIS
cshatag FILE
.SH DESCRIPTION
cshatag is a minimal re-implementation in C of shatag
.br
( https://bitbucket.org/maugier/shatag , written in python
by Maxime Augier ).
cshatag is a tool to detect silent data corruption. It writes
the mtime and the sha256 checksum of a file into the file's
extended attributes. The filesystem needs to be mounted with
user_xattr enabled for this to work.
When run again, it compares stored mtime and checksum. If it
finds that the mtime is unchanged but the checksum has changed,
it warns on stderr.
In any case, the status of the file is printed to stdout
and the stored checksum is updated.
File statuses that appear on stdout are:
.br
outdated mtime has changed
.br
ok mtime has not changed, checksum is correct
.br
corrupt mtime has not changed, checksum is wrong
cshatag aims to be format-compatible with shatag and uses the
same extended attributes (see the COMPATIBILITY section).
.SH EXAMPLES
Typically, cshatag will be called from find:
.br
# find / -xdev -type f -exec cshatag {} \\; > cshatag.log
.br
Errors like corrupt files will then be printed to stderr
or grep for "corrupt" in cshatag.log.
To remove the extended attributes from all files:
.br
# find / -xdev -type f -exec setfattr -x user.shatag.ts {} \\; -exec setfattr -x user.shatag.sha256 {} \;
.SH "RETURN VALUE"
0 Success
.br
1 Wrong number of arguments
.br
2 File could not be opened
.br
3 File is not a regular file
.br
4 Extended attributs could not be written to file
.br
5 File is corrupt
.SH COMPATIBILITY
cshatag writes the user.shatag.ts field with full integer
nanosecond precision, while python uses a double for the
whole mtime and loses the last few digits.
.SH AUTHOR
Jakob Unterwurzacher <[email protected]>
.SH COPYRIGHT
Copyright 2012 Jakob Unterwurzacher. License GPLv2+.
.SH "SEE ALSO"
shatag(1), sha256sum(1), getfattr(1), setfattr(1)