By Manny Fernandez

September 28, 2016

rsync in OS X

rsync in OS X

Recently, I purchased a 1TB 2.5″ SSD drive.  The problem I was having was that I was worrying about the drive getting bumped and possibly losing data. Although I use Crashplan for long term archive, I like to back up my data on something local to ensure I can access it in a pinch or be able to seed the data and only restore the changes.

What I decided to use:

Standards based rsync built into OS X (Soon to be macOS )

Hazel

The hard drive contained a dmg file that is encrypted (500GB with the remaining 500GB unencrypted).  When I connect the drive, it mounts the non-encrypted volume.  I then double click on the dmg file where it prompts me for a password.  Once entered, it mounts a second volume on the Mac.

Hazel is looking out for a volume named ’The-Vault’.  Once it sees that volume mounted, it will launch the rsync “script”

rsync -rlptgoD /Volumes/Customer\ Files/ /Volumes/The-Vault/ClientBackup/

2016 09 20 19 45 28

I added a Growl message just to keep me company 🙂

The ‘rsync’ calls the actual program.

-r, –recursive recurse into directories
-i, –itemize-changes output a change-summary for all updates
-p, –perms preserve permissions
-t, –times preserve times
-g, –group preserve group
-o, –owner preserve owner (super-user only)
-D same as –devices –specials
–devices preserve device files (super-user only)
–specials preserve special files

What this does in english:

Copies all files from /Volumes/Customer Files that are not already in ?Volumes/The-Vault/ClientBackup.  It will keep the date, time and permission that the original files had.

This runs once, when the volume is mounted.

The vi Cheat Sheet (2026 Edition): From Survival Keys to Power Moves

The vi Cheat Sheet (2026 Edition): From Survival Keys to Power Moves

Use this vi cheat sheet to master survival keys and power moves. Learn vi modes, operator grammar, and vim extensions for fast config editing.

Read More
grep vs. egrep vs. fgrep: One Engine, Three Personalities

grep vs. egrep vs. fgrep: One Engine, Three Personalities

Learn the difference between grep, egrep, and fgrep. Fix legacy scripts, handle deprecation warnings, and choose the right mode for fast log analysis.

Read More
Monkey Bites – Auto Move Shortcut for macOS

Monkey Bites – Auto Move Shortcut for macOS

Create a macOS Shortcut to auto move files from your Downloads folder into organized subfolders based on file extension. Includes automation setup.

Read More