Is there a process for downloading or copying all scripts that are stored in the JSS?
I am creating a new JSS from scratch to be used for testing. Is there a documented way of downloading all of the scripts from a JSS and then importing to another JSS?
Also, I would like to backup just the scripts on a regular basis outside of the typical JSS database backup.
Solved! Go to Solution.
You could probably use this script I created awhile ago as the basis for one that would download all scripts:
It was designed to pull down Extension Attribute scripts via the API, but the concept is the same, so it can be adapted I think.
So I saved you the trouble of reworking my existing 'download EA scripts' script. Here is a version that will download all the regular scripts from your JSS. I had to remove the last section from the original script, which ran each one to check to make sure they exited successfully. This made sense when working with EA scripts, but I realized pretty quickly this was problematic for regular scripts, since those scripts may have GUI elements pop up, or install software updates or even reboot the Mac! Def don't want to run each one on your host system. :)
Anyway, here is the revised version. Run it like:
Moved to my githup page. Find the script here:
I added the 'final' version of the script to my github page, so you can grab it from there (see post above for the link)
Although I don't normally do this, I removed the one I had posted above just to prevent anyone from downloading an older version that had a few issues that needed to be tweaked. Best to just grab the one from the JSS. If I make any changes to it they'll be reflected there.
@m.entholzner is correct. Using Casper Admin and then dragging a local folder into the lower right allows for local syncing of all Packages and Scripts. It does copy down all of the scripts that are stored in the JSS Database.
Unfortunately, it required me to wait for all 187GB of packages to verify that the scripts are copied down too. :)
@mm2270 I'll will try out your script soon! I'll mark your post as an answer once I verify the script works.
Well, that's definitely good information to know that a replication also pulls down scripts from the db. I didn't think it would do that honestly since they are not really in the "share" as physical files.
Kind of a bummer that it needs to pull down all the packages as well though. It would be nice if it was possible to do a selective replication, or is there a way? I don't do local repository syncs, so I'm not sure.