3 ms·
Do you have any automation or scripts for that, or is it usually adhoc?
by lloydatkinson 3y ago
Do you have any automation or scripts for that, or is it usually adhoc?
- dmd 3y agoYou absolutely should NOT automate this. If you do, you then need to manually check that automation with the same frequency- so you haven’t gained anything!
- 369548684892826 3y agoI do have this automated, but the checksum output is posted to a kind of watchdog service. Every day I get an email that says everything is as expected, or not.
- lloydatkinson 3y agoI need to google every time to find a good process for hashing files and comparing across disks? Not only that, but remember to do it frequently enough?
- 369548684892826 3y agoYeah, I use rsync with `-cavin`, if the output includes `>` or `<` then there are differences in checksums. #!/bin/bash hostname=$(hostname) checksumFile=/tmp/checksum-file.txt rsync -cavin --info=name2 --no-perms --no-owner --no-group /srv/data/photos/ user@remote:/media/data/rsnapshot/daily.0/srv/data/photos/ > $checksumFile minimumSize=5000 actualSize=$(wc -l <"$checksumFile") if [ $actualSize -ge $minimumSize ]; then fileDiffs=$(cat $checksumFile | grep -e '<' -e '>' || echo 'all checksums match') else fileDiffs=$(echo $checksumFile is too small) fi echo $fileDiffs