Profile Manager- Uploading scripts

Discussion in 'Mac OS X Server, Xserve, and Networking' started by PileOfMac, Oct 21, 2015.

  1. PileOfMac macrumors newbie

    Joined:
    Oct 21, 2015
    Location:
    UK
    #1
    Hi Everyone,

    First time posting! I'm having some issues with OS X Profile Manager, whenever I try to upload a script via the web interface to run on login it tells me the file type is not supported even though its a shell script created on a mac. Any help would be really appreciated as Apple are wasting my time! Thanks in advance :)
     

    Attached Files:

  2. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #2
    Profile Manager is giving you an accurate warning. What file are you trying to upload, and to where?
    What are you trying to do?
     
  3. PileOfMac thread starter macrumors newbie

    Joined:
    Oct 21, 2015
    Location:
    UK
    #3
    Thanks for the reply chrfr! Basically I want rsync to run on login to copy the users desktop and documents to a network share, I was attempting to this through a shell script that runs on login. I can get it to work if I set it locally on each mac but I want to be able to manage this centrally as we have over 30+ macs. Any suggestions?

    Thanks!
     
  4. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #4
    What's your script, exactly? Is it saved as a plain text file with .sh as the extension? I assume you are trying to load it into the Loginwindow settings, under login scripts? I don't know that will work there; putting a LaunchAgent on each client computer is probably a better solution for this.
     
  5. PileOfMac thread starter macrumors newbie

    Joined:
    Oct 21, 2015
    Location:
    UK
    #5
    This is the script =

    #!/bin/bash
    # RSYNC Backup

    rsync -aE --delete ~/Documents/ /volumes/users$/$USER/macdocs/
    rsync -aE --delete ~/Desktop/ /volumes/users$/$USER/macdesktop/

    It was plain text until I made it an executable? (using chmod +x) It might be the case I have to set them all individually but life would be a lot easier if I can centrally deploy this script. I appreciate you taking time out your day to help me with my problem!
     
  6. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #6
    Uploading that works for me, but your script has issues. There's no directory on the Mac called "volumes". Case sensitivity is important. Dollar signs in scripts indicate variables, so you can't use them in your path as they exist here.
     
  7. DJLC macrumors 6502a

    DJLC

    Joined:
    Jul 17, 2005
    Location:
    Mooresville, NC
    #7
    You know you can set up this functionality with Mobile Accounts and the built-in home sync, right? Those options can be managed from Profile Manager. Pretty easy assuming everyone has a network home defined in OD or AD, automatically keeps the whole home folder (or selected parts of it) synced between client and server.
     
  8. PileOfMac thread starter macrumors newbie

    Joined:
    Oct 21, 2015
    Location:
    UK
    #8
    What did you upload it to? The volume is a windows network share that auto mounts. I've found the script works fine!
     
  9. PileOfMac thread starter macrumors newbie

    Joined:
    Oct 21, 2015
    Location:
    UK
    #9
    John Mairs - I didn't know that! You Sir have made my day. Thanks for your help guys!
     
  10. mmilon macrumors newbie

    Joined:
    Nov 19, 2015
    #10
    Apologies for hijacking the thread but i am trying to do something similar without using Mobile Accounts. Anyone know if it is possible to use symlinks to just redirect the "Documents" and "Desktop" folder to the network Home Folder and whether it is possible to deploy using profile manager. If so how would i go about writing the script.

    At the moment i have 24 MacBooks bound to a Mac Server however the macbooks grind to a halt because from what i have read the ~Library folder is located on the Network Share, hence me wanting to just redirect the above folders so that it doesn't matter which macbook a user logs on to they still have access to their documents and desktop.
     
  11. DJLC macrumors 6502a

    DJLC

    Joined:
    Jul 17, 2005
    Location:
    Mooresville, NC
    #11
    So I would reply the same as I did before; I'd advise using a Mobile Account and enabling the Home Sync settings. You can include or exclude whichever folders you wish. So in your case, you could have it auto-sync Desktop and Documents at login and logout and exclude ~/Library.
     
  12. mmilon macrumors newbie

    Joined:
    Nov 19, 2015
    #12
    Thank You. I have been doing as suggested and it seems to be working very well.
     

Share This Page