Copy Time Machine backup with rsync

Is it possible to copy a Time Machine backup using rsync to another HFS formatted disk? I am concerned that rsync would not be able to track the hard-linked directories that Time Machine uses.


The rsync command is very powerful and versatile, and it can preserve the Hard Links and other crucial information of the Time Machine backup. As from this post (https://www.cyberciti.biz/faq/linux-unix-apple-osx-bsd-rsync-copy-hard-links/), you could do:

rsync -azH /path/to/source /path/to/dest/

The flags stand for:

-a: archive mode (copy direcotries, preserve permisions, groups and ownerships, modification times..)

-z: compress while transfering to accelerate the copying process

-H: preserve Hard Links (crucial for Time Machine backups)

You could also add -v (for verbose) to visually follow the progress of your backup.

(I don't know if Time Machine uses numeric group and user IDs, in which case you could add the --numeric-ids flag).

BTW, you may also want to update your rsync through Homebrew (v. 3.x.x), since the one that ships with Catalina is 2.9.6.

I would also add an alias to my backup script in my .zshrc file with two purposes: 1. make it easier to run without having to type everyithing again every time I want to backup, 2. make it less prone to destructive human error (such as inverting the path to source and the path to destination).