ZRam - Scheduled sync to SD card

Hi,

I am using zram on openhabian3 and since more then one year, the sd card is still alive …
Great … zram is working as expected and resolved an big issue of the past.

However, in case of power loss, all the collected data is lost, unfortunately.

To my understanding, the one way to persist the zram data to SD card is via regular shutdown.

As openhab is intended as a 24/7 service, I would not like to shutdown the service on a regular basis.

Is there an opportunity to schedule a regular sync of the data to hard disk e.g. via openhab-cli?

Thanks a lot.
Best,
Rüdiger

1 Like

Nope, sorry.
You can manually copy the data to /opt/zram/… there is a lower fs layer equivalent for every zram fs,
this is what will be available after a boot.

Happy to take any pull request.
If anyone was to build a rsync based script, I’d be willing to setup a service to run it at regular intervals.

Hi,
thanks for the fast response. I perform a daily backup of the influxdb via influx backup …
so the data is preserved, but needs to be reimported …

Thanks. Best

That’s not the same.
So how about giving back to the OH project, i.e. contribute a script that work for any zram mounted fs ?
Check out the link above.