iCall script to save the configuration to disk if any changes occur
I need a way for the F5 to periodically save the configuration to disk. We have a very dynamic environment with configuration changes occurring quite often and its vital to us that, say both devices in a config-sync pair reboot simultaneously due to power loss, any recent configuration changes are committed.
I've written an iCall script/handler that looks at the timestamp on the /config/BigDB.dat file and compares that to the timestamp on the /config/bigip.conf file. If the BigDB.dat file is newer, it issues the TMSH save sys config command. My question is whether or not the BigDB.dat file is a valid reference to trigger upon, or if there is a better TMSH command that can provide parsable output to know when a save is required for changes.
sys icall handler periodic testForConfigChanges { interval 5 script f5.backupOnChanges }
sys icall script f5.backupOnChanges { app-service none definition { set dbfile_timestamp [exec stat /config/BigDB.dat --format %Z] set conffile_timestamp [exec stat /config/bigip.conf --format %Z] if { $dbfile_timestamp > $conffile_timestamp } { tmsh::save sys config partitions all } } description none events none }