contentintech
Tools

Rsync

Preview and synchronize directory trees locally or over SSH.

Local sync

rsync -av source/ destination/Copy the contents of source into destination
rsync -avn source/ destination/Dry-run without writing files
rsync -av --exclude=node_modules source/ destination/Exclude a directory
rsync -av --progress source/ destination/Show transfer progress

Remote sync

rsync -av source/ user@host:/srv/app/Upload using SSH
rsync -av user@host:/srv/app/ backup/Download a remote tree
rsync -av -e 'ssh -p 2222' source/ user@host:/srv/app/Use a custom SSH port
rsync -avz source/ user@host:/srv/app/Compress data during transfer

Safer mirroring

rsync -avn --delete source/ destination/Preview deletions; inspect carefully
rsync -av --backup --backup-dir=../previous source/ destination/Keep replaced destination files
rsync -av --ignore-existing source/ destination/Leave existing destination files unchanged
rsync -av --itemize-changes source/ destination/Show which files and attributes differ

Section navigation