Feb-14-2018, 05:42 PM
Other than using a small text file and updating it with data when variables change value, what mechanisms exist to retain data between system reboots?
on a raspberry pi-z0 i have a cronned job pinging for a wifi connection and rebooting the system on failure,
However now i want to run a small python script to respond to mqtt messages.
As the script is intended to raise alarms under numerous conditions a number of which reference the previously received payload its time of arrival and contents, or lack of.
And in order to avoid raising false alarms keeping a record of the last payload and its time of arrival that will survive a system reboot and restart of the script as a python newbie i am considering a simple text file update and check for existence/read on startup.
But I was wondering if there was a more elegant built in feature or library i could employ instead? or have i wasted a hour or so googling the wrong search terms completely??
on a raspberry pi-z0 i have a cronned job pinging for a wifi connection and rebooting the system on failure,
However now i want to run a small python script to respond to mqtt messages.
As the script is intended to raise alarms under numerous conditions a number of which reference the previously received payload its time of arrival and contents, or lack of.
And in order to avoid raising false alarms keeping a record of the last payload and its time of arrival that will survive a system reboot and restart of the script as a python newbie i am considering a simple text file update and check for existence/read on startup.
But I was wondering if there was a more elegant built in feature or library i could employ instead? or have i wasted a hour or so googling the wrong search terms completely??