I’m trying to make it so that if i have a shutdown (through ignition.stop or restoration from the configuration page) a script is run that creates a backup using system.util.execute on the command line…
it works every time i save the project… it does not work when ignition.stop is run.
How about showing us how you have configured the running of the script and the script itself?
This is unlikely to ever work with an external script. A gateway shutdown event cannot stop the JVM from exiting, and when it does, naive child processes will die with it. (A child process would have to quickly, deliberately, break the process parentage state.)
You need to make more deliberate backup procedures. This kind of "rescue" backup is likely to fail you when you really need it. (Like a JVM crash that doesn't even try to run the shutdown script.)
In the gateway Settings
You can schedule a backup, daily, weekly or what you prefer