noxz-sites

A collection of a builder and various scripts creating the noxz.tech sites
git clone https://noxz.tech/git/noxz-sites.git
Log | Files | README | LICENSE

noxz.tech/software/acst/index.www
1acst as a tool is designed to detect silent data corruption by first writing
2the mtime and the SHA256 checksum of a file into its extended attributes and
3then, upon later execution, comparing and verifying changes against both the
4mtime and checksum.
5
6.HnS 1
7Download
8.HnE
9
10.URL //noxz.tech/git/acst.git/archive/acst-0.1.4.tar.gz "acst 0.1.4"
11(30kb) (2023-03-09)
12
13.HnS 1
14Manual
15.HnE
16
17.CDS
18.COS
19ACST(1)                     General Commands Manual                    ACST(1)
20
21NAME
22       acst - Actual C-implementation of a Simple shaTag
23
24SYNOPSIS
25       acst [-dhmnqvx] <FILE...>
26
27DESCRIPTION
28       acst is a minimal and simplified implementation in C of, or rather,
29       inspired by, shatag and also inspired by cshatag.
30
31       acst as a tool is designed to detect silent data corruption by first
32       writing the mtime and the SHA256 checksum of a file into its extended
33       attributes and then, upon later execution, comparing and verifying
34       changes against both the mtime and checksum. For this to work, the file
35       system intended to be verified must first support extended user
36       attributes, either by being mounted with user_xattr enabled or by other
37       means. Depending on how these variables differ, various file statuses
38       are being reported (see the FILE STATUSES section).
39
40       acst won't follow symlinks due to the risks of creating reference loops
41       or referencing data outside of the indented scope of subdirectories.
42       acst also won't descend into directories on other file systems than the
43       one specified using the FILE argument. Keep in mind that if multiple
44       files with different file systems are specified using the FILE
45       argument, they will get traversed indifferent of each other. For
46       example, if you specify two different partitions mounted on two
47       different directories, they would both be traversed.
48
49       acst reads names of files to open from standard input if the only FILE
50       argument is '-'. To open files starting with '-', use '--' to cancel
51       parsing of arguments.
52
53       acst does not aim to be format-compatible with shatag and uses
54       different names for the extended attributes but similar formats for the
55       extended attributes (see the COMPATIBILITY section).
56
57OPTIONS
58       -d     Check for duplicates among files based on stored checksums from
59              acst's extended attributes. Return values when checking for
60              duplicates are normally 0 for success or 1 for fatal errors (in
61              other words, the RETURN VALUES section does not apply).
62              Certainty of the result is, of course, dependent on checksums
63              being created or corrected fairly recently as no checksums are
64              being computed during the duplicate check.
65
66       -h     Print brief usage information to standard output and exit.
67
68       -m     Summarize information at end of execution.
69
70       -n     Don't create or update any extended file attributes. File
71              hashing and checking will be performed, but no extended file
72              attributes will be created or updated.
73
74       -q     Quiet mode. If specified one time ok files are not being
75              reported. If specified two times, only corrupt, backdated, and
76              malformed files and errors are being reported.
77
78       -x     Remove acts's extended attributes (xattrs) from FILE.
79
80       -v     prints version information to stderr, then exits.
81
82RETURN VALUES
83       0      Success
84
85       1      Wrong number of or invalid arguments.
86
87       2      One or more files, including directories when executed with the
88              recursive flag, could not be opened.
89
90       3      One or more files is not a regular file and probably a symlink
91              of sorts.
92
93       4      Extended attributes could not be written to one or more files.
94
95       5      At least one file was found to be corrupt, backdated or
96              malformed.
97
98       6      More than one type of error has occurred.
99
100FILE STATUSES
101       During program execution and processing of each file various file
102       statuses will appear on stdout.  Following are descriptions of these
103       statuses.
104
105       ok     Checksum is correct and mtime is unchanged.
106
107       hash ok
108              Checksum is correct and mtime was changed.
109
110       outdated
111              Checksum is incorrect and mtime is newer than the one stored as
112              an extended Attribute.
113
114       backdated
115              Checksum is incorrect and mtime is older than the one stored as
116              an extended Attribute.
117
118       malformed
119              Extended attributes could not be read as otherwise intended.
120
121       corrupt
122              Checksum is incorrect but mtime stayed the same.
123
124       disrupted
125              File was modified during hash computation.
126
127       new    Extended attributes are missing and were added.
128
129       xattr removed
130              Extended attributes were removed.
131
132       dup    Duplicate of checksum among files checked.
133
134EXAMPLES
135       find /mnt/memorystick -xdev -type f | acst - > /root/acst.log
136              will use find to recursively traverse through files in
137              /mnt/memorystick within the same file system and log the result
138              to /root/acst.log.
139
140       find /home/user01 /strg/shr/media -type f | acst - > /root/acst.log
141              will recursively process files in both /home/user01 and
142              /mnt/memorystick even if they belong to different file systems,
143              and then log the result to /root/acst.log.
144
145       find /home/user01 /strg/shr/media -type f | acst -m - > /root/acst.log
146              will perform the same operation as above with the addition of
147              also summarizing the result of the execution to the log.
148
149       find /mnt/memorystick -xdev -type f | acst -x - > /root/acst.log
150              will recursively process and remove extended attributes from
151              files in /mnt/memorystick and log the result to /root/acst.log.
152
153       find /mnt/memorystick -xdev -type f | acst -d -
154              will recursively check for duplicates among files in
155              /mnt/memorystick based on checksums stored as extended
156              attributes.
157
158COMPATIBILITY
159       acst writes to user.acst.cs and user.acst.ts instead of the
160       user.shatag.sha256 and user.shatag.ts specified by shatag.
161       acst writes the user.acst.ts field with full integer nanosecond
162       precision, while python-implemented shatag doesn't.
163
164AUTHOR
165       Chris Noxz <chris@noxz.tech>
166
167COPYRIGHT
168       Copyright © 2022 Chris Noxz.
169
170       License: GPLv3+
171
172       GNU GPL version 3 or later
173       <https://www.gnu.org/licenses/licenses.html>.
174
175       This is free software: you are free to change and redistribute it.
176       There is NO WARRANTY, to the extent permitted by law.
177
178SEE ALSO
179       shatag(1), cshatag(1), sha256sum(1), getfattr(1), setfattr(1)
180
181       The original shatag utility, written in python by Maxime Augier:
182       https://bitbucket.org/maugier/shatag
183       and cshatag utility, written in Go by Jakob Unterwurzacher:
184       https://github.com/rfjakob/cshatag
185
186AVAILABILITY
187       Up-to-date sources can be found at:
188       https://noxz.tech/git/acst
189       https://noxz.tech/software/acst
190
191                                 acst-0.1.4                            ACST(1)
192.COE
193.CDE
194
195.HnS 1
196Installation
197.HnE
198
199Edit config.mk to match your local setup (acst is installed into the
200.I /usr/local
201namespace by default), then simply enter the following command to install (if
202necessary as root):
203
204.CDS
205.COS
206make clean install
207.COE
208.CDE
209
210get source
211.URL //noxz.tech/git/acst.git here .