• Mac OS X Server

    Mac OS X Server: Sharing Files from the Command Line

    Mac OS X Server provides the sharing command.  You can create, delete and augment information for share points using sharing. To create a share point for AFP you can use the following command: sharing -a <PATH> -A <NAME> So let’s say you have a directory at /Shares/Public and you want to create a share point called PUBLIC.  You can use the following command: sharing -a /Shares/Public -A PUBLIC Now, the -a here will create the share for AFP but what if you want to create a share for other protocols?  Well, -F does FTP and -S does SMB.  Once created you can disable the share using the following command: sharing -r PUBLIC…

  • Mac OS X,  Mac OS X Server,  Ubuntu,  Unix

    Creating a crontab

    Creating your first crontab job is a three-part process: Prepare the absolute path to the program or script that you want to run Create a text file containing a line to schedule the job as described above for crontab fields Upload the text file to your system cron When preparing program to run or creating scripts to run remember that crontab jobs are background tasks. There is no terminal attached to a crontab job so there should be no print statements that normally write to the screen. (It is possible to redirect such print statements.) The same consideration hold true for requesting user input. Let’s assume that we want to…

  • Mac OS X Server,  Mac Security,  Mass Deployment,  Xsan

    AFP, Xsan, Failover & Tokens

    When an AFP connection moves to idle, a token is used to establish a reconnect. By default, AFP stores tokens in the local /etc/AFP.conf. But in order to have users reconnect if they move between servers, as in a failoverd event or even in a more active/active relationship with a load balancer you need to move the shared cache to a shared location. To do so you’ll edit the /Library/Preferences/com.apple.AppleFileServer.plist file using the defaults command. The key that you’ll need to change is the reconnectKeyLocation, specifying the string in the key that corresponds to the path to the local server that is running afp to the volume. Therefore, if the…

  • Mac OS X,  Mac OS X Server

    AppleScript and Paths

    When you’re using Applescript to script some events, you’ll need to use a path. For example, if you’re opening an application, you can use the launch application option. When you do so, you’ll need to swap out slashes (/) with colons (:). So, let’s look at Mail.app. The following command in bash would open Mail: open /Applications/Mail.app But to run in Applescript, use the following command: launch application ":Applications:TextEdit.app" or tell application ":Applications:TextEdit.app" to launch Enjoy