Orphaned Scripts

Jason
Contributor II

Is there a way to identify if a script has been orphaned? For example, if a script is in the JSS but is not linked to any Policy or Configuration. I'm doing some cleanup and that would be a helpful starting point.

5 REPLIES 5

thoule
Valued Contributor II

I think there's a feature request for that once a week or so. While I personally use an intern to check all smart groups, extension attributes, scripts, printers and more to see if they are all used in a policy, not everyone has that option.

Spruce is an option by Shea Craig (https://github.com/sheagcraig/Spruce). It may take some work to get it going, but it can look for fluff left over due to JAMF's unnecessarily sloppy design (yeah, I said it!).

(p.s. I'm the intern)

mm2270
Legendary Contributor III

Not built in. Hence the reason for Feature Request like this one.

I have API scripts that do some cross referencing and build csv files for other stuff, like Packages, groups and policies, but nothing for scripts currently. Truthfully, scripts take up so little space physically and visually that I don't see the need personally to do major cleanup on them, but I can understand why you might want to.
If I had the time right now I would revise one of my scripts to build the same kind of report for Scripts, but that may take a while for me to get to it.

Jason
Contributor II

It's not so much about the space. I like to go through each script when we upgrade from one version of OS X to the next to validate that there is nothing in them that will break. To speed up that process i'm looking for orphans so that i can rule those out as being an issue.

I've not previously heard of Spruce but will check it out. I've also up-voted that feature request.

mm2270
Legendary Contributor III

I hear you. In fact, we need to be doing the same thing as we move finally toward making El Capitan our standard here. I know that at least some of our stuff (packages, scripts, policies) will break, since some of them may be trying to do things within now SIP protected locations. The jamf binary stuff has all been squared away by the JSS upgrade, but that's only one part of the picture.

For now I would go ahead and look at Spruce. Back when I first used/saw it, it wasn't exactly what I needed, but that may have changed, since I haven't looked more recently. Let us know how it works for you.

bentoms
Release Candidate Programs Tester

@Jason Spruce as @mm2270 mentioned, will help clear out unused scripts.

You can run it in a way that only advises what's not used & then you can manually remove.