Skip to content

Instantly share code, notes, and snippets.

@AtumRa
AtumRa / rsync delete command.md
Last active January 31, 2024 15:15
rsync deleting files without 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