Eksempel på daglig autopkg kjøring

Her er et enkelt oppsett dersom du ønsker å kjøre autopkg som en launchd jobb.

Først et shellscript som sjekker etter nye programmer.

  • Legges et lurt sted (f.eks: /usr/sbin), kall den for eksempel autopkg_run.sh
  • chmod +x autopkg_run.sh for å gjøre scriptet eksekverbart
#!/bin/sh
/usr/local/munki/makecatalogs /Data/Munki/repo/
/usr/local/bin/autopkg run -v 1Password.munki
/usr/local/munki/makecatalogs /Data/Munki/repo/

 Så en launchd jobb som kjører scriptet

  • Legges i folderen /Library/LaunchDaemons
<?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>no.uib.klientdrift.autopkglauncher</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/usr/sbin/autopkg_run.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/var/log/autopkg_error.log</string>
<key>StandardOutPath</key>
<string>/var/log/autopkg_out.log</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>10</integer>
<key>Minute</key>
<integer>30</integer>
</dict>
<key>Debug</key>
<true/>
</dict>
</plist>

 

Leave a Reply

Your email address will not be published. Required fields are marked *