Albretch Mueller wrote: > On 9/24/20, Sven Hartge <s...@svenhartge.de> wrote: > > > Why do you think you need to do this? What do you hope to achieve by > > doing this? > > I have losts of (not necessarily all) text files (say in the 10 of > thousands) in various directories which I need to process in a batch, > but before I do that I want to make sure that I get a baseline of the > source files. I use: > > a) crc > b) md5sum > c) sha###sum > > because those are three different checksum utilities based on > different algorithms which work fast enough and offer a set signatures > which are good enough. > > My thinking may (once again) be a bit unhinged, but I would use, > e.g., crc because it internatlly used by rsync, which I also use in my > code. > > So, how do you think I can improve my baselining of the source files?
If you want to defend against on-disk corruption, use ZFS. If you want to be alerted to every change to a set of files, use tripwire or aide. Both are packaged for Debian. If you want to make sure that a directory full of files doesn't change during processing, remove your write privileges for that directory. "sudo chmod a-w DIRECTORY" will do that. If you want to make sure of the previous case but you are going to run a process that runs as root and you aren't sure it won't assign itself write privileges, "sudo chattr +i DIRECTORY" will make it immutable. Don't reinvent the wheel. -dsr-