cybrkyd

rsync one-liners

 Tue, 17 Jun 2025 07:25 UTC
rsync one-liners
Image: CC BY 4.0 by cybrkyd

My cheat sheet of rsync one-liners.

# Rsync

# -P: same as --partial --progress
# -r: recurse into directories

rsync -Pr "/original/" "/destination"

# Update changes

rsync -uPr "/original/" "/destination"

# Ignore

# -a: archive

rsync -avP --ignore-existing "/original/" "/destination"

# Exclude

rsync -avP --ignore-existing --exclude '*.png' "/original/" "/destination"

# Delete at target

rsync -avP --ignore-existing --delete-before "/original/" "/destination"

# Rsync over SSH with port

rsync -avPu -e "ssh -p 6743" "/original/" root@123.45.678.90:/var/www/html

# Remote to Local

rsync -avP -e "ssh -p 6743" root@123.45.678.90:/var/www/html/remote/folder/file.txt /home/user/Work
»

Visitors: Loading...