KB Home | Auto Mount a SMB Share at Boot On Mac OS X
As part of PaperCut’s Print Archiving feature on a Mac OS X secondary server you may need to automatically mount a SMB share so that the PaperCut Print Provider can provide the appropriate files for archiving by the PaperCut Application Server.
We have had an elegant solution presented to us by one of our customers - Sam from MacKillop College in Australia.
The resolution I came up with has two parts, a shell script and a launchd.
A shell script papercutmount.sh:
# Source variables from print-provider.conf
. /Applications/PaperCut\ MF/providers/print/mac/print-provider.conf
# Log in as local PaperCut account and execute all following commands as this user
su papercut << EOS
# Create a folder to mount to
# Mount the share
mount -t smbfs //$ArchiveUser:$ArchivePass@$ApplicationServer/archive $ArchiveDir
And the launchd saved in /Library/LaunchDaemons/com.papercut.maparchive.plist (note to change the path to the shell file)
One final note is that if the PaperCut Application Server is rebooted, the mounted shares are disconnected and the Mac OS X Secondary Print Server will fail to save the print archive files. The quickest fix is to re-run the script or reboot the Secondary server.