rsync

Simply the best thing around for keeping file trees up to date across machines, partitions, etc. These are my random notes on it (in the sense that they might seem somewhat random, but they’re mine alone):

Bulk Photo Sync

The fastest way to sync a few hundred gigabytes of photos from my NAS to a backup disk is, alas, to bypass the rsync algorithm entirely and do it with:

--verbose
--archive (same as -rlptgoD, i.e. --recursive --links --perms --times --group --owner --devices --specials)
--whole-file
--extended-attributes
--partial
--progress


This because doing full checksums on the whole thing takes a long time for large photos and video files. And yeah, it’s pretty much like the Mac’s built-in ditto.

The above can be neatly summarized as:

rsync -vaWEP /Volumes/photo/ /Volumes/Fort\ Knox/Photos


And I occasionally swap the “W” with an “I” when I want a full binary sync (which is very seldom needed for a photo archive, but essential if you tweak the EXIF tags on it now and then).

Cut & Paste shortcut for one of my LAN backups

rsync -Cravztue ssh --progress --no-whole-file --stats --sparse --dry-run /home/rcarmo [email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */:/Volumes/Pedestal/Backups/monolith/home/carmor


Poor man’s rsync using only cp:

Assuming file contents don’t change, this will only copy new files across:

cp -npRv "/Volumes/Local" "/Volumes/Remote"


Resources:

• csync - a non-rsync file synchronizer that happens to be bi-directional and support SFTP.
• mrsync - a multicast-enabled version that seems pretty useful for keeping large sets of machines in sync
• rsnapshot, a filesystem snapshot utility (written in Perl for making backups of local and remote systems.
• A HOWTO I mirrored locally for setting up the daemon under Leopard.