Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Back up a UNIX box (or folder) to a DMG image file' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Back up a UNIX box (or folder) to a DMG image file
Authored by: digitalhippie on Aug 28, '08 07:30:58AM
Very interesting. I figured out a similar way to back up my (linux) router (Soekris net4501/5501) to the MacPro. All the logic lives on the router and it's just a ssh key (no passphrase) and two cron lines:
# Weekly backups
59 03 * * wed   DATE=`date "+%Y%m%d"`; /usr/bin/ssh -i .ssh/id_dsa.USER -l USERNAME MacPro "nc -l -p 23456 | gzip > /path/to/backup-$DATE.dd.gz"
00 04 * * wed   /bin/dd if=/dev/hda bs=1024 | nc -w5 MacPro 23456
essentially, every wednesday shortly before 4 am it will make the MacPro listen on port 23456 for a disk-dump (dd) via netcat (nc) which it will gzip and save to a file containing the date. One minute later the router starts to dump the entire disk to the pipe, thus creating the backup on the MacPro. The entire process is about ten minutes for a 4GB flash drive, I have 1.4GB used on it and the backup size gzipped is ~400MB.

Restoring is as simple as
$ cat backup-XXXXXX.dd.gz | gzip -d | dd of=/dev/device-to-restore bs=1024
You might find it useful some day. The method works for almost any flavor of Unix, including Mac OS X.

[ Reply to This | # ]