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!

Cleaning house... Minor update today... more of a bugfix. ;)

What's new?
v1.43 - (January 13, 2024)
- FIXED:
When selecting to import your primary backup settings in the connection testing tool, it would not bring over the SMB version, and continue to give you the default. This has been fixed to now bring over your custom SMB setting. Thanks much to @Tallion_o7 for the heads-up!

Download link (or update directly within AMTM):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.43.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"
 
Well it finally happened this morning… I somewhat bricked my AX88U Pro. I was trying to move it’s power plug to the correct one on a UPS. Without a true “shutdown -h” command (sadly, but lets not debate the point), I typically do a reboot and watch until the Power LED turns off. Then pull the plug. Has always worked in the past.

I should note that I was doing this at 6AM - well before my very non-technical wife wakes up.

Moved the power plug and the router started to start up. Got to a point, then all LEDs off. Waited ~4-5 mins, power cycled - same behavior. Did the cycle again — no go.
Luckly I had installed BACKUPMON weeks ago.

Did the dreaded Factory Reset (WPS hold down). Router came back to life. Did the initial setup with Foo as the SSID. Quickly got to the BACKUPMON Addon thread (to read the instructions).

Ok - big faith - format the SSD… I have lots of my own scripts and stuff on that drive!!!! I do see the drive mounted so I copy backupmon.* to /jffs/scripts.

Did the. AMTM->fd then the sw command.

Run backupmon -setup - everything looks good. In fact, there was even a backup from last night :)
Then backupmon -restore.

It mounts my NAS fine, I select last nights restore point and..
Hold breath, wait….I see some promising tar commands, etc.
Backupmon said it’s forcing a reboot…..

Wow, everything comes back to life! 3 AiMesh nodes happy, all my WiFi connected devices (Sense power monitor, Harmony Hub, Tempest Weatherthing, Hue hub, thermostat etc…)
All running great.

Even better, all my scripts, experiments, hacks - all happily back on /jffs and the SSD drive.
Even even better - wife just walked out as it was finishing ;-)

@Viktor Jaep - many many thanks - it worked fantastic. Saved me many hours (and explaining to my wife why the internet is going to be down for who knows how long….

Contribution coming your way!!!
 
Well it finally happened this morning… I somewhat bricked my AX88U Pro. I was trying to move it’s power plug to the correct one on a UPS. Without a true “shutdown -h” command (sadly, but lets not debate the point), I typically do a reboot and watch until the Power LED turns off. Then pull the plug. Has always worked in the past.

I should note that I was doing this at 6AM - well before my very non-technical wife wakes up.

Moved the power plug and the router started to start up. Got to a point, then all LEDs off. Waited ~4-5 mins, power cycled - same behavior. Did the cycle again — no go.
Luckly I had installed BACKUPMON weeks ago.

Did the dreaded Factory Reset (WPS hold down). Router came back to life. Did the initial setup with Foo as the SSID. Quickly got to the BACKUPMON Addon thread (to read the instructions).

Ok - big faith - format the SSD… I have lots of my own scripts and stuff on that drive!!!! I do see the drive mounted so I copy backupmon.* to /jffs/scripts.

Did the. AMTM->fd then the sw command.

Run backupmon -setup - everything looks good. In fact, there was even a backup from last night :)
Then backupmon -restore.

It mounts my NAS fine, I select last nights restore point and..
Hold breath, wait….I see some promising tar commands, etc.
Backupmon said it’s forcing a reboot…..

Wow, everything comes back to life! 3 AiMesh nodes happy, all my WiFi connected devices (Sense power monitor, Harmony Hub, Tempest Weatherthing, Hue hub, thermostat etc…)
All running great.

Even better, all my scripts, experiments, hacks - all happily back on /jffs and the SSD drive.
Even even better - wife just walked out as it was finishing ;-)

@Viktor Jaep - many many thanks - it worked fantastic. Saved me many hours (and explaining to my wife why the internet is going to be down for who knows how long….

Contribution coming your way!!!
You just made @Viktor Jaep's day/week/month/year!
 
Well it finally happened this morning… I somewhat bricked my AX88U Pro. I was trying to move it’s power plug to the correct one on a UPS. Without a true “shutdown -h” command (sadly, but lets not debate the point), I typically do a reboot and watch until the Power LED turns off. Then pull the plug. Has always worked in the past.

I should note that I was doing this at 6AM - well before my very non-technical wife wakes up.

Moved the power plug and the router started to start up. Got to a point, then all LEDs off. Waited ~4-5 mins, power cycled - same behavior. Did the cycle again — no go.
Luckly I had installed BACKUPMON weeks ago.

Did the dreaded Factory Reset (WPS hold down). Router came back to life. Did the initial setup with Foo as the SSID. Quickly got to the BACKUPMON Addon thread (to read the instructions).

Ok - big faith - format the SSD… I have lots of my own scripts and stuff on that drive!!!! I do see the drive mounted so I copy backupmon.* to /jffs/scripts.

Did the. AMTM->fd then the sw command.

Run backupmon -setup - everything looks good. In fact, there was even a backup from last night :)
Then backupmon -restore.

