Can someone see any obvious reason my plist isn't trigger scripts correctly?

New Contributor III

I have this .plist called update.plist and I wan't it to trigger a shell script called every minute (changing to weekly after testing) and this is what the plist looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Is there something obvious that I'm missing or that I should be looking for? The script isn't triggering, however when i run the script locally, it works.

The script is as such

sudo /usr/local/bin/jamf policy -trigger weeklyupdate
exit 0

Valued Contributor II

Have you tried removing the <string>sudo</string> line from the plist and the sudo from your script?
Also what are the permissions on each file?

Honored Contributor III

Here are some handy resources when it comes to LaunchAgents and LaunchDaemons...

Pretty much everything you need to know about creating them: A launchd Tutorial

A great tool for creating, and troubleshooting, them: LaunchControl - The launchd GUI

Valued Contributor
Valued Contributor

Are you trying to run this as a LaunchAgent or LaunchDaemon? Since you need to run this as an administrator, you can remove the sudo part and just run this as a LaunchDaemon. Also make sure your plist has the proper permissions chown root:wheel /path/to/plist and chmod 644 /path/to/plist