PDA

View Full Version : How to preserve icon of target volume during smartbackup?


mypointofview
12-02-2005, 03:53 PM
I've set up a personalized script, so that the invisible file ".VolumeIcon.icns" should be ignored on the original drive while running "Backup - all files" in Smart Update mode. This works and the target volume does not receive this icon :)

However, in the same script I have defined also that the icon for the target drive "Volumes / BKUP Macintosh HD / .VolumeIcon.icns" should also be ignored. Yet it gets deleted on the target volume when I do a smart backup :(

I had selected the icon for the original drive ".VolumeIcon.icns" from the first column in the little browser underneath the "Script Commands" pane.

The icon for the target drive "Volumes / BKUP Macintosh HD / .VolumeIcon.icns" I had selected by first clicking on "Volumes" (left column) which then revealed all mounted drives in a second column. There I selected my target drive, which opened a third column where I finally selected the icon file for the target drive.

So the pane of the scripts commands said:

ignore .VolumeIcon.icns
ignore Volumes/BKUP Macintosh HD/.VolumeIcon.icns

Question: why is the icon on my target volume being deleted and how can I stop this?


Sincerely, Martin.

Panther 10.39, G4 Dual 500, SuperDuper 2.0, all internal drives

dnanian
12-02-2005, 04:33 PM
By definition, ignore with Smart Update will remove the file. It's ignored *from the source*, not the destination. That means it's not in the set of files to be copied, so it'll be removed instead.

So, here's what you should do:

- Create a folder named "Volume Icons" in your Home.
- In there, place the icon you want, for a given volume, named "the-volume-name.VolumeIcon.icns".
- Download the attached and set it as your "after copy" script in Advanced

That'll automatically set the icon when the backup is done. Note that it depends on having the developer tools installed in most cases (unless the source has a custom icon).

Aristophanes
01-17-2006, 04:30 AM
Hello,

I have the same problem of my cloned drive icon changing after every backup. It is very frustrating. :(

Unlike the previous questioner, I have done nothing to exempt any files. SuperDuper just started doing it. This did not happen under V.1.

Thanks

dnanian
01-17-2006, 09:31 AM
This behavior hasn't changed between v1 and v2, Aristophanes. The icon is a file like any other, and is copied from the source to the destination.

There's a message "stuck" at the top of the forum that provides a method that should let you reset the icon after you back up, should this be important to you.

aaronpcreative
02-04-2006, 08:14 PM
I followed all the steps above, and it works great except for the fact that the icon doesn't refresh automatically.

Let me suggest a feature here- that it would be nice to have the option, while setting up a dupe, to overlay a tiny indicator to the target volumes' duplicated icon, after copy, so that people wouldn't have to mess with .icns files? I do icons for fun so it's no big deal for me, but when you have several volumes operating, it can get a bit confusing in the finder.

dnanian
02-04-2006, 10:42 PM
I'm not sure what you mean, Aaron. Where is this indicator displayed?

aaronpcreative
02-05-2006, 04:00 PM
Just like there is an icon overlay in the Dock when you get mail. Perhaps the pencil from your logo would overlay the cloned drive's icon to visually reinforce that it's a backup. It wouldn't have to be dynamic, though. Just a thought, really. I don't have any idea how difficult that would be to accomplish.

Now, about the current issue of the icon not appearing until I log out then log back in. Any ideas? Thanks.

dnanian
02-05-2006, 04:11 PM
Unfortunately, doing that would require dynamically modifying the icon itself; mail does it because it owns its dock icon, but we'd have to go behind Finder's back. I'm not sure that's really practical.

Regarding the icon -- try relaunching Finder by Option-Control-Clicking its dock icon and choose "Relaunch".

jwheare
04-21-2006, 06:17 PM
Is there no way to reset the volume icon via the script? Seems a bit of a kludge to have to relaunch the Finder.

A better solution to this issue would probably be an option to ignore specific files on the target volume.

Thanks for this interim solution :)

dnanian
04-21-2006, 06:20 PM
Well, the icon does reset in the script, but it seems to be that killing and restarting the Finder on the user is kind of unclean. It'd probably be better for the Finder to get fixed... ;)

jwheare
04-21-2006, 06:22 PM
Probably but what are the chances of that?

Yeah yeah, bug report yada yada ;)

jwheare
04-21-2006, 07:56 PM
Alternatively, what's the best way to safely unmount/remount the volume via the shell script? umount yielded slightly scary results when I tried it in the terminal.

