Where do you put your scripts?

makander
Contributor

Hi,

Out of curiosity I'm wondering where on the disk you store your custom scripts? Is there a specific path that is preferred or used as best practise when it comes to deploying custom scripts?

7 REPLIES 7

mm2270
Legendary Contributor III

Can you clarify what you're referring to? Do you mean if you need to permanently deploy a script file to a system for later use in a policy?

makander
Contributor

Yeah, that's what I mean. I didn't know how to phrase it better than that. Sorry for the confusion.

mm2270
Legendary Contributor III

That's fine, just wasn't sure.
I wouldn't say there is any real "best practice" for this. We use something like /private/var/scripts/ The "scripts" directory is of course created since it doesn't exist natively, but plenty of people use other paths. Some might even use something like /Library/Scripts/, or /Library/Scripts/CompanyName/

My very general suggestion would be to keep them out of sight from casual browsing, so some normally hidden directory like /private/var/ or such would be a good choice. You don't typically want your more curious users seeing them and thinking they need to delete them or wondering what they are. Even if there is nothing "secret" in the scripts like hardcoded usernames and passwords, its best that they don't try removing or modifying them for the sake of your policies.

donmontalvo
Esteemed Contributor III

Are scripts in JSS 9 now stored in the JSS database?

Migrating Packages and Scripts
https://jamfnation.jamfsoftware.com/article.html?id=327

If you have upgraded from the Casper Suite v8.x and you want to utilize the cloud distribution point, a JAMF Distribution Server (JDS) instance, or the script editor in the JSS, you must first migrate all the scripts and packages on your master distribution point. This migrates all scripts to the jamfsoftware database, and compresses all non-flat PKGs as ZIP files.

When we migrated from 8.73>9.31 we found (and JAMF confirmed) that we had to Migrate everything in the DP (currently a file share), so the article might need to be updated.

To cache the script for offline use, the policy must be set to Ongoing, then you'll get that option.

Page 208 of the 9.31 admin guide:

Make the policy available offline. (This only works with the "Ongoing" execution frequency.)

HTH,
Don

--
https://donmontalvo.com

colonelpanic
Contributor

Don,

You're right, this is a good idea, however it doesn't cover scripts that are called by launchagents and launchdaemons.

We keep our scripts in /Library/Application Support/JAMF/Scripts, and the launchagents and launchdaemons that we use know to call the scripts from inside that directory.

bentoms
Release Candidate Programs Tester

We use /Library/Scripts/CompanyName/ for scripts that are called via LaunchAgents & outlook setup.

makander
Contributor

Alright! Thanks for all the replies, lots of useful information! :)