Guardian has the ability to archive all user code into git code archives. This is a good way to track exactly what code was loaded and running at any point in time. When setup, each guardian node will commit it's user code into a system-specific git repository every time the node is restarted or when the LOAD button is pressed. A guardutil interface allows for easy access to the archives.
The only thing you need to do to start using guardian code archives is to set aside a directory for the archives, and then communicate it to guardian via the GUARD_ARCHIVE_ROOT environment variable:
If that variable is defined then the archives will be created and used. Each individual node archive will show up as a sub-directory of the root, i.e. the archive of the FOO system ("guardian FOO") will show up in archive root at /path/to/guardian/archive/FOO.
The guardutil archive-clone command can be used to clone the code repositories, to inspect the guardian user code that was running at any point in time. It uses the same GUARDIAN_ARCHIVE_ROOT environment variable to find the appropriate archive path.
If no directory is provided a gui interface (gitk) will be presented, allowing for visual inspection of each commit in the archive repository. If a directory path argument is given, the system archive repo will be cloned in that directory:
jameson.rollins@opsportal:~ 0$ guardutil archive-clone ISC_LOCK tmp/jameson.rollins@opsportal:~ 0$ cd tmp/ISC_LOCK/jameson.rollins@opsportal:~/tmp/ISC_LOCK 0$ git log --after="2018-10-10 23:55"--before="2018-10-10 23:56"commit a095a75b9de6a49bd52f290e9539be7b55b0893eAuthor: guardian <guardian@l1guardian1>Date: Wed Oct 10 23:55:56 2018 -0500 DAEMON RELOAD guardian version: 1.2.1jameson.rollins@opsportal:~/tmp/ISC_LOCK 0$ git checkout a095a75b9de6a49bd52f290e9539be7b55b0893eNote: checking out 'a095a75b9de6a49bd52f290e9539be7b55b0893e'.You are in'detached HEAD' state. You can look around, make experimentalchanges and commit them, and you can discard any commits you make in thisstate without impacting any branches by performing another checkout.If you want to create a new branch to retain commits you create, you maydo so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_nameHEAD is now at a095a75... DAEMON RELOADjameson.rollins@opsportal:~/tmp/ISC_LOCK 0$ less opt/rtcds/userapps/release/isc/l1/guardian/ISC_LOCK.py