Cheers.

dnanian
04-21-2006, 08:40 PM
You can unmount/remount using the same general script that you'll find elsewhere on the forums (where it's used during scheduled backups). Basically, you use diskutil...

mypointofview
05-22-2006, 09:48 PM
I'd like to continue the discussion in this thread towards talking about the desktop image. The real reason for people wanting to have a different icon on their backup drive is, i guess, to not get fooled. Because the backup is a duplicate and looks the same.

When I troubleshoot a computer problem or wander on my backup for other reasons I find myself often forgetting that I'm actually on a backup :o

Therefore I like to have a different desktop picture on my backup drive - automatically.

How to do this? I believe the procedure is similar as with the volume icon, but I don't know which files to exclude for this - perhaps some Preference file?

Here's an crazy idea: how about if SuperDuper overlays the backup desktop automatically with a "SuperDuper!" logo/desktop? I could then always change that easily if I'd wanted to continue "living" on that backup volume...

Sincerely, Martin.

dnanian
05-22-2006, 10:06 PM
This wouldn't be that easy to do, Martin... I'm also not so sure I would *want* to modify a backup for something like this.

That said, it's possible you could have a regular picture you're using for the desktop image, and then change that file (same name) with another one in a post-copy script...

mypointofview
05-23-2006, 07:03 PM
I'm ready to try the postscript technique now.

Because the following did not work: place a different picture with the same name, same access date, same modification date and same creation date into the same directory in the target volume.

SuperDuper! did overwrite it!

Actually this was a correct action, because there was a difference -- the file size. Yet all this is not so easy to understand. :cool:


Sincerely, Martin.

mypointofview
05-23-2006, 09:38 PM
I have now tried to run a shell script after backup to create an icon on the target drive but it did not work. Here's what I did:

1. I downloaded the shell script (can't remember - it was on this forum, perhaps this thread). It shows up on my computer as a UNIX deamon (brownish rectangle) and it's called set_icon (no suffix). I opened it with BBEdit out of curiosity and it says:

#!/bin/sh
echo "Restoring icon for $3..."

if [ -e $HOME"/Volume Icons/$3.VolumeIcon.icns" ]; then
cp $HOME"/Volume Icons/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
/Developer/Tools/SetFile -a C "$4"
fi

2. I got an icon from my Pixadex collection where I did an export as ICNS. I created a folder named Volume Icons inside my Home Library folder (to have it in a safe place). The icon I renamed as the-volume-name.VolumeIcon.icns - in my case G4 Factory.icns.

3. I launched SuperDuper! and called up my favorite Backup copy script Backup - all files (no HD icon) which is a slightly modified script that will ignore the files Icon and .VolumeIcon.icns from the top level of the master volume.

4. I went into Options > Advanced and checked the box "Run shell script...". Then I clicked the button "Choose" next to it and selected the set_icon shell script described above.

5. I did the Backup - all files (no HD icon).

6. Upon completion the new icon was not there. I looked at the volume also via Get Info in case the finder window had not been refreshing but it was just the generic drive icon.

Questions: Since I followed essentially the instructions... how do I know if I have the developpers tools installed? And: did I place the icon into the right place so that the script could actually be able to find it?

Thanks Dave for all your support. I have zero clou about Shell scripts :confused:

Sincerely, Martin.

dnanian
05-23-2006, 09:48 PM
Two things to check. First, log out and back in, and tell me if the icon is there.

If not, check to see if you have a "Developer" folder at the top of your drive. If not, use your Tiger disks to install them. Then, give it another try.

mypointofview
05-25-2006, 10:24 PM
The icon did not show. Also I don't have the developpers folder on the top level of my drive. So it did not work because that's what was missing.

So I then went ahead and started installing XCode from the Tiger install DVD -- but hey, it wants to install 1.5 GB :eek: ...

Thanks Dave, but I guess I rather use that space for some cool movie or music (unless you have a trick for me - could I install just a component of XCode perhaps? or is it one of the other "packages"?)

... gosh, what a fuzz just to get an icon excluded from a backup!

Sometimes I therefore really think very nicely about SynchronizePro! (http://www.qdea.com/pages/pages-sprox/sprox1.html) which I used to run on OS9 ... I mean for those type of things like icon or desktoppicture.

On the other hand I really prefer SuperDuper! because of its iTunes style charm - and support ;)

dnanian
05-25-2006, 10:33 PM
The specific program needed is "SetFile", but I don't know what else it depends on. But you could use Pacifist or its equivalent to extract it and put it in /Developer/Tools.

mypointofview
05-31-2006, 06:13 PM
I got it to work :)

