Jump to content

Desktop folder redirection in 10.5?


Recommended Posts

Posted

Hello again!

 

We are experimenting with setting our 10.5.5 iMacs to run a 'localhomes' set-up. This means that when a user logs in they are given a fresh home folder from a template, with links made to their documents on the network. A script performs the template copying and redirection on login. This works perfectly on our 10.4.11 machines, but under 10.5 the 'Desktop' folder will not redirect!

 

I was looking at cache redirection on the forums here, and was thinking if there was a way to delete the /Users/%@/Desktop folder, and make it link to their Desktop on the network?

 

Is there are variable like '%@' for user, for the home path?

 

Thanks!

Posted (edited)
Hello again!

 

We are experimenting with setting our 10.5.5 iMacs to run a 'localhomes' set-up. This means that when a user logs in they are given a fresh home folder from a template, with links made to their documents on the network. A script performs the template copying and redirection on login. This works perfectly on our 10.4.11 machines, but under 10.5 the 'Desktop' folder will not redirect!

 

I was looking at cache redirection on the forums here, and was thinking if there was a way to delete the /Users/%@/Desktop folder, and make it link to their Desktop on the network?

 

Is there are variable like '%@' for user, for the home path?

 

Thanks!

 

In osx, the tilde ~ character designates current users home folder. So you'd have ~/Desktop or ~/Documents. That's it. As far as i'm aware that will only work with the current logged on user but i see no reason why you can't use that in a script....although i'm not sure if it might be applescript or bash specific.

 

btw, i'd be interested in seeing that script, if your happy to share. We want to setup something akin to manadatory profiles for network home folders on 10.4 and we want more granular control over things like access to the desktop for users - so that script sounds quite useful ;)

Edited by torledo
Posted

Here's our script:

 

#!/bin/bash

# Leopard Localhomes script July 2008

homePath=`/bin/ls /Volumes/ | /usr/bin/grep "NetworkHomes\|year\|extra"`
if [ "$homePath" ]; then

######## Softlink homefolder

       # Remove the dummy desktop if it's there
       /bin/rm -rf /Users/${USER}/Desktop

    # Check the Desktop folder exists then softlink
       if [ ! -d /Volumes/$homePath/$USER/Desktop ]; then
               mkdir /Volumes/$homePath/$USER/Desktop
       fi
       /bin/ln -Fs /Volumes/$homePath/$USER/Desktop ~/Desktop

       # Check the Documents folder exists then softlink
       if [ ! -d /Volumes/$homePath/$USER/Documents ]; then
               mkdir /Volumes/$homePath/$USER/Documents
       fi
       /bin/ln -fs /Volumes/$homePath/$USER/Documents ~/Documents

       # Check the Pictures folder exists then softlink
       if [ ! -d /Volumes/$homePath/$USER/Pictures ]; then
               mkdir /Volumes/$homePath/$USER/Pictures
       fi
       /bin/ln -fs /Volumes/$homePath/$USER/Pictures ~/Pictures

       # Check the Music folder exists then softlink
       if [ ! -d /Volumes/$homePath/$USER/Music ]; then
               mkdir /Volumes/$homePath/$USER/Music
       fi
       /bin/ln -fs /Volumes/$homePath/$USER/Music ~/Music

       /bin/rm ~/Library/Preferences/com.apple.sidebarlists.plist
       /bin/chmod a-w /Users/$USER

###### Create C13 SMHF subfolders
              # Check we are in C13
               if [ `hostname | grep C13` ]; then
                       # Check that the folder doesn't already exist
                   if [ ! -d /Save\ Movie\ Here\ First/${USER} ]; then
                   mkdir /Save\ Movie\ Here\ First/${USER}
                   chmod -R 770 /Save\ Movie\ Here\ First/${USER}
                   fi
               fi

    
 # Restart Finder
 killall Finder
       
# Inform User config is done
osascript -e 'tell application "Finder"' -e 'display dialog "This Mac OS X Leopard Computer is now ready for you to enjoy" buttons {"OK"} default button 1' -e 'end tell'  
else
       osascript -e 'tell application "Finder"' -e 'display dialog "Unable to connect to homefolder"' -e 'end tell'
fi

 

Linking to documents works, as does everything else. It just WON'T do the desktop! It leaves the user's local desktop folder in place like it's ignoring that part.

 

We found Mike Bombich's scripts useful on his site, if that helps with your mandatory profiles set-up.

  • 7 months later...
Posted
We didn't. In the end we ended up sticking with Network Home Folders (roaming profiles). The slowness which prompted me to try out this redirection was actually down to misconfigured DNS.
Posted
I ended up sticking with Network Homes. I redirected most of the contents of the Library folder to the local drive using WGM. The performance increase is very noticable!
  • 7 months later...
Posted
If you are using 10.5 Open Directory and it's subsequent Folder Redirection, you cannot create a redirection to force the user’s home, or a sub-folder, to an upstream or network location. These redirections take place before any mount points are available, so the redirection would fail.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...