View Single Post
  #4  
Old 06-09-2007, 01:08 PM
harvardslacker harvardslacker is offline
Registered User
 
Join Date: Jun 2007
Location: New York, NY
Posts: 3
Running hdiutil compact during copy script

Quote:
Originally Posted by dnanian View Post
Note that you need to do this to the image file, typically when closed, so delay a background script for 20 seconds or so...
I noticed that the 'compact' command failed whenever the disk image was mounted, so I made a shell script that unmounts the image, compacts it, and then remounts it. This seemed to work fine, but because the program indicates that before copying but after mounting the disk it does things ('preparing' it, preserving the Spotlight state, etc.), I was concerned that unmounting it after those things might cause problems, so I changed my script to just perform the 'compact' command after the backup. So far, so good... I'll post here again if after a number of repetitions some problem crops up.

Thanks,

Greg
Reply With Quote