Skip to content

Instantly share code, notes, and snippets.

@jimdiroffii
Last active August 6, 2025 01:41
Show Gist options
  • Select an option

  • Save jimdiroffii/7bb0da9b694a8099df9781be7ddc1932 to your computer and use it in GitHub Desktop.

Select an option

Save jimdiroffii/7bb0da9b694a8099df9781be7ddc1932 to your computer and use it in GitHub Desktop.
Rsync over SSH - synchronize folders with delete option and perform a dry run
# Dry Run (-n)
rsync -avzn --delete -e ssh user@remote_host:/path/to/remote/folder/ /path/to/local/folder/
# Sync
rsync -avz --delete -e ssh user@remote_host:/path/to/remote/folder/ /path/to/local/folder/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment