Tar: A slop-free alternative to rsync
6 hours ago
- #rsync
- #tar
- #ssh
- Rsync is no longer the preferred tool for transferring files over SSH; tar is proposed as an alternative.
- A tar command with ssh can transfer files, preserving ownership and permissions, similar to rsync -a.
- Use tar -cz to create a compressed archive and pipe it through ssh for remote extraction with tar -xz.
- Adding pv to the pipeline provides a lightweight progress display during the transfer.
- Key tar options: -c to create, -x to extract, -f for file, -C to change directory, and -z for gzip compression.
- Tar paths are straightforward: files are extracted exactly as archived, with -C adjusting the working directory.
- An alternative program, rtar, is available to simplify this tar-over-ssh usage.