-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathcshatag.1
More file actions
116 lines (93 loc) · 3.13 KB
/
cshatag.1
File metadata and controls
116 lines (93 loc) · 3.13 KB
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
.\"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 and reports a <corrupt> status.
In any case, the status of the file is printed to stdout.
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
When a file is considered <corrupt>, the stored checksum is
only updated if "-fix" is passed. For all other statuses
except <ok>, the stored checksum is always updated.
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
-cpuprofile save cpu profile to specified file. This is useful
for diagnosing performance issues.
.br
-dry-run don't make any changes
.br
-fix fix the stored sha256 on corrupt files
.br
-j number of threads. Values <= 0 means auto
(https://pkg.go.dev/github.com/charlievieth/fastwalk#DefaultNumWorkers).
.br
-q quiet mode - don't report <ok> files
.br
-qq quiet2 mode - only report <corrupt> files and errors
.br
-recursive recursively process the contents of directories
.br
-remove remove cshatag's xattrs from FILE
.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 <jakobunt@gmail.com>
.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)