Skip to content

Instantly share code, notes, and snippets.

@nalingarg2
Forked from magnetikonline/README.md
Last active September 14, 2015 20:33
Show Gist options
  • Save nalingarg2/80c960aef76eb9401d53 to your computer and use it in GitHub Desktop.
Save nalingarg2/80c960aef76eb9401d53 to your computer and use it in GitHub Desktop.
Rsync delete orphan files from target only - no copy.

Rsync delete orphan files from target only - no copy

Calling Rsync in the following way, using --existing, --ignore-existing and --delete enables the following:

  • Only files at target that do not exist at source will be deleted.
  • Skipping all file copy operations from source to target.
$ rsync -ri \
  --delete --existing --ignore-existing --progress \
  /path/to/source/ /path/to/target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment