I'm doing backups to LTO tape. Because my backups include a lot of small files, which slows down the read from disk. I'm using the buffer command to prevent shoe-shining my tapes:
bkname="test"; tobk="*"
totalsize=$(du -csb $tobk | tail -1 | cut -f1)
tar cvf - $tobk | tee >(sha512sum > $bkname.sha512) >(tar -tv > $bkname.lst) | mbuffer -m 4G -P 100% | pv -s $totalsize -w 100 | dd of=/dev/nst0 bs=256k
The problem with this approach is: I can't make a backup spanning multiple tapes, because the tar command isn't directly accessing the tape and therefore won't recognize a full tape.
What would be the correct way to buffer the small files and have multi tape backups at the same time?