== code and data == $ rm a b c; echo a > a; echo b > b; touch c; tar -cf a.tar; sleep 1 $ rm a b c; echo a > a; echo b > b; touch c; tar -cf aa.tar; sleep 1 $ sha1sum a.tar aa.tar # different $ grep -oba $'\x75\x73\x74\x61\x72\x00' a.tar | cut -d: -f1 | awk '{ print (int($1/512)*512) }' | sort -n -u > prs1.txt # force to previous 512 boundary as header start $ truncate -s "$(stat --format=%s a.tar)" framework.tar $ cat prs1.txt | xargs -n1 sh -c 'off="$1"; dd if=a.tar of=framework.tar bs=512 skip="$((off/512))" seek="$((off/512))" count=1 conv=notrunc' sh $ # when working on a 52-GB TAR file, this used a lot of CPU in my experience, didn't use lots of RAM; it ran without the below \n -> \ $ cat prs1.txt | xargs -n1 sh -c 'off="$1"; dd if=framework.tar of=aa.tar bs=512 skip="$((off/512))" seek="$((off/512))" count=1 conv=notrunc' sh $ # or: [dd command] 2>&1 | perl -pE "s/\n/\\\\/g" $ # is this [...] perl [...] version slower? IDK. $ # or: [dd command] 2>&1 >dd-log.txt $ sha1sum a.tar aa.tar # same $ du -sh /path/to/folder.tar.txt.gz # contains some type of list of files and folders inside of folder.tar $ # test if it works $ # utc; find /path/to/folder/ -type f | xargs -d "\n" touch; utc # set mtime of all files to now $ # utc; 7z a /path/to/folder.sync.tar /path/to/folder; utc # vs. an older "folder.tar" $ # [above commands] $ # Example *.sha1.txt file: $ cat /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar.sha1.txt $ head -c 411222999 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar | sha1sum c506b05196addbb9f8cd8afb11143df4f0c0af69 - $ tail -c 411222999 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar | sha1sum a59bc260060f7799cb1899dea8876d2a43087a62 - $ [...] 41acb816623f5472abd84459e7b7fdb6f505c2e7 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar == test on 52-GB .tar file == Worked: $ [...] $ utc; cat /mnt/p4/b/zd/4changif/4chan_gif_2026_06.framework.txt | xargs -n1 sh -c 'off="$1"; dd if=/mnt/p4/b/zd/4changif/4chan_gif_2026_06.framework.tar of=/mnt/p4/b/zd/4changif/4chan_gif_2026_06.sync.tar bs=512 skip="$((off/512))" seek="$((off/512))" count=1 conv=notrunc 2>&1 | perl -pE "s/\n/\\\\/g"' sh; echo; utc It ran from 2026-08-14T05:22:32.181772157Z to 2026-08-14T07:34:36.552445643Z. Hashes match: $ cat /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar.sha1.txt $ head -c 411222999 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar | sha1sum c506b05196addbb9f8cd8afb11143df4f0c0af69 [...] $ tail -c 411222999 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar | sha1sum a59bc260060f7799cb1899dea8876d2a43087a62 [...] 41acb816623f5472abd84459e7b7fdb6f505c2e7 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.tar Compared to: $ head -c 411222999 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.sync.tar | sha1sum c506b05196addbb9f8cd8afb11143df4f0c0af69 - $ tail -c 411222999 /mnt/p4/b/zd/4changif/4chan_gif_2026_06.sync.tar | sha1sum a59bc260060f7799cb1899dea8876d2a43087a62 - $ utc; cat /mnt/p4/b/zd/4changif/4chan_gif_2026_06.sync.tar | pv | sha1sum; utc