brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: rsync --info=progress2 shows one progress line for the whole transfer

Backup
~/tips/tip-shell-rsync-progress2

rsync -a --info=progress2 ~/Videos/ /mnt/nas/Videos/

Shows a single progress line for the whole copy instead of one per file.

--progress scrolls a line for every single file. With ten thousand small files that is noise, and you still do not know how far along you are.

--info=progress2 shows the overall progress instead: one line that updates in place, with bytes sent, a percentage, speed and time. The rsync man page even uses it as its example.

rsync -a --info=progress2 ~/Videos/ /mnt/nas/Videos/

It combines well with -h for human-readable sizes. Throw in --partial if the connection might drop, so an interrupted big file is not thrown away and started over. -P is shorthand for --partial --progress, but that brings back the per-file lines.

The caveat is the percentage. rsync builds its file list while it copies, so on big trees the total can grow as it discovers more files and the percentage jumps around early on. Treat it as a rough indication. Per the man page, this option needs rsync 3.1 or newer on your side, and the macOS rsync is older than that, so check rsync --version first.

For a copy over SSH to a server I add -z only when the files compress well. Photos and video do not, and then it only burns CPU.

Further reading: rsync man page, On this site: rsync -ani shows exactly what would change before it changes anything, On this site: the trailing slash in rsync decides where your files land

More Backup tips restic snapshots --group-by host,paths mysqldump --routines --events mydb > mydb.sql rsync -a --files-from=list.txt /home/me/ backup:/backup/ restic find "*.txt" restic stats All Backup tips (45) All topics

Link