What's new

Jffs external sync

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

alsoszaa

New Around Here
I would love for there to be a way to have the router export values from the jffs file so I can keep the historic data longer. If I reboot or power off or if there is a power outage the data clears on start. Is there anything I can do to save the data longer? Can I save it to an attached usb disk? Can I have a script run on a cadence to dump the jffs contents to an external database?
What are my options?
 
Data in /jffs is persistent. It doesn't disappear after a reboot or power off.

What router do you have? Which firmware version? What data are you loosing?
 
I use the AX88U on Merlin on firmware 3.0.0.4.388.1_0. Last power outage we had it lost all data in the statistics (stored in the jffs) I mostly rely on this to know what has the most data usage from month to month since we are still in the Stone Age and have a monthly data limit with our ISP.
 
I use the AX88U on Merlin on firmware 3.0.0.4.388.1_0. Last power outage we had it lost all data in the statistics (stored in the jffs) I mostly rely on this to know what has the most data usage from month to month since we are still in the Stone Age and have a monthly data limit with our ISP.

Odd, maybe it was writing to the file when it lost power and got corrupted. Maybe invest in a cheap UPS for your router (can't hurt for other stuff too, can help protect from some surges etc). One of the features of merlin is to store traffic stats on JFFS and thus survive a reboot, at least I thought merlin added that, maybe it is in the stock firmware now too. My traffic stats always survive a reboot. I've hard rebooted (and a few soft) many times and my data is there back to November 30th. Not sure how far back it is supposed to keep it, I've only really ever looked at the last 30 days.
 
One idea is to try rsync. It’s available in Entware.

Something like:

rsync -a /jffs/ /tmp/mnt/MyUSBStick/jffsbackupdir

You could run it as a cron job every hour or every day by making it an executable script and using cru to add the script (put the cru in /jffs/scripts/services-start so it installs on every boot).

rsync has a ton of options. The -a is the easiest but you can fine tune what you want copied/synced using all the options with rsync.

(ps - don’t forget the trailing “/“ on the first argument. It’s “/jffs/“ not “/jffs”)
 
Over 7 years of experience with Asuswrt + Merlin firmwares, I also experienced once accidental power outage that resulted in /jffs data loss.

After that time, /jffs seems to be formatted on boot, and all files are gone, not only traffic data, but custom scripts and logs.


One idea is to try rsync. It’s available in Entware.
Maybe a backup script is enough? Many people don't have Entware installed, and this small requirement can be done using the system's built-in cp command.

But for me, I'm now just creating a link to the /jffs file to my USB drive so I don't have to backup it.
 
Last edited:
Over 7 years of experience with Asuswrt + Merlin firmwares, I also experienced once accidental power outage that resulted in /jffs data loss.

After that time, /jffs seems to be formatted on boot, and all files are gone, not only traffic data, but custom scripts and logs.



Maybe a backup script is enough? Many people don't have Entware installed, and this small requirement can be done using the system's built-in cp command.

But for me, I'm now just creating a link to the /jffs file to my USB drive so I don't have to backup it.

USB drive is just as (if not more) prone to corruption during a loss of power (or just when it has reached its write limit) so still probably a good idea to be on UPS even with USB. Or are you saying you're keeping a copy in both places (which would require something like rsync).
 
USB drive is just as (if not more) prone to corruption during a loss of power (or just when it has reached its write limit) so still probably a good idea to be on UPS even with USB. Or are you saying you're keeping a copy in both places (which would require something like rsync).
Actually USB backup is easier than you think. enable file sharing, and then freely copy the files to your other devices.;)

For me, I don't backup them because those logs don't matter to me and the SSD I use have good write cycle and power loss protection.
 
Actually USB backup is easier than you think. enable file sharing, and then freely copy the files to your other devices.;)

For me, I don't backup them because those logs don't matter to me and the SSD I use have good write cycle and power loss protection.

Obviously you can manually copy but you need to remember to do that frequently if you don't want to lose your stats etc.
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top