Race between policy script and macOS update - which happens first?

dacontracta
New Contributor II

Hey Jamf Nation! I have a short script set to run once per computer at recurring check in. I am also about tell Jamf to update macOS from 14.7 to macOS 15. I believe individual Macs check for macOS updates as part of the recurring check in (very easily could be wrong!). My question is, which happens first? If a Mac contacts Jamf as part of a recurring check in, and finds out it is due for both a script to run and a macOS update, which does it do first?

Thank you all!

1 ACCEPTED SOLUTION

in this case, there is a high chance your policy which contains the script will run first .

View solution in original post

6 REPLIES 6

Shyamsundar
Contributor

Your policy which contains script execute , as macOS updates it need to download the updates and it depends on what option you selected to restart the device , whether you given deferral or scheduled based on that users can defer the restart , hence there are high chance your script will execute first , 

I see! So even if the update starts first, the update process isn't a blocking process. The script will still be run while the macOS update is downloading. So as long as my script is fast enough to finish before the update is done downloading, we're good! Am I understanding right?

Users might defer the restart, but I'm sure at least one will not. Law of large numbers and all. To be safe let's assume they don't defer the restart and schedule it as soon as possible, installing right away.

Thank you for the help!

AJPinto
Honored Contributor III

It depends on how you write the script. 

 

Macs check for OS updates every 24hrs, and will check whenever they receive an OS update MDM/DDM Command.  If your script has softwareupdate -l in it, this will tell Macs to check for available updates with the script and it will happen at whatever order you place it within the script. 

 

Be aware, it is no longer recommended and in most cases not possible to install OS updates with a script. Baring any API stuff you are doin with Jamf.

dacontracta
New Contributor II

My script doesn't include softwareupdate -l in it, no worries. It also doesn't update the OS. The OS update is being pushed out through Jamf's web interface, not by a script. The only thing the script does is uninstall a program. Does that help clarify which would happen first?

in this case, there is a high chance your policy which contains the script will run first .