What's new

BACKUPMON BACKUPMON v1.5.10 -Mar 1, 2024- Backup/Restore your Router: JFFS + NVRAM + External USB Drive! (**Thread closed due to age**)

  • 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!

I still have the original nvram-save.sh script. While it does save the nvram and jffs fine I haven't tried to restore yet (hnd).
Have I just volunteered to be a Guinea pig?
You are certainly braver than me! :)
 
I shouldn't have bothered. While it saves both the nvram and the jffs it will only resore the nvram. May as well use the built-in backups.
Not going there again lol :p
 
Quick post-go-live bug-fix/feature release... ;)

What's new?
v1.02 - (September 15, 2023)
- ADDED:
Thanks to @maghuro and @alan6854321 for the suggestion to include a copy of the NVRAM settings. Please note... this extract is for reference purposes only, and cannot be used to import old NVRAM values back into your router. The 'nvram.txt' file is now included with the other assortment of files that are exported into the root of your external backup folder.
- FIXED: Thanks to @maghuro for finding the typo in the config for the username/password labels.

Download links (or update directly from within BACKUPMON!):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.02.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"
 
Thanks for another quick update. Your the goat 😁

Correct me if I'm wrong - when restoring then .cfg file, isn't nvram also restored?
Or maybe when restoring jffs folder?
Because on backup, inside jffs folder, there's a folder called "nvram" which have every nvram values divided by files.
 
Thanks for another quick update. Your the goat 😁

Correct me if I'm wrong - when restoring then .cfg file, isn't nvram also restored?
Or maybe when restoring jffs folder?
Because on backup, inside jffs folder, there's a folder called "nvram" which have every nvram values divided by files.
The backupmon.cfg file just contains settings that BACKUPMON uses. When you restore the jffs.tar file, you will restore everything under your /jffs directory structure... so yeah, I suppose so, as @ColinTaylor mentioned, that some values are stored there... not everything!
 
Last edited:
I now understand what @maghuro is getting at... @ColinTaylor -- could you please give us your expert opinion on this?

If you use the command "nvram save nvbackup.cfg", and back this .cfg file up... could you then theoretically wipe your router completely, format it, reinitialize it, and restore back to your original point using this .cfg file to "nvram restore nvbackup.cfg", and restore the jffs + ext USB backups? Everything should be back in place as it was before you reset everything... I would think yes, right?
 
I now understand what @maghuro is getting at... @ColinTaylor -- could you please give us your expert opinion on this?

If you use the command "nvram save nvbackup.cfg", and back this .cfg file up... could you then theoretically wipe your router completely, format it, reinitialize it, and restore back to your original point using this .cfg file to "nvram restore nvbackup.cfg", and restore the jffs + ext USB backups? Everything should be back in place as it was before you reset everything... I would think yes, right?
I've being doing this for a long time. Only the backup command, not the import.

Usually I restore it directly from the "Advanced_SettingBackup_Content.asp" page, router web GUI. Restore it, then restore jffs (optionally USB ext also), and all done.
 
I've being doing this for a long time. Only the backup command, not the import.

Usually I restore it directly from the "Advanced_SettingBackup_Content.asp" page, router web GUI. Restore it, then restore jffs (optionally USB ext also), and all done.
If that's the case, we may have a complete solution to restore a router from scratch!! ;)
 
If you use the command "nvram save nvbackup.cfg", and back this .cfg file up... could you then theoretically wipe your router completely, format it, reinitialize it, and restore back to your original point using this .cfg file to "nvram restore nvbackup.cfg", and restore the jffs + ext USB backups? Everything should be back in place as it was before you reset everything... I would think yes, right?
The nvram save file contains a complete set of nvram variables, including what you see in /jffs/data on an HND router, but excluding the duplicate "stub" variables seen in nvram show. The only officially supported way of updating nvram variables is through nvram restore or nvram set. As a jffs backup contains /jffs/data I regard it as part of a matching set with the nvram save file. While restoring /jffs/data from a tar backup is usually OK it's not an officially supported method (AFAIK) and is potentially dangerous for the reasons I previously stated. It's also pointless if you've just done an nvram restore as you're replacing one set of files with identical files. There's also nothing to say that Asus won't change the way it uses /jffs/data in the future so you're on your own there.

But to answer your question directly, "would everything be back in place as it was before"? Yes it would. In fact this is how I backup and restore my router (using the GUI options). The problem, as I mentioned before, is if you do out-of-sync restores of the whole of /jffs.
 
The nvram save file contains a complete set of nvram variables, including what you see in /jffs/data on an HND router, but excluding the duplicate "stub" variables seen in nvram show. The only officially supported way of updating nvram variables is through nvram restore or nvram set. As a jffs backup contains /jffs/data I regard it as part of a matching set with the nvram save file. While restoring /jffs/data from a tar backup is usually OK it's not an officially supported method (AFAIK) and is potentially dangerous for the reasons I previously stated. It's also pointless if you've just done an nvram restore as you're replacing one set of files with identical files. There's also nothing to say that Asus won't change the way it uses /jffs/data in the future so you're on your own there.

