Jun 23, '09 07:30:03AM • Contributed by: spartanoverseas
The quick summary of my solution is:
- Move ~/Music/iTunes to ~/Music/iTunes.local
- Move ~/Pictures/iPhoto Library to ~/Pictures/iPhoto_Library.local
- Make a link from ~/Music/iTunes to ~/Music/iTunes.local
- Make a link from ~/Picutres/iPhoto_Library to ~/Pictures/iPhoto_Library.local
- Write a script to change the links to the appropriate library upon mount
- Write a script to change the links to the appropriate library upon unmounting the external disk
- Use Lingon to make my mounting script run when a disk is mounted.
- Use Lingon to run my unmounting disk when the mount point changes.
My Mounting Script:
#!/bin/bash
HOME=/Users/username
GRAID_MOUNT="/Volumes/G-RAID_MINI"
IPHOTO_TAIL="iPhoto_Library"
IPHOTO_TAIL_LOCAL="iPhoto_Library.local"
IPHOTOLIBRARY_LINK=$HOME/Pictures/$IPHOTO_TAIL
IPHOTO_GRAID=$GRAID_MOUNT/Photos/$IPHOTO_TAIL
IPHOTO_LOCAL=$HOME/Pictures/$IPHOTO_TAIL_LOCAL
ITUNES_LINK=$HOME/Music/iTunes
ITUNES_GRAID=$GRAID_MOUNT/Music/iTunes
ITUNES_LOCAL=$HOME/Music/iTunes.local
if [ -d $GRAID_MOUNT ]; then
echo ........ G-RAID MOUNTING ..........
`rm $IPHOTOLIBRARY_LINK `
`ln -s $IPHOTO_GRAID $IPHOTOLIBRARY_LINK`
`rm $ITUNES_LINK`
`ln -s $ITUNES_GRAID $ITUNES_LINK`
echo DONE CHANGING IPHOTO AND ITUNES LINKS
exit 0
fi
echo ERROR DISK NOT MOUNTED#!/bin/bash
HOME=/Users/username
GRAID_MOUNT="/Volumes/G-RAID_MINI"
IPHOTO_TAIL="iPhoto_Library"
IPHOTO_TAIL_LOCAL="iPhoto_Library.local"
IPHOTOLIBRARY_LINK=$HOME/Pictures/$IPHOTO_TAIL
IPHOTO_GRAID=$GRAID_MOUNT/Photos/$IPHOTO_TAIL
IPHOTO_LOCAL=$HOME/Pictures/$IPHOTO_TAIL_LOCAL
ITUNES_LINK=$HOME/Music/iTunes
ITUNES_GRAID=$GRAID_MOUNT/Music/iTunes
ITUNES_LOCAL=$HOME/Music/iTunes.local
if [ -d $GRAID_MOUNT ]; then
echo GRAID NOT UNMOUNTED
exit 0;
fi
echo ..... GRAID IS BEING UNMOUNTED
`rm $IPHOTOLIBRARY_LINK `
`ln -s $IPHOTO_LOCAL $IPHOTOLIBRARY_LINK`
`rm $ITUNES_LINK`
`ln -s $ITUNES_LOCAL $ITUNES_LINK`
echo DONE UNMOUNTING GRAID-
com.username.Folderactions.GRAIDMount:
- What: points to my mount script
- When: Run it everytime a volume is mounted
-
com.username.Folderactions.GRAIDUnmount
- What: points to my unmount script
- When: Run if this file is modified: /Volumes/G-RAID_MINI
If anyone sees any errors in this, or has any thoughts on a better way to get this done, I'd be interested in reading what you have to say.
