

Skipping it."ĭone < <(ls "/Library/Application Support/JAMF/Waiting Room/")Įcho "No Waiting Room directory, so no cached packages"Įdit: Changed the rm line to account for both flat files and bundle packages. Rm -Rfd "/Library/Application Support/JAMF/Waiting Room/$cache"Įcho "The cache file is not a previous version. clean: Delete all data out of the cache folder.

This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly. add: Add the specified package to the local cache. #!/bin/bashĬurrPolicyName=$(awk -F'Policy ' '/Executing Policy/." Used to add, list, or clean the npm cache folder. Test, test and do more testing, since this is deleting items. Its a little dangerous though since, if you're not careful how you name stuff, you could end up matching other valid caches and deleting those as well.īut give this a try. Since the jamf.log will have the policy name in it as it runs, if we grab the running policy name and do a partial string match on any cached items using that, we can target the correct packages to rm from the folder and potentially leave any others. If so, you could try something like this as a Before script. For example, using your Skype example above, if the policy name has the word Skype in it somewhere, like "Install Skype" or "Skype 6.19.0.442" and the packages all have the term "Skype" or "skype" in them, like with your example.

The only way you could semi automate this would involve making absolutely certain your policy names have the same (partial) string in them as the package names AND also that your packages have the name of the application in them that would match something in the policy name. Or something like what nessts posted above. Using a script as you posted above is going to be the most reliable way to do this.
