Crontab in script

barmaglot
New Contributor

Hello.
There is a script distributed by the policy:

echo "1 * * * * ~/userscript > /Users/$3/crontab

crontab -u "$3" /Users/$3/crontab

But it fails with an error:

Script result: crontab: tmp/tmp.3896: Operation not permitted

In the console, I add the terminal application to the full access list and it works from the terminal, but what can I add in privacy for policies?

1 REPLY 1

elliotjordan
Contributor II

Hi @barmaglot - Could you provide a bit more info about what you're trying to accomplish? It seems like you might be better served by installing a simple LaunchAgent that references the script with a `StartInterval` or `StartCalendarInterval`. A good resource for LaunchAgent info is https://launchd.info/