About This File
This solution will export customizations into a folder hierarchy based on each type of backup. It uses only Automate scripting functions so it is compatible with both Cloud Hosted and On-Prem servers. It should be compatible with MySQL 5.6 and Automate Version 11+.
Script Backups will be placed in folders matching the script folders in your environment. Each time a script is exported, the last updated time and user information is included, providing multiple script revisions as it is changed over time. This script does not decode the scriptdata, so script dependencies like EDF's or other scripts will not be bundled in the XML export. But if you are just looking to undo a change, the script dependencies should exist already. Scriptlets will not be "versioned", but it will detect when they have changed and will only back up new or changed Scriptlets.
Additionally, the following item types will also be backed up: Internal Monitors, Group Monitors, Remote Monitors, Dataviews, Role Detections, ExtraData Fields, and VirusScanners.
The backups will be created at the folder identified by "@BackupRoot@", which you can provide as a script parameter when scheduling if you do not want to use the default path. Target the script against an online agent, and the script data will be backed up to that computer. Future runs will reference the saved "Script State" variable for that agent and will only include the scripts updated since the last successful backup. Backup verification is performed, if a script backup file was not created as expected, the backup timestamp will not be changed allowing the backup to be attempted again.
The attached .zip bundle contains scripts actually backed up by this solution. Import the "Send Email" script first, and then import the "Backup" script. If there are any problems or you would rather import a script exported by Automate, the "Backup Automate Scripts (and More).xml" is included as well. You do not need to import all three files!
Just schedule this to run daily against any agent to establish your script archive.
script version revision archive backup
What's New in Version 3.2.2 See changelog
Fixed error with Scriptlet exports.
Script has been renamed: Backups Automate Scripts (and More)
Backs up Internal Monitors, Group Monitors, Remote Monitors, Dataviews, Role Detections, ExtraData Fields, and VirusScanners in addition to Scripts and Scriptlets.
Consolidated script steps so that ALL backup types use the same bundling, extraction, and verification steps.
Defined new system properties so that you can disable a particular type of backup if desired. (Look for '_BackupScript-Include%' properties, set to 0 to exclude)
Each type of backup includes a "README-Instructions.txt" file with basic instructions on how to use the backups.
Fixes: Universal timestamp formatting (Powershell shouldn't report the date value is not recognized for non US date settings)
Scriptlet data will not be altered by the Script Engine.