-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcshatag.1
106 lines (85 loc) · 2.71 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
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
.\"Generate README file for github: MANWIDTH=80 man ./cshatag.1 > README
.TH CSHATAG 1 "MAY 2012" Linux "User Manuals"
.SH NAME
cshatag \- compiled shatag
.SH SYNOPSIS
cshatag [OPTIONS] FILE [FILE...]
.SH DESCRIPTION
cshatag is a minimal and fast re-implementation of shatag
.br
( https://github.com/maugier/shatag , written in Python
by Maxime Augier )
.br
in a compiled language (since v2.0: Go, earlier versions: C).
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
<new> file is missing both attributes
.br
<outdated> both mtime and checksum have changed
.br
<ok> both checksum and mtime stayed the same
.br
<timechange> only mtime has changed, checksum stayed the same
.br
<corrupt> mtime stayed the same but checksum changed
cshatag aims to be format-compatible with shatag and uses the
same extended attributes (see the COMPATIBILITY section).
cshatag was written in C in 2012 and has been
rewritten in Go in 2019.
.SH OPTIONS
-dry-run don't make any changes
.br
-recursive recursively process the contents of directories
.br
-remove remove cshatag's xattrs from FILE
.br
-q quiet mode - don't report <ok> files
.br
-qq quiet2 mode - only report <corrupt> files and errors
.br
-fix fix the stored sha256 on corrupt files
.SH EXAMPLES
Check all regular files in the file tree below the current working directory:
.br
# cshatag -qq -recursive .
.br
Errors like corrupt files will be printed to stderr.
Run without "-qq" to see progress output.
To remove the extended attributes from all files:
.br
# cshatag -recursive -remove .
.SH "RETURN VALUE"
0 Success
.br
1 Wrong number of arguments
.br
2 One or more files could not be opened
.br
3 One or more files is not a regular file
.br
4 Extended attributes could not be written to one or more files
.br
5 At least one file was found to be corrupt
.br
6 More than one type of error occurred
.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]>
.br
https://github.com/rfjakob/cshatag
.SH COPYRIGHT
Copyright 2012 Jakob Unterwurzacher. MIT License.
.SH "SEE ALSO"
shatag(1), sha256sum(1), getfattr(1), setfattr(1)