Backup data to CD via the command line

Here is how to create a 100MB drive image, backup data to it, and then burn it onto a CD (directly in the commandline, with only the built-in tools). One possible application: This could be easily modified and incorporated into a script that will backup your Entourage mail databases every week, good for up to six uses (6x100MB) depending on the size of your mail data…

bob$ hdiutil create -fs HFS+ -volname Backup -size 100m ~/Desktop/backup.dmg

bob$ hdiutil mount ~/Desktop/backup.dmg

bob$ ditto -rsrc -V ~/Desktop/datatobackup /Volumes/Backup >> /Volumes/Backup/backup.log

bob$ hdiutil unmount /Volumes/Backup

bob$ hdiutil burn ~/Desktop/backup.dmg -noverifyburn -noeject

It will prompt you for a disc, insert one and it will burn your disc:

Code:

<div style="text-align:left;" dir="ltr">

Please insert a disc: 

Starting

Initializing

Saving temporary image

Opening session

Writing track

..................................................  ..........................

Finishing writing

..................................................  ..........................</div>

Posted by gatorparrots on Mac-Forums.com

Copyright © 2013 - Brothers Bennettw - Powered by Hexo
- Ported theme GreyShade -