scripting Disk Copy

I’m trying to write a backup script which creates a disk image with Disk Copy and then burns its. Scripting Disk Copy seems to require some syntax specific to Disk Copy but I cannot find any reference to these or knowledge base on the web.

Any one there who can point me in the right direction?

Tom

It’s probably easiest to create an image using the commandline tool hdiutil.
The following command will create a new image named lists.dmg from the source folder Lists which is located in my Documents folder.

hdiutil create ~/Desktop/lists -srcfolder ~/Documents/Lists

.
To wrap this in applescript use do shell script syntax:

do shell script "hdiutil create ~/Desktop/lists -srcfolder ~/Documents/Lists"

Takie a look at man hdiutil in the Terminal for more options.

My version of hdiutil does not have a -srcfolder option for create (or any verb). Is this a Panther improvement? I’m using OS X 10.2.8.

What does the -srcfolder option do?

Tom

-srcfolder creates a new diskimage based on the contents and size of a particular directory.
This option was added in 10.3 according to the manual page.

I have no access to a copy of 10.2 but I’m sure it must be possible to create a new blank diskimage, mount it and have the finder copy everything there.
You’ll have to do a bit of juggling to find out the size the diskimage must be.

In 10.2, one might use a sparse image to create a disk image that grows as needed.

– Rob