What is best practice for creating an automatism that automatically reinstalls deleted files?

mallej
New Contributor III

Hi,

if i want to be sure that after deployment with Jamf a file (i.e /usr/local/bin/dockutil) persists on the mac, what is best practice to accomplish that with jamf?

I think a combination of Extension Attributes, Smart Groups and Policies will work, but I'm wondering if anyone has figured out what works best yet. Maybe so that it is universally applicable and easily reusable.
Maybe someone has written an article about it?

Many thanks in advance

 

1 ACCEPTED SOLUTION

pete_c
Contributor III

Create a policy to install dockutil, scoped to all devices and set for Ongoing execution with a custom trigger (I am partial to action-item, such as "install-dockutil").

Then in the other policy, use an "if" statement to check for the presence of dockutil, and if missing ("-z" flag), jamf policy:

 

if [ ! -e "/usr/local/bin/dockutil" ]; then
    echo "Installing dockutil..";
    /usr/local/bin/jamf policy -trigger install-dockutil;
    sleep 5;
else
    echo "dockutil found at /usr/local/bin/, proceeding.."
fi

 Make it modular and repeatable. No (real) need to bother with an EA.

View solution in original post

3 REPLIES 3

efil4xiN
Contributor II

Config Management ie:Puppet,Ansible etc. Some use ( insert tool here - nessus, nexthink, tanium) to monitor the directoty and then run a script. many ways to this

pete_c
Contributor III

Create a policy to install dockutil, scoped to all devices and set for Ongoing execution with a custom trigger (I am partial to action-item, such as "install-dockutil").

Then in the other policy, use an "if" statement to check for the presence of dockutil, and if missing ("-z" flag), jamf policy:

 

if [ ! -e "/usr/local/bin/dockutil" ]; then
    echo "Installing dockutil..";
    /usr/local/bin/jamf policy -trigger install-dockutil;
    sleep 5;
else
    echo "dockutil found at /usr/local/bin/, proceeding.."
fi

 Make it modular and repeatable. No (real) need to bother with an EA.

mallej
New Contributor III

hi, @pete_c ,

Thanks, sounds good. I will try that out.