3

I'm in the process of porting scripts which use rsync to MacOS 10.15.7.

Typical commands in these scripts look like

rsync -rau --delete SOURCE DESTINATION

Is there a way to display, which files have been deleted from DESTINATION? On Linux, I would use the option --info=del, but on the Mac version of rsync, --info does not exist, as we can see in the man-page.

0

2 Answers 2

7

If you're intent on using the ancient Apple version of rsync, you might find the --dry-run option with the -i and -v (or -vv) options useful for listing the deletions.

rsync -rauivv --dry-run --delete SOURCE DESTINATION

If you want an affirmative record of what has been deleted, you could use the --backup-dir= option to actually save a copy of what's been deleted in a separate folder on the DEST (which could later be deleted).

rsync -rau --delete --backup-dir=/the/destination/backup SOURCE DESTINATION

Perhaps the easiest thing to do is avoid the porting process altogether by getting a current version of rsync via a 3rd party package manager: either MacPorts (recommended), or Homebrew.

You might also find this answer worth a read.

1
  • +1 for the dry run option alone!
    – Allan
    Commented Apr 20, 2023 at 18:30
7

The version of rsync supplied by Apple is very old (at least 17 years) it is version version 2.6.9 (which just happens to be the last rsync version released under GPL 2)

So the best fix for your issue is to install a modern version of rsync. It is available from all package mangers e.g. Macports, Homebrew.

4
  • AFAIK, Apple's version of rsync does include an option for backing up extended attributes.
    – Seamus
    Commented Apr 20, 2023 at 17:14
  • Apple is avoiding GPL3 everywhere. To my understanding that was also the reason to switch from bash to zsh. Commented Apr 21, 2023 at 7:07
  • 1
    From man -M /usr/share/man rsync: -E, --extended-attributes copy extended attributes, resource forks, so Apple's version does support extended attributes and resource forks.
    – nohillside
    Commented Apr 21, 2023 at 8:01
  • The issue is so old I have forgotten the details - but might be that vanilla rsync did not support extended attributes but Apple had forked it which I did not realise. There were other issues.
    – mmmmmm
    Commented Apr 21, 2023 at 11:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .