rsync

BSD Rsync Cheatsheet #

BSD rsync is similar to GNU rsync but may have slight differences depending on the version.

Basic Commands #

Command/OptionExampleDescription
rsync -avrsync -av source/ destination/Archive mode with verbose output (-a for archive, -v for verbose)
rsync -zrsync -z source/ destination/Compress file data during the transfer (-z for compression)
rsync -rrsync -r source/ destination/Recursively transfer directories (-r for recursive)
rsync -ersync -e ssh source/ user@remote:/path/Specify the remote shell to use (-e for remote shell)
rsync -ursync -u source/ destination/Skip files that are newer on the destination (-u for update)
rsync -nrsync -n source/ destination/Perform a dry run (no changes are made) (-n for dry run)
rsync --deletersync --delete source/ destination/Delete extraneous files from the destination (--delete option)
rsync -Prsync -P source/ destination/Show progress during transfer and handle partial transfers (-P for progress and partial)

Advanced Options #

Command/OptionExampleDescription
rsync --excludersync --exclude='*.tmp' -av source/ destination/Exclude files matching a pattern from being transferred (--exclude option)
rsync --includersync --include='*.jpg' --exclude='*' -av source/ destination/Include only files matching a pattern (--include option)
rsync --partialrsync --partial source/ destination/Keep partially transferred files (--partial option)
rsync --bwlimitrsync --bwlimit=1000 -av source/ destination/Limit bandwidth used during the transfer (--bwlimit option)
rsync --chownrsync --chown=user:group source/ destination/Change ownership of transferred files (--chown option)
rsync --checksumrsync --checksum -av source/ destination/Use file checksums to determine changes (--checksum option)
rsync --log-filersync --log-file=rsync.log -av source/ destination/Log transfer details to a file (--log-file option)

This cheatsheet covers the essential BSD rsync commands and options for file synchronization and transfer.

Cheatsheet Website

Discover our extensive collection of cheatsheets covering various tools and technologies to streamline your workflow.