Crontab in script

New Contributor

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?


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

The user must execute the command in the terminal

crontab ~ / crontab


launchctl load ~/Library/LaunchAgents/

A dialog box appears asking if you want the terminal to write to the disk

When running a script from Jamf, the dialog box does not appear and an filed message appears in the Jamf policy log