In recent versions of OS X, launched has superseded the cron utility. SANmp CLI mode works well with this method of launching.
As an example, I have created the following script, which will log in to SANmp, mount Vol1 and Vol2 as RW, and then create a file on each, named for the current date and time. It then unmounts them and logs out.
#!/bin/bash
VOLS="Vol1 Vol2"
/opt/local/bin/SANmpClient login 1 1
for VOL in $VOLS; do
/opt/local/bin/SANmpClient mount volume $VOL RW
touch /Volumes/$VOL/`date +'%Y-%m-%d_%H-%M'`
/opt/local/bin/SANmpClient unmount volume $VOL
done
/opt/local/bin/SANmpClient logout
In the home directory of my user ("admin"), I created a directory called "bin", and placed this script inside that with a filename of SANmpTag.bash. I then made the script executable with "chmod".
Next, I created a directory at ~/Library/LaunchAgents which the launchd process scans for plist files. I created the following file with a name of com.studionetworksolutions.SANmpTag.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.studionetworksolutions.SANmpTag</string>
<key>ProgramArguments</key>
<array>
<string>/Users/admin/bin/SANmpTag.bash</string>
</array>
<key>Nice</key>
<integer>1</integer>
<key>StartInterval</key>
<integer>600</integer>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/SANmpTest1.err</string>
<key>StandardOutPath</key>
<string>/tmp/SANmpTest1.out</string>
</dict>
</plist>This launchd plist will execute the script every 10 minutes (600 seconds), and redirect the output to a couple files in the /tmp/ directory.