My goal was to not have a folder called "Volume icons" on the top level of my home folder. Also I did not want to have that "Developer" folder with 70MB of stuff on the root level of my drive.

Here's what I did:

1. From the Tiger install CD I installed the so-called "Developer Tools". It is not necessary to install that huge XCode package. The Developer Tools install "only" about 70 MB.

2. Once installed, I navigated to /Developer/Tools/SetFile. I put this piece called "SetFile" (looks like a dark brown Unix deamon) into my own directory (the tilde ~ stands for my user name): ~/Library/SuperDuper!/DeveloperTool/. I had to create the folder "SuperDuper!" inside my Library and in there I created the folder "DeveloperTool" (write without space!) where I then put the "SetFile" piece. Attention: "SetFile" must live in a folder without spaces in its name! In other words, from the whole Developer Tools installation you only need that one little piece called "SetFile".

3. I then created the folder ~/Library/SuperDuper!/Shell script/. Into that folder I copied the script "set_icon" which Dave posted in this thread.

4. I created the folder ~/Library/SuperDuper!/Volume icones/. Into that folder I exported from Pixadex (http://www.iconfactory.com/px_home.asp) some nice icons as ICNS. I don't know how to do it without Pixadex, but if you're into icons you probably have that app. The icon must have the name of the backup target volume in it's name. Like so: xxxxxxx.VolumeIcon.icns (xxxxxxx must be replaced with the actual name of your target volume which you choose as "to" volume in SuperDuper!)

5. Now the customization of the shell script "set_icon". I changed the file path in Dave's code in three places. One file path is now correctly pointing to the "SetFile" piece in MY folder structure. Note that I placed "$HOME" in front of the file path so that it can be found in MY Library folder. The other two file paths are also now correctly pointing to my icons. Here's the adapted code. So if you can't find Dave's script, just copy and paste the code below into a text editor and save it with the name set_icon.

#!/bin/sh
echo "Restoring icon for $3..."

if [ -e $HOME"/Library/SuperDuper!/Volume Icons/$3.VolumeIcon.icns" ]; then
cp $HOME"/Library/SuperDuper!/Volume Icons/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
$HOME/Library/SuperDuper!/DeveloperTool/SetFile -a C "$4"
fi


6. Now setting up SuperDuper!. I clicked Options and then Advanced. I checked the last box "Run shell script..." Then click on "Choose". I navigated to ~/Library/SuperDuper!/Shell script/set_icon

I could now trash the whole Developer folder on the root of my drive - I think. Because the most important piece ("SetFile") is now in my own structure. I still have that Developer folder on my drive as I'm writing this, so I don't know if that folder is really needed or not. But before I'd trash it I'd make a copy... ;)


That's it !

dnanian
05-31-2006, 06:33 PM
Glad you were able to get to a solution you're happy with!

john love
07-23-2006, 04:54 PM
Reference script to change icon after smart update

the first 2 lines of your script are:

#!/bin/sh
echo "Restoring icon for $3..."

SD chokes on the 1st line because of insufficient permissions ... in this case the destination is a .dmg file which is located on the 1st of 2 partitions of an external drive and obviously I am the administrator.

My second smart backup will probably have the same problem because the destination is on the 2nd of 2 partitions of the same external drive.

Thanks, Dave

John Love

dnanian
07-23-2006, 04:58 PM
That's because you haven't given the script execute permissions, John. So, in Terminal, you want to do:

chmod +x the-script-file

That should deal with it...

john love
08-02-2006, 07:13 PM
Dave:

Thanks again for the chmod +x fix ... but:

(1) for the first scenario I have in my HOME folder this file = "VolumeIcons:LaCie SandBox.VolumeIcon.icns" whose icon is my special icon and this scenario works flawlessly once I did the chmod +x in Terminal.

(2) for the last scenario I have in the same HOME folder this file = "VolumeIcons:iMac_Internal_DU.VolumeIcon.icns" ... but for this scenario I save all files to a sparseimage file = "iMac_Internal_DU.sparseimage" which when double-clicked expands to "iMac_Internal_DU".

