To back up a local UNIX serving box (ALIX1C motherboard with FreeBSD), I wrote a simple but efficient bash script to save all or part of it in a DMG image disk file. This backup should be used as often as required (launching with cron needs a password-free RSA login). This backup is a differential one, and an exact replication is done assuming the RSA user has sufficient privileges to do so.
Why save in a DMG?
The Script
This script has to be used from your Mac's Terminal.app. Change the variables for your needs. Please be aware that script is not made for direct production use -- there is no error control management code, for instance. It is a raw but usable piece of code to help in backing up.
#!/bin/bash
# Goal : backup my alix box with rsync via ssh in a local dmg file
# The archive and mounted archive name should be the same, w/o .dmg extension for the second
## VARIABLES
# archive Path w/ trailing slash
sauvDMGpath=/Volumes/MactivisteTimed/
# name of the archive, should be the same as the disk, without .dmg
sauvDMGname=nomArchiveDuServeur
# scheme to use below : user@ip_or_host_name
connexionID=RSAUser@IPaddress
# backup root tree, default is "/", all file system
savingPath=/
## MAIN
# mounting image
hdiutil mount $sauvDMGpath$sauvDMGname.dmg
# wait a little bit to assure for FileSystem sync OK
sleep 1
# sync. Ass "z" extension in first extension block when using internet
# or low rated transfert connexion in order to add compression data
rsync -aq -e ssh --delete $connexionID:$savingPath /Volumes/$sauvDMGname/
# unmount image
hdiutil eject /Volumes/$sauvDMGnameMac OS X Hints
http://hints.macworld.com/article.php?story=20080824104702593