But to answer your question directly, "would everything be back in place as it was before"? Yes it would. In fact this is how I backup and restore my router (using the GUI options). The problem, as I mentioned before, is if you do out-of-sync restores of the whole of /jffs.
Thanks @ColinTaylor! Since all of these files (/jffs, ext USB and the nvram.cfg) would all be backed up simultaneously, chances would seem pretty low that there would be an out-of-sync condition, correct?

So, the correct order of restoration would be:

1.) /jffs
2.) ext USB
3.) nvram.cfg restore
4.) reboot

That should guarantee a pretty solid restore, correct?
 
Thanks @ColinTaylor! Since all of these files (/jffs, ext USB and the nvram.cfg) would all be backed up simultaneously, chances would seem pretty low that there would be an out-of-sync condition, correct?
Correct. But the main concern would not be the backup but how the restore was done.

So, the correct order of restoration would be:

1.) /jffs
2.) ext USB
3.) nvram.cfg restore
4.) reboot

That should guarantee a pretty solid restore, correct?
It depends on where you're starting from. It's a bit of a chicken and egg situation in any case. Personally I would use only the GUI options for restoring NVRAM (which forces an immediate reboot) and JFFS. I don't care much about my USB drive as there's nothing important on there but I would restore that last after temporarily disabling JFFS custom scripts and configs.
 
It depends on where you're starting from. It's a bit of a chicken and egg situation in any case. Personally I would use only the GUI options for restoring NVRAM (which forces an immediate reboot) and JFFS. I don't care much about my USB drive as there's nothing important on there but I would restore that last after temporarily disabling JFFS custom scripts and configs.
I'm glad I have an AC86U that I can format and blow away to test this out... ;) Thanks again for your advice!
 
Thanks @ColinTaylor! Since all of these files (/jffs, ext USB and the nvram.cfg) would all be backed up simultaneously, chances would seem pretty low that there would be an out-of-sync condition, correct?

So, the correct order of restoration would be:

1.) /jffs
2.) ext USB
3.) nvram.cfg restore
4.) reboot

That should guarantee a pretty solid restore, correct?
Been doing that order for a long time, no issues.

But the number 3 always restored through GUI. It's a matter of trying via command line ☺️
 
Alright! Just tested a complete wipe/reset of my AC86U, completely configured it differently when it came back up, with different naming, passwords, SSIDs, etc... formatted my external USB drive, then performed a complete BACKUPMON restore... and lo and behold, it's back to it's normal self, zero issues!! WHOO! I think we finally have a complete package, thanks to @maghuro and @ColinTaylor for their great advice. BACKUPMON has now also added NVRAM backups/restores to its repertoire, and completes the final piece of that puzzle, and significantly expands it use-case:

Use-case: BACKUPMON was designed to backup from, and restore to an already configured router, given a situation of a corrupted USB drive, botched Entware environment, or other general corruption issues. It can, however, also restore you back to a previous state if you decide to completely wipe your router or external drive from scratch. You can use it to move from one external USB drive to another... say, upgrading from a flashdrive to an SSD! You could also use it to restore your environment to a similar router if your old one dies, and you pick up the same model as a replacement. It is not meant to restore backups from one particular model of router (ex: RT-AC86U), to a different shiny new model (ex: GT-AX6000) that you just picked up. In this case, it's still best to set your new router up from scratch, and selectively import any critical files manually from your .TAR backups to your new router if needed.

What's new!
v1.1 - (September 16, 2023)
- MAJOR:
Many thanks to @maghuro and @ColinTaylor for their advice on NVRAM backups! BACKUPMON will now not only take backups of JFFS, your external USB drive, but also NVRAM! These 3 backups are stored under each of your daily folders. In case of a restore, these snapshots will work in concert together to bring your router back to its exact same state as before, settings and ALL!
- FIXED: Some minor instruction verbiage changes in the restore instructions, as I blew away my old AC86U during the testing process of getting it restored back to a previous state with BACKUPMON.

Download link (or update directly from within BACKUPMON):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.1.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"

Significant Screenshots:
Showing that the NVRAM.cfg file is created and stored under your backup folders...
1694870880273.png
 
Absolutely brilliant - a total backup solution. Thank you @Viktor Jaep , @ColinTaylor and @maghuro , and not forgetting all the members who tested for you.
Tested 👍

This should nicely replace nsrum in amtm.
 
@Viktor Jaep FYI. The reboot immediately after restoring the nvram should be mandatory not optional.
I did think of that, but as it defaults to reboot unattended operations would see it as automatic anyway. I get the point though, there really shouldn't be an option.
 
Has anyone had the script successfully mount a share on a Synology NAS? I cannot figure out correct syntax (or possibly settings settings on NAS). Thanks in advance.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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