How to sync files and directories

How to sync files and directories in Apple(R) macOS(R)

Incremental backup to external storage

Use the following script for "/Users/owner/Documents/" as an example.

#!/bin/bash


#
# Required the backup disk mounted at "/Volumes/backup" (for Apple macOS).
#


time=`date "+%Y-%m-%d_%H-%M-%S"`

rsync -achx --progress --link-dest=/Volumes/backup/last/ /Users/owner/Documents/ /Volumes/backup/${time}

rm -f /Volumes/backup/last
ln -s ${time} /Volumes/backup/last

Trademark notices

Apple(R), MacBook(R), MacBook Air(R), MacBook Pro(R), iTunes(R), iBooks(R), App Store(R), iCloud(R), iMessage(R), FaceTime(R), Safari(R), FileVault(R), MagSafe(R), Touch Bar(TM), and macOS(R) are registered trademarks of Apple Inc. in the United States and other countries.
Linux(R) is registered trademark of Linus Torvalds in the United States and other countries.


Copyright (c) 2022 Leonid Dorogin