okay, when I run SD on #2, the icon of the original volume = "iMac Internal HD" (which is the same as for #1) gets transferred to "iMac_Internal_DU", that is, no special icon?????

HAALP!!

dnanian
08-02-2006, 08:18 PM
Not quite sure why that would be, but I don't think I considered sparse images when I wrote this. Do you really need your sparse image to have a special icon when mounted, John?

john love
08-03-2006, 11:21 AM
No I do not need to simply because my sparseimage destination has a name (iMac_Internal_DU) that is not identical to the source (iMac Internal HD). I changed the name for the same reason that others have asked for a special icon to differentiate between the source and the destination.

The only reason for this question on sparseimages is strictly a academic curiosity.

Thanks.

dnanian
08-03-2006, 11:24 AM
OK. Not sure why it wouldn't work, but I don't have enough time to do a thorough investigation at this moment... if I had to guess, the volume name isn't being passed through as expected, or is different than the name of the image, or something like that.

When I get a chance, I'll try to run this down....

john love
08-06-2006, 03:53 PM
The non-appearance of the new icon for the disk within the sparseimage is only temporary. This disk image with the wrong icon is still on the desktop ... when I eject the disk and then re-open the sparseimage, the new icon appears.

Not all wasted, however, because in the process of discovering this "feature" I developed a straight AppleScript to effect the same thing:

=====

-- "set_icon_scpt.scpt"
--
-- run after SuperDuper's 'Copy All Files to "iMac_Internal_DU"'

property theSrc : "iMac Internal HD"
property theDest : "iMac_Internal_DU"

property ICONS : "Volume Icons"
property theICON : ".VolumeIcon.icns"

copyAllFiles(theSrc, theDest)

on copyAllFiles(srcDisk, destDisk)

tell application "Finder"
activate

set destDMG to destDisk & ".sparseimage"

set iconFolder to folder ICONS in home
set newIconFile to document file (destDisk & theICON) in iconFolder

set restoreFolder to get original item of (item "Restore" in desktop)

open information window of newIconFile

tell application "System Events"
keystroke tab
keystroke "c" using command down

delay 0.2 -- a tad extra time for copying to complete
end tell

close front window -- info window of newIconFile

open document file destDMG of restoreFolder

repeat until exists disk destDisk
delay 0.2
end repeat

open information window of disk destDisk

tell application "System Events"
keystroke tab
keystroke "v" using command down

delay 0.2 -- a tad extra time for pasting to complete
end tell

close front window -- info window of destDisk

eject disk destDisk
end tell

end copyAllFiles

=====

The reason for the keystroke calls is that according to Apple's AppleScript forum http://bbs.applescript.net/, the:

get info for ...
set icon to icon of it

is broken; so the keystroke approach is necessary until Apple fixes this.

Before I go, is there a way to pass the srcDisk and destDisk parms from SuperDuper to the above AppleScript using $3 and $4, rather than my hard coding them?

***
***

john love
08-13-2006, 02:48 PM
What I was trying to do initially was access within the shell script a specific handler in the AppleScript and that did not work for me.

Then I simply accessed the whole AppleScript from the shell script and within the AppleScript's on run handler accessed the specific handler ... and this worked.

After burrowing around Apple's AppleScript Bulleting Board (http://bbs.applescript.net) , I found out how to pass parameters from within a shell script to an external AppleScript script ...

1) my shell script = "set_icon_shell_script.txt":

#!/bin/sh
echo "Restoring icon ..."

osascript ~/Library/Application\ Support/SuperDuper\!/Saved\ Settings/set_icon_applescript_from_shell.scpt "iMac Internal HD" "iMac_Internal_DU"

2) duped it (so I can retain the original .txt)
3) chmod +x on the copy within Terminal
4) changed the copy's suffix to .command as in "set_icon_shell_script.command"

Then I double-clicked the ".command" file, Terminal started up and it worked, as described below.

Next, is the AppleScript code:

on run parms
set theSrcDisk to item 1 of parms
set theDestDisk to item 2 of parms

copyAllFiles(theSrcDisk, theDestDisk)
end run

on copyAllFiles(srcDisk, destDisk)

-- code

end copyAllFiles

Anyway, it worked.

Just one thing is lacking ... above I have what I call the long-way-around path for the AppleScript file within my osascript call ...

This AppleScript file is in the same Folder as my shell script, yet just using:

osascript set_icon_applescript_from_shell.scpt parm1 parm2