It mounts my NAS fine, I select last nights restore point and..
Hold breath, wait….I see some promising tar commands, etc.
Backupmon said it’s forcing a reboot…..

Wow, everything comes back to life! 3 AiMesh nodes happy, all my WiFi connected devices (Sense power monitor, Harmony Hub, Tempest Weatherthing, Hue hub, thermostat etc…)
All running great.

Even better, all my scripts, experiments, hacks - all happily back on /jffs and the SSD drive.
Even even better - wife just walked out as it was finishing ;-)

@Viktor Jaep - many many thanks - it worked fantastic. Saved me many hours (and explaining to my wife why the internet is going to be down for who knows how long….

Contribution coming your way!!!
Had me gripping the edge of my seat for a while there. Really good to read of someone else's success. It's a great feeling isn't it?
 
Had me gripping the edge of my seat for a while there. Really good to read of someone else's success. It's a great feeling isn't it?
Indeed it is!
 
Well it finally happened this morning… I somewhat bricked my AX88U Pro. I was trying to move it’s power plug to the correct one on a UPS. Without a true “shutdown -h” command (sadly, but lets not debate the point), I typically do a reboot and watch until the Power LED turns off. Then pull the plug. Has always worked in the past.

I should note that I was doing this at 6AM - well before my very non-technical wife wakes up.
.......

@Viktor Jaep - many many thanks - it worked fantastic. Saved me many hours (and explaining to my wife why the internet is going to be down for who knows how long….

Contribution coming your way!!!
I know these emotions all too well! As I said before, it is a new dawn for the home IT guy! We have some special customers with high expectations to deal with.
 
Well it finally happened this morning… I somewhat bricked my AX88U Pro. I was trying to move it’s power plug to the correct one on a UPS. Without a true “shutdown -h” command (sadly, but lets not debate the point), I typically do a reboot and watch until the Power LED turns off. Then pull the plug. Has always worked in the past.

I should note that I was doing this at 6AM - well before my very non-technical wife wakes up.

Moved the power plug and the router started to start up. Got to a point, then all LEDs off. Waited ~4-5 mins, power cycled - same behavior. Did the cycle again — no go.
Luckly I had installed BACKUPMON weeks ago.

Did the dreaded Factory Reset (WPS hold down). Router came back to life. Did the initial setup with Foo as the SSID. Quickly got to the BACKUPMON Addon thread (to read the instructions).

Ok - big faith - format the SSD… I have lots of my own scripts and stuff on that drive!!!! I do see the drive mounted so I copy backupmon.* to /jffs/scripts.

Did the. AMTM->fd then the sw command.

Run backupmon -setup - everything looks good. In fact, there was even a backup from last night :)
Then backupmon -restore.

It mounts my NAS fine, I select last nights restore point and..
Hold breath, wait….I see some promising tar commands, etc.
Backupmon said it’s forcing a reboot…..

Wow, everything comes back to life! 3 AiMesh nodes happy, all my WiFi connected devices (Sense power monitor, Harmony Hub, Tempest Weatherthing, Hue hub, thermostat etc…)
All running great.

Even better, all my scripts, experiments, hacks - all happily back on /jffs and the SSD drive.
Even even better - wife just walked out as it was finishing ;-)

@Viktor Jaep - many many thanks - it worked fantastic. Saved me many hours (and explaining to my wife why the internet is going to be down for who knows how long….

Contribution coming your way!!!
OMG! What an amazing read, @JGrana! I was waiting for some kind of hammer to drop, that something didn't work out and your environment was hosed! Ha! Thank you VERY much for your generous contribution!! I am so happy to hear that everything restored back to square one... whew!! It's really nice knowing that you and others have now gone through a legitimate disaster followed by a real-world restore like this, and that you came out perfectly fine on the other end! Scripts, complex configurations, AiMesh, custom stuff and all! Should help everyone sleep better at night after reading this!

You just made @Viktor Jaep's day/week/month/year!
You definitely hit the nail on the head! Makes all the blood, sweat, tears and accidental restores onto my production router all worth it in the end! LOL!

Had me gripping the edge of my seat for a while there. Really good to read of someone else's success. It's a great feeling isn't it?
I was literally RIVETED... 😮 Hahah!
 
Last edited:
Anyone that installs Addons and things like Entware and tweaks their settings - would be foolish not to install BACKUPMON.
Works in the background, out of sight and out of mind - until disaster strikes.
One bit of advice for a quicker recovery - copy the files backupmon.sh and backupmon.cfg to a USB drive. If needed, after the full reset, plug it in and copy them to /jffs/scripts.
No mounting remote shares, etc. When the time comes, BACKUPMON does this.

BTW @Viktor Jaep , are you doing and "insmod md4" before mounting the remote share? I needed to do this when I tried mounting my smb NAS before I ran BACKUPMON. If not, it's good insurance.
 
BTW @Viktor Jaep , are you doing and "insmod md4" before mounting the remote share? I needed to do this when I tried mounting my smb NAS before I ran BACKUPMON. If not, it's good insurance.

I use "modprobe md4"... which seems to do the trick? I'll look into your suggestion!
 
I use "modprobe md4"... which seems to do the trick? I'll look into your suggestion!
modprobe should work just as well! No worries, l just wanted to make sure the missing kernel module was loaded before attempting to login to an smb share.
 
Hi all.
Thank you for this very useful script.
I have made a network backup on my USB 3 port that is also smb share.
At the end of the script, the USB is unmounted and remains therefore not reachable on the samba.
Is there any way to avoid the umount at the end of the proess ?
Code:
Messages:
STATUS: External network drive (\\192.168.1.1\AAA_varie(at RT86U_SMB)) mounted successfully under: /tmp/mnt/RT86U_SMB
STATUS: Backup Directory successfully created.
STATUS: Daily Backup Directory successfully created.
STATUS: Finished backing up JFFS to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/jffs.tar.gz.
STATUS: Finished backing up NVRAM to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/nvram.cfg.
STATUS: Finished copying routerfw.txt to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/routerfw.txt.
STATUS: Starting backup of EXT Drive on Thu Jan 18 12:57:45 CET 2024. Please stand by...
STATUS: Finished backing up EXT Drive in 43 sec to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/Entware.tar.gz.
STATUS: Finished copying backupmon.sh script to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying backupmon.cfg file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying pfexclusion.txt file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying reference nvram.txt extract to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying restoration instructions.txt file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Settling for 10 seconds...
STATUS: External network drive (\\192.168.1.1\AAA_varie(at RT86U_SMB)) unmounted successfully.
 
Hi all.
Thank you for this very useful script.
I have made a network backup on my USB 3 port that is also smb share.
At the end of the script, the USB is unmounted and remains therefore not reachable on the samba.
Is there any way to avoid the umount at the end of the proess ?
Code:
Messages:
STATUS: External network drive (\\192.168.1.1\AAA_varie(at RT86U_SMB)) mounted successfully under: /tmp/mnt/RT86U_SMB
STATUS: Backup Directory successfully created.
STATUS: Daily Backup Directory successfully created.
STATUS: Finished backing up JFFS to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/jffs.tar.gz.
STATUS: Finished backing up NVRAM to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/nvram.cfg.
STATUS: Finished copying routerfw.txt to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/routerfw.txt.
STATUS: Starting backup of EXT Drive on Thu Jan 18 12:57:45 CET 2024. Please stand by...
STATUS: Finished backing up EXT Drive in 43 sec to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/Entware.tar.gz.
STATUS: Finished copying backupmon.sh script to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying backupmon.cfg file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying pfexclusion.txt file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying reference nvram.txt extract to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying restoration instructions.txt file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Settling for 10 seconds...
STATUS: External network drive (\\192.168.1.1\AAA_varie(at RT86U_SMB)) unmounted successfully.

You're welcome, @miazza!
;) Instead of using "network" as your backup target, specify it as "USB". Then it won't unmount after it finishes.
 
Excellent ! This works great.
Code:
Messages:
STATUS: External drive (USB) mounted successfully as: /tmp/mnt/RT86U_SMB
STATUS: Finished backing up JFFS to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/jffs.tar.gz.
STATUS: Finished backing up NVRAM to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/nvram.cfg.
STATUS: Finished copying routerfw.txt to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/routerfw.txt.
STATUS: Starting backup of EXT Drive on Thu Jan 18 15:10:09 CET 2024. Please stand by...
STATUS: Finished backing up EXT Drive in 43 sec to /tmp/mnt/RT86U_SMB/RT86U-Backup/18/Entware.tar.gz.
STATUS: Finished copying backupmon.sh script to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying backupmon.cfg file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying pfexclusion.txt file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying reference nvram.txt extract to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Finished copying restoration instructions.txt file to /tmp/mnt/RT86U_SMB/RT86U-Backup.
STATUS: Settling for 10 seconds...
STATUS: External USB drive continues to stay mounted.
 
JGrana - Great story. It's amazing how similar our home experiences are. Many times, before my also non-techie wife woke up, I was scrambling to fix something on my network that I broke before she got up and complained that she could do not do something that she wanted to.

Viktor - What a great testament to your hard work. Thanks. One question (for now) - I will soon be migrating from an AC86U to an AX86U Pro. Is there any way I can use backupmon to migrate from one router model to another? While I'm sure there will be differences, there are also a goodly number of similarities in settings between them, with both running Merlin of course.
 
JGrana - Great story. It's amazing how similar our home experiences are. Many times, before my also non-techie wife woke up, I was scrambling to fix something on my network that I broke before she got up and complained that she could do not do something that she wanted to.
I do most of my best development between 6am-9am on the weekends until the wife/kids get up and demand solid internet/router performance. LOL

Viktor - What a great testament to your hard work. Thanks. One question (for now) - I will soon be migrating from an AC86U to an AX86U Pro. Is there any way I can use backupmon to migrate from one router model to another? While I'm sure there will be differences, there are also a goodly number of similarities in settings between them, with both running Merlin of course.
Sadly, I would not recommend using backupmon to help with an upgrade like this. While there are probably similarities in some of its settings, you could literally brick your router after restoring the .cfg file going from one router to another non-similar router. Backupmon will actually stop you during the restore process and give you a big fat warning that you are about to brick your router if you attempt a restore such as this.

You may be able to pick and choose some custom files or scripts that you can extract out of the jffs.tar file and copy those over manually... like the stuff under the scripts/addons are safe to copy over... but in all reality, you probably want to follow all the right steps on setting up a brand new router from scratch, creating your swap file with AMTM, installing entware, and letting AMTM do the majority of the installs just to ensure everything is going to the right place. Sorry. :(
 
Hi Viktor,

I don't use BACKUPMON - still using the original "one page" script that this all started from.
But I've made a little change you might want to 'borrow'.

I realised after the latest Merlin release from 388.5 to 388.6 that I couldn't tell which release my backups applied to.

So, if I wanted to roll back to a previous release, I have to remember when I 'upgraded' and pick a backup from before that date.

I've made a very crude change (I'm sure you can do better),
I just add $(nvram get webs_state_info) to the beginning of the folder name.

Code:
Intead of backing up to
M:\BACKUPS\Routers\SCHED_BU\AX86U\23
it creates the folder
M:\BACKUPS\Routers\SCHED_BU\AX86U\3004_388_6_0-23

I know you love to tinker - Maybe you could so something similar?
 
For some reason the BACKUPMON stopped getting added to the cron jobs, here is services-start file:

Code:
admin@RT-AC86U-9988:/jffs/scripts# cat services-start
#!/bin/sh
/jffs/scripts/scmerlin startup & # scMerlin
/jffs/addons/amtm/shellhistory # Added by amtm
cru a root_servers  "12 4 * * * curl -o \/opt\/var\/lib\/unbound\/root\.hints https://www.internic.net/domain/named.cache"      # unbound_manager
cru a RunBackupMon "46 4 * * * sh /jffs/scripts/backupmon.sh"

So I had to move the job into post-mount:
Code:
admin@RT-AC86U-9988:/jffs/scripts# grep back post-mount
cru a RunBackupMon "28 4 * * * sh /jffs/scripts/backupmon.sh"

I am using slightly different times, to ensure that if both go, they don't launch at the same time.
 
For some reason the BACKUPMON stopped getting added to the cron jobs, here is services-start file:

Code:
admin@RT-AC86U-9988:/jffs/scripts# cat services-start
#!/bin/sh
/jffs/scripts/scmerlin startup & # scMerlin
/jffs/addons/amtm/shellhistory # Added by amtm
cru a root_servers  "12 4 * * * curl -o \/opt\/var\/lib\/unbound\/root\.hints https://www.internic.net/domain/named.cache"      # unbound_manager
cru a RunBackupMon "46 4 * * * sh /jffs/scripts/backupmon.sh"

So I had to move the job into post-mount:
Code:
admin@RT-AC86U-9988:/jffs/scripts# grep back post-mount
cru a RunBackupMon "28 4 * * * sh /jffs/scripts/backupmon.sh"

I am using slightly different times, to ensure that if both go, they don't launch at the same time.
Weird... if you run this statement from your services-start, you should see it getting added to your cru list...

Code:
cru a RunBackupMon "46 4 * * * sh /jffs/scripts/backupmon.sh"

And if it doesn't then there must be something else up with your system. Have you tried a reboot recently?
 
I realised the same on my installation. I made a manual backup with a schedued monthly backup but I could not find anything added to the cron job.
I did not investigate because I am not changing the router configuration frequently and I can run it manually when needed.
Anyhow this evening I will check again the cru.
 
@Viktor Jaep I believe I'm seeing similar. Occasionally a daily backup will not be done, I only noticed last night when moving data from one raid to another. It's seems like something else may be resetting the cron list, losing the backupmon entry as well as other entries. I'll dig a little deeper for you when I next see it (not) happen.
 

Latest threads

Sign Up For SNBForums Daily Digest

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