Scripting the ASR command line restore tool

I have been experimenting with building my own image restore setup which is proving to be very interesting. I've built my own stripped down netboot image with a script that mounts a share and then displays a list of all restore images which you select and then restores to the drive on the computer you are netbooted from.
Everything is going well except when I run the script it always seems to hang on the ASR command. I can run it in the terminal window no problems but when I place it in a perl script it just seems to hang.

Can anyone offer a reason which is will not work. Everything else in my script is woking great.

Here is an example of the line I'm trying to run.

SCRIPT-----------
+#!/usr/bin/perl -w+

+print "Restoring Image";+
+`sudo asr restore --source "/Volumes/OSXInstall/Desktop_Image.dmg" --target "/Volumes/Macintosh HD 1" --erase`;+
+print "Image restore finished";+
--------------SCRIPT

Any suggestion would be great. The solution is probably really easy and I just can't see it.

Macbook, Mac OS X (10.6.2), 2gbRam/250GB Drive

Posted on Jan 3, 2010 1:56 AM

Reply
3 replies

Jan 4, 2010 12:41 AM in response to foilpan

Thanks for your reply Foilpan.
I added the --noprompt and --verbose switches but no change. I have the script saved as a asr.tool so I can double click it but the output in terminal asks for the sudo password and then outputs the following...
+$ /<theScriptLocation>/asr.tool ; exit;+

I can copy the command to the terminal window and it runs fine so I know the command is correct but something in my script just doesn't match up?

Yes the Macintosh HD 1 is correct because my netboot image has the disk named Macintosh HD and is the first boot disk. In future I intend to rename this.

DeployStudio is the preferred deployment software for our new site rollouts but I can't get it to work in OSX10.6 which why I'm looking at the command line option. Even working on OSX10.5 seems to be a hit and miss on occasion.
Too be honest if I can get this last little bit working then this looks to be much faster and potentially easier that everything else I've tried. My initial tests doing every step manually seems to be really fast and when your rolling out 50 Mac's in one day I like it to be as fast and clean as possible.

Any further thoughts on the script problem??

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Scripting the ASR command line restore tool

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.