generates "no such file" in the Terminal. ?????

Cheers! :)

John Love

dnanian
08-13-2006, 04:15 PM
That's because the "current directory" isn't necessarily the location of the script. So, you'll really want to put the scpt somewhere you know (e.g. ~/bin) and reference it explicitly.

markstenton
08-31-2006, 01:17 PM
Hi

I have been trying to get this work
Rather oddly the icon is restored after the backup, but seems to have a fuzzy outline. If I then click on the fuzzy harddrive icon it resorts to the generic yellow firewire drive icon.

have you any idea please what I have done wrong?

Thanks

Mark

dnanian
08-31-2006, 01:26 PM
Hm. Are you sure the icns file was taken from an original, non-fuzzy version?

markstenton
08-31-2006, 01:41 PM
Hi

Yes if do the whole process manually, using get info and copy and paste, the the icon looks perfectly Ok.

The other thing that happens is that if I try Get Info on the fuzzy file I cannot paste over the top of it - nothing happens!

dnanian
08-31-2006, 01:42 PM
Right, but did you copy the original icns file from the destination's volume, after you'd pasted it in? And can you look at it in Preview and have it look correct?

Finally, do you have the developer tools installed?

DavidGG
09-19-2006, 11:22 PM
- Create a folder named "Volume Icons" in your Home.
- In there, place the icon you want, for a given volume, named "the-volume-name.VolumeIcon.icns".
- Download the attached and set it as your "after copy" script in Advanced
I may be missing something here, but is there a reason why the user should be bothered with maintaining a "Volume Icons" folder? Wouldn't it be better to use a "before copy" script that saves the icon in /tmp, and an "after copy" script that restores it later?

# Save volume icon
if [ -e "$4/.VolumeIcon.icns" ]; then
cp "$4/.VolumeIcon.icns" "/tmp/$3.VolumeIcon.icns"
fi

# Restore volume icon
if [ -e "/tmp/$3.VolumeIcon.icns" ]; then
cp "/tmp/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
if [ -e /Developer/Tools/SetFile ]; then
/Developer/Tools/SetFile -a C "$4" # Set "custom icon" flag for volume
fi
rm -f "/tmp/$3.VolumeIcon.icns"
fi

Actually, is there a reason SuperDuper doesn't have an option to do this automatically?

dnanian
09-19-2006, 11:29 PM
When this was written, there wasn't both a before and after script... but this should work fine.

We don't have this in there because we're working on a better way, and it's not a big problem for most people (not enough of a problem to add it to the template)...

john love
09-20-2006, 01:08 PM
Dave:

Mu drive layout:

internal = iMac Internal HD
external #1 partition #1 = LaCie Sandbox
external #1 partition #2 = LaCie_External_HD
external #2 = LaCie Data HD

I have several icns in my (your) "Volume Icons" folder for both iMac Internal HD and LaCie_External_HD. External #2 isn't bootable as its name implies.

1) When booted off my internal drive and I want to do a "Copy all" clone of this internal drive to a sparseimage on LaCie Data HD, my special icn (= a star) gets properly copied per your Script (Volume Icons/iMac_Internal_DU.VolumeIcon.icns and the destination being iMac_Internal_DU inside "iMac_Internal_DU.sparseimage") ... success - AFTER I eject the disk image and then re-double click on the .sparseimage file! I still count this as a success, even given the required eject and re-expansion.

2) When booted off my internal drive and I want to do a "Shared Users and Apps" clone of this internal drive to LaCie Sandbox, my special icn (= a clam) gets properly copied per your Script (Volume Icons/LaCie SandBox.VolumeIcon.icns and the destination being LaCie SandBox - not a sparseimage) ... success!

3) Now, the "feature" ...

When booted from either iMac Internal HD or LaCie_External_HD and I want to do a "Copy all" clone of LaCie_External_HD to a sparseimage file on LaCie Data HD, the above "star" icon gets copied (iMac_Internal_DU.VolumeIcon.icns, not LaCie_External_DU.VolumeIcon.icns which is a wrench) ... failure!

The destination is a sparseimage file "LaCie_External_DU" on LaCie Data HD with Volume Icons/LaCie_External_DU.VolumeIcon.icns having the correct icon (= a wrench)

4) I do recall your saying awhile ago that all bets are essentially off for a destination of a sparseimage file ... but I am curious why the sparseimage example for (1) works and the sparseimage example for (3) does not work.

