Posted on 11-21-2019 01:01 PM
Looking at backing up some of our Jamf configs... is there a way (using the api, perhaps?) to do a dump of ALL scripts used in Jamf?
I probably have close to 100 scripts, but they are all stored in the DB. Any way to dump those out, even if just to a single large text file?
Posted on 11-21-2019 01:46 PM
Easiest way to get a local copy is to create a folder anywhere on your Mac, then open up Jamf Admin, then drag that folder to jamf admin as a DP and hit replicate. It will sync all scripts and packages to a local folder structure on your Mac. This is way faster than using the API. If you are looking to get everything into other systems and do integration the API would be better
However, you should be putting your scripts into something like GitHub anyway
Posted on 11-21-2019 02:10 PM
Der Flounder has a great solution - https://derflounder.wordpress.com/2018/12/08/backing-up-macos-scripts-from-jamf-pro/
Posted on 11-21-2019 08:57 PM
+1 for @Hugonaut ‘s answer. Rich’s script is amazing and has helped me out a lot
Posted on 11-22-2019 06:24 AM
Thanks all.
I like the simplicity of @tlarkin 's reply, but with 200+ gb worth of packages after adding all of the latest Creative Cloud apps, I'll probably try der flounder's so I can get JUST the scripts for now.
Moving to a new role where I'll absolutely be looking to put them into git - massive red tape at current role has prevented us from using git for the past year or so, but I agree that's definitely the right type of approach.
Posted on 11-22-2019 06:31 AM
https://github.com/boberito/jamfapi/blob/master/scriptdump.py I got a script for you!
Create a folder in /Users/Shared called JAMFScripts. It'll download and dump them all in there. Or edit that line to point where ever you want. Downloads them and names them as the name is in Jamf with .sh
It hates colons and slashes in the name, so if you have that you'll have to change the name of your script in the jamf server.
Posted on 11-22-2019 06:34 AM
PS. Done, and beautiful. Exactly what I wanted- just wanted to make sure I had a documented backup of every script. 88 scripts downloaded in about 30 seconds, beautiful :)
Posted on 11-22-2019 06:35 AM
@boberito ... saw yours after I tried Der Flounder's, but much appreciated! I'll test it as well.
Posted on 11-22-2019 06:37 AM
shameless self promotion, I like using jamf-migrator: https://github.com/jamf/JamfMigrator
Posted on 11-22-2019 06:48 AM
Ahhh... didn't even thing of JamfMigrator, and I've used it before!
Thanks as well... this thread absolutely bolsters my personal toolbox.
Posted on 02-11-2021 01:13 PM
However, this is still a Jamf bug in 2021, the "feature" still only exports 100 of the script names. And this is just the names of them, not the entire script (which is what I am looking for since we can't copy/paste the screen).
Posted on 02-11-2021 02:04 PM
@swhps Have you tried https://github.com/jamf/JamfMigrator which was mentioned above? It most definitely will allow you to export every script in your JSS.