ZRam Data Persistence and Scheduled Sync to SD Card

Hi everyone, I wanted to share my experience with ZRam and discuss a potential solution for data persistence. I’ve been using ZRam on my OpenHABian setup for over a year now, and it’s been a lifesaver in terms of performance and reliability. However, one issue that’s been on my mind is data loss in the event of a power failure. Since ZRam stores data in memory, any unsaved data is lost if the system crashes or loses power.

I understand that one way to persist data is through regular shutdowns, but since OpenHAB is meant to run 24/7, this isn’t practical. I’m curious if there’s a way to schedule a regular sync of ZRam data to the SD card, perhaps using a script or cron job. This would ensure that even in the event of a power loss, the data isn’t completely lost.

Has anyone else encountered this issue? I’d love to hear if there are any existing solutions or workarounds that the community has implemented. Your insights would be greatly appreciated! Thanks in advance for your help.