John Love

dnanian
09-20-2006, 01:46 PM
I'm really not sure why this would act any differently, John. Perhaps you can try the alternate approach "DavidGG" has presented for now.

davebarnes
10-19-2006, 01:43 PM
I just finished reading (well, skimming actually) this discussion.

1. I don't want to do any special coding. I could, but I don't want to. I just want to be able to set a parameter in Preferences.

2. I want the desktop icon of the bootable backup volume to be what I set it to before running SuperDuper. That is, I don't want SD to change it.
I want to be able to visually distinguish between my original volume and my backup. It is that simple.

3. So, please consider this a feature request.

thanks,
dave

enaggiar
10-30-2006, 10:09 AM
After spending 30 bucks on this great piece of software, I think it would not be too much to ask if the company could update their software to let the user pick whether or not the disk image should remain after back up.

I second Dave's idea...

Sincerely,

Ed Naggiar

P.S. I tried with no avail to run the script as instructed in this chain.

Toddster63
12-22-2006, 03:49 AM
Put me on the bandwagon to have the program make the backup drive retain it's icon...!

I've tried all night to make the fixes mentioned here work, but to no avail either...

I'm a USER, not a PROGRAMMER...!

UniAce
01-21-2007, 04:50 PM
I will add my voice to those requesting a feature to have the destination drive maintain its own icon.
My destination drive is a second internal hard drive (which i can't eject). Having the icons for my primary (source) and secondary (destination) drives be identical is problematic because it increases the possiblity of accidentally accessing the wrong HD in the finder.

MarkUK
01-23-2007, 02:00 PM
I have a pre-script and post-script which run an automator action:

/Users/mark/SaveBackupIcon.app/Contents/MacOS/SaveBackupIcon
&
/Users/mark/SetBackupIcon.app/Contents/MacOS/SetBackupIcon


I did this for flexibility, automator can do applescript, shellscript etc etc.
Then the save automator action just runs a shellscript to save the icon to my /ICONS directory:

cp '/Volumes/volume/.VolumeIcon.icns' '/ICONS/volume.VolumeIcon.icns'
/Developer/Tools/setfile -a V /ICONS/*.icns


Then my set automator action to put it back runs the following script:

cp '/ICONS/volume.VolumeIcon.icns' '/Volumes/volume/.VolumeIcon.icns'
chown mark:admin '/Volumes/volume/.VolumeIcon.icns'
/Developer/Tools/SetFile -a C '/Volumes/volumes'


I then do a 'Get Specified Finder Items' and that contains the volume whose icon is about to be restored. Pass that into an applescript action:

on run {input, parameters}
tell application "Finder" to update input
return input
end run

Maybe it's of interest to someone, maybe not!

dnanian
01-23-2007, 08:18 PM
Thanks for that, Mark! :)

bbarol
02-01-2007, 06:32 PM
yep, me too. I've tried everything suggested here with no luck. this is admittedly a minor usability issue, but it's getting under my skin a little bit. so please consider this a feature request: have SD preserve custom icons on target volumes. and thanks.

jotaro
02-26-2007, 03:05 AM
Add me to the growing list of SD users who want the icons on the target disks preserved. I know nothing about shell scripts or programming or developer tools. So adding some kind of script to SD isn't feasible for me. I, too, find it a little annoying that my choice is to accept the generic icons or manually replace the personal icons each time. So if the script is simple enough for programmers, perhaps the author of SD could add this little icon function to the next update.

I'm assuming that there will be another SD update even though Leopard's arrival is looming. I'm not technical enough to know whether Time Machine will render SD obsolete. I knew TM was coming but purchased SD anyway in light of the good reviews. So I hope SD will continue to be valuable under Leopard and that the author of SD will add a fix for the icons.

jotaro

AzureeWill
03-28-2007, 07:53 PM
I may be missing something here, but is there a reason why the user should be bothered with maintaining a "Volume Icons" folder? Wouldn't it be better to use a "before copy" script that saves the icon in /tmp, and an "after copy" script that restores it later?

# Save volume icon
if [ -e "$4/.VolumeIcon.icns" ]; then
cp "$4/.VolumeIcon.icns" "/tmp/$3.VolumeIcon.icns"
fi

# Restore volume icon
if [ -e "/tmp/$3.VolumeIcon.icns" ]; then
cp "/tmp/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
if [ -e /Developer/Tools/SetFile ]; then
/Developer/Tools/SetFile -a C "$4" # Set "custom icon" flag for volume
fi
rm -f "/tmp/$3.VolumeIcon.icns"
fi

Actually, is there a reason SuperDuper doesn't have an option to do this automatically?

Playing with scripts/programming is outside my field of expertise, but I really want my custom drive icons to stay the way I have them, so I'd appreciate it if anyone could answer my questions about DavidGG's script. I too would like to avoid maintaining a "Volume Icons" folder, but am a little sketchy on how to implement DavidGG's workaround.

1) I feel quite ignorant asking, but... if I copy this script off the forum page, what do I do with it? Paste & save in TextEdit or? Do I have to save it in a particular location?

2) Do the custom drive icons have to have been changed in any particular way in the first place in order for this script to do its job? I've simply done the quick copy-paste of the icon image in the Get Info window, didn't use CandyBar or anything.

3) Where it says "$3" and "$4", do I need to change that to match the actual names of my particular volumes? And if so, which one refers to the Target and which one refers to the Source?

Thank you for any guidance you can give!

As other users have stated, I too would appreciate future updates to SuperDuper! to include the option of maintaining custom drive icons. As simple as the little things are to change in the first place, I really don't like having to tinker with programming in order to put them back the way I had them before running a SuperDuper SmartUpdate. I'd prefer to leave the programming to the SuperDuper programmers, so they can implement a clean and elegant solution to the icon issue, just as they've created such a clean and elegant backup solution!

dnanian
03-28-2007, 08:01 PM
You'd need to create two files -- plain text ones -- with those commands in them. The actual files would be:

saveicon.sh:


#!/bin/sh

# Save volume icon

if [ -e "$4/.VolumeIcon.icns" ]; then
cp "$4/.VolumeIcon.icns" "/tmp/$3.VolumeIcon.icns"
fi


restoreicon.sh:


#!/bin/sh

# Restore volume icon

if [ -e "/tmp/$3.VolumeIcon.icns" ]; then
cp "/tmp/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
if [ -e /Developer/Tools/SetFile ]; then
/Developer/Tools/SetFile -a C "$4" # Set "custom icon" flag for volume
fi
rm -f "/tmp/$3.VolumeIcon.icns"
fi


These would have to be saved in those files, then each would have to be marked as executable. That would involve a command in Terminal (assuming they're in your Home fodler):


chmod +x ~/saveicon.sh ~/restoreicon.sh


Thanks for the other comments.

AzureeWill
03-28-2007, 08:09 PM
Thanks Dave! I'll save the script as you've instructed ang give it a go. Would you happen to have any answers for my questions 2) & 3)?

SuperDuper is so nice & easy, I may even switch my parents over to it, but I need to resolve this little icon issue first or they will quickly get confused about which drive/partition is which. It's all about the pretty pictures making everything clear for them! :)

dnanian
03-28-2007, 08:14 PM
Remember: if you eject the drives, we'll mount them, back up and unmount them. Can't get confused if they're not there.

TimLawson
04-21-2007, 06:28 AM
Thanks Dave! I'll save the script as you've instructed and give it a go. Would you happen to have any answers for my questions 2) & 3)?

Would it be possible, please Dave, to have the answer to '3' in particular? I'm confused (as a non-programmer) as to exactly what the $3 and $4 means although suspect they are drive references. For example, in the Info pane of Disk Utility, I see that my Mac HD is described as 'disk1s3' and my FW rive as 'disk2s3', so would that be $1 and $2 in your code? Or what?

Tim.

TimLawson
04-21-2007, 06:44 AM
I have a pre-script and post-script which run an automator action:

/Users/mark/SaveBackupIcon.app/Contents/MacOS/SaveBackupIcon
&
/Users/mark/SetBackupIcon.app/Contents/MacOS/SetBackupIcon


I did this for flexibility, automator can do applescript, shellscript etc etc.
Then the save automator action just runs a shellscript to save the icon to my /ICONS directory:

cp '/Volumes/volume/.VolumeIcon.icns' '/ICONS/volume.VolumeIcon.icns'
/Developer/Tools/setfile -a V /ICONS/*.icns


Then my set automator action to put it back runs the following script:

cp '/ICONS/volume.VolumeIcon.icns' '/Volumes/volume/.VolumeIcon.icns'
chown mark:admin '/Volumes/volume/.VolumeIcon.icns'
/Developer/Tools/SetFile -a C '/Volumes/volumes'


I then do a 'Get Specified Finder Items' and that contains the volume whose icon is about to be restored. Pass that into an applescript action:

on run {input, parameters}
tell application "Finder" to update input
return input
end run

Maybe it's of interest to someone, maybe not!
I feel bad asking, but would it be possible, please, to have step-by-step instructions for a non-programmer to be able to do this? Grovel, grovel! :o

Tim.

dnanian
04-21-2007, 11:17 AM
The User's Guide section on these shell scripts explains what the $-parameters all are. Basically, they're arguments that SD! passes to the script so you can tell what's going on.

The icon should be copied from its "on-disk" format, not from the Get Info dialog (which won't work). So, you do need to copy the file as explained in the original post...

gryphonent
04-25-2007, 03:55 AM
Dave,

I've been a registered user for a while and overall I'm pretty happy with SuperDuper. However, I don't want to play around with scripts and the like. I've made this point numerous times before and I just don't get why you are so hesitant to listen to users and fend off whatever feature request comes your way. Are you not interested in improving your software? Please provide an option in the preferences tab to keep the target volume. I want a simple checkbox to click. No fumbling around with scripts and reading through this forum, trying various ways how to achieve a simple task.

Your software claims to be easy to use... it is, however, only to a degree. I don't want to open the hood. More regular updates would be truly appreciated. It would also provide greater exposure on Versiontracker and Macupdate, probably boosting your sales. Think of it that way.

dnanian
04-25-2007, 08:25 AM
Believe me, I'm not at all reluctant to listen to users, and I do not "fend off" features. I'm well aware of this particular request, and it's something we're looking at, but it's more complicated that you might think to do properly, and is gated on some other things we're working on.

We cannot update a product like SuperDuper! frequently. Providing you with a reliable solution is far more important than exposure on VT/MU, and that means careful engineering and extensive testing.

I'm sorry that this particular design choice is frustrating you and others, but there are solutions in this thread that will do the job until a carefully designed and thoroughly tested internal solution can be made available.

gryphonent
04-25-2007, 06:09 PM
Dave,

Thanks for your reply... but considering that the initial request was posted on 2nd December 2005 your timetables are as believable as those issued by the Bush regime.

dnanian
04-25-2007, 07:20 PM
I'm sorry to disappoint, but we have things that are of higher priority. That doesn't mean I'm ignoring the request.

mypointofview
05-01-2007, 09:28 PM
1. Download this here: http://uk.geocities.com/galery003/superduper/Icon_for_Target_Volume.zip

2. Put folder "SuperDuper!" into your user's Library folder and (important) customize the icon names!

3. Select "After copy" script as explained in the note.

Please give feedback if it works or if it doesn't. It works for me on OSX 10.48 with SuperDuper! version 2.1.4.


Martin

PS: you can use your own icons, for example exported from Pixadex. Pixadex is a great icon management application. Be sure to use only icons in ICNS file format.

GMacSpark
09-29-2007, 08:02 AM
I was also one of those a little peeved at having to manually restore the icon on my target volume after a backup, but then it occurred to me: instead of having to restore it, why not simply avoid having it overwritten in the first place?
Just add a script command that ignores /Volumes/(your source volume)/.VolumeIcon.icns and your target volume icon should remain untouched. Any reasons this shouldn't work? (No, I haven't tried it yet - I just thought of it :^)

Gary

dnanian
09-29-2007, 09:20 AM
Yes: that ignores it from the source, which means it's not present in the set of files. As such, it'll be removed from the destination on a Smart Update.

GMacSpark
09-29-2007, 10:58 AM
Ah.... yes, I see your point. So, in that case, if it was removed from the destination, it would revert to a generic icon on the target volume. Oh well, it was a good idea while it lasted :^)

Thanks for the quick reply,

Gary

Jeffus
12-08-2007, 08:18 AM
I will add my voice to those requesting a feature to have the destination drive maintain its own icon.
My destination drive is a second internal hard drive (which i can't eject). Having the icons for my primary (source) and secondary (destination) drives be identical is problematic because it increases the possiblity of accidentally accessing the wrong HD in the finder.

Ditto to UniAce, nicely worded UniAce, my destination disc is external but it would be a huge bonus leaving the icon different to the main HD so as you don't get them mixed up. Come on Shirt Pocket, show 'em how good you are (to quote the Spice Girls). ;)