When my program is running a config file is often saved via python scripts, however the system is frequently shut down unsafely. Any changes made to the config recently are not there at boot. A user must either shut down in the correct manner or wait a while for the config to save properly to disk. I have tried syncing when a user saves a config but the issue still occurs, any other ideas?
To call my python scripts I use clish, which basically is using bash. So in bash i make a call to sync.
<COMMAND name="copy running-config startup-config"
help="Copy to startup configuration">
<CONFIG operation="dump" file="/path/startup-config"/>
<ACTION>
sync
</ACTION>
</COMMAND>