Skip to main content
Question

Question regarding policy execution via script......

  • January 11, 2019
  • 1 reply
  • 10 views

Forum|alt.badge.img+8

Hey all, when a script is used to execute policies.... example....

/blahblah/jamf policy -id ####

/blahblah/jamf policy -id ####

/blahblah/jamf policy -id ####

Does each policy finish 100% before it executes the next?

Also, I see people mentioning the ampersand (&) when referring to executing policies in scripts... how is that utilized please?

Thank you in advance!

1 reply

Forum|alt.badge.img+10
  • Valued Contributor
  • January 11, 2019

My understanding is that each policy has to finish before the next policy can run. As far as the & in a shell script or just in terminal you can string commands together using a double &&. For example I use the following often in terminal.

sudo jamf recon && sudo jamf policy && sudo jamf manage

Basically means:

Run the first command if it completes successfully run second command and if it completes successfully run third command.

You could also use a ; if you wanted the second and third command to run regardless of how the previous command finished.