What's new
  • 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!

BACKUPMON BACKUPMON v1.8.22 -Nov 28, 2024- Backup/Restore your Router: JFFS + NVRAM + External USB Drive! CIFS/SMB/NFS! (Now available in AMTM!)

Edit: NVM I see you already mentioned added directories to exclude.
Yes, it works, but it would be really nice if there was a toggle for this so I don't need to exclude every folder in the storage. Seems like an idea for a small feature request 🙂
 
Last edited:
Is there an easy way to completely disable backups for an external USB storage? It seems that it currently requires adding every folder to exceptions, which is not very convenient. Would it be possible to implement a toggle for that? I don't need to back up my external drive because it's mostly used as temporary storage for files that get periodically uploaded to AWS, and they are pretty big.
Did you try adding the following (substitute DRIVE with external USB label) to the exclusions file? (I haven't tried — just thinking out loud):

/tmp/mnt/DRIVE/*
 
Yes, it works, but it would be really nice if there were a toggle for this so I don't need to exclude every folder in the storage. Seems like an idea for a small feature request 🙂

Yeah after reading it a second time I realized you were essentially asking for a feature to always exclude any USB device. @Viktor Jaep might have a reason he doesn't provide that feature. I'm not 100 % sure.

Did you try adding the following (substitute DRIVE with external USB label) to the exclusions file? (I haven't tried — just thinking out loud):

/tmp/mnt/[B]DRIVE[/B]/*

I haven't reviewed the code for backupmon in a while, but my concern would be since backupmon uses the USB to create the backup that might cause a conflict?
 
Did you try adding the following (substitute DRIVE with external USB label) to the exclusions file? (I haven't tried — just thinking out loud):

/tmp/mnt/DRIVE/*
Yes. For some reason, it's not working. I need to add every folder on the USB drive.
 
Yes. For some reason, it's not working. I need to add every folder on the USB drive.

Does it give you any error messages or logs when you tried? Or does it just ignore that value and backup the entire drive anyways?

Might help reference where to look specifically in the code if it does give any type of failure
 
Yes. It ignores that value and tries to back up everything, and for this reason, it takes forever because I have around ~100 GB of files.
What is the use case here? What are you trying to back up? Just the router settings?

Would you not just exclude the main folder that has the 100GB of files? And leave the rest of the standard folder structure for entware and whatnot for backup purposes?
 
What are you trying to back up? Just the router settings?
Correct. nvram and jffs.

Would you not just exclude the main folder that has the 100GB of files? And leave the rest of the standard folder structure for entware and whatnot for backup purposes?
Technically, I can, and I already excluded the main folder along with the other ones. But I don't use entware, and my external drive itself is a backup location for everything, including the router settings. So it doesn't make sense to try backing up anything on that drive. Also, there are some hidden files that I don't need to back up.

It doesn't need to be specifically a UI option. At least a working wildcard like this would be nice:
Code:
/mnt/DRIVE/*
I tried it initially, but unfortunately, it didn't work.

Of course, it is just a suggestion on how to improve backupmon. 🙂
 
Correct. nvram and jffs.

Technically, I can, and I already excluded the main folder along with the other ones. But I don't use entware, and my external drive itself is a backup location for everything, including the router settings. So it doesn't make sense to try backing up anything on that drive. Also, there are some hidden files that I don't need to back up.

It doesn't need to be specifically a UI option. At least a working wildcard like this would be nice:
Code:
/mnt/DRIVE/*
I tried it initially, but unfortunately, it didn't work.

Of course, it is just a suggestion on how to improve backupmon. 🙂
Well, I do have some built-in functionality where if backupmon doesn't detect a USB drive, then it assigns this variable as "NOTFOUND":

Code:
EXTLABEL="NOTFOUND"

It basically goes through the whole backup process and just backs up the nvram and jffs. It ignores the EXT drive in this case.

So a quick workaround that "should work" would be to alter line 6025:

Code:
6023 # Check to see if EXT drive exists
6024 USBPRODUCT="$(nvram get usb_path1_product)"
6025 EXTLABEL="$(_CheckForMountPointAndVolumeLabel_)"
6026 LABELSIZE="$(echo "$EXTLABEL" | sed 's/ //g' | wc -m)"

and should look like this:

Code:
6023 # Check to see if EXT drive exists
6024 USBPRODUCT="$(nvram get usb_path1_product)"
6025 EXTLABEL="NOTFOUND"
6026 LABELSIZE="$(echo "$EXTLABEL" | sed 's/ //g' | wc -m)"

Should hold you over for the meantime... not sure I'm going to make this an option since it's such an unusual use-case.
 
Should hold you over for the meantime... not sure I'm going to make this an option since it's such an unusual use-case.
Thank you for the detailed explanation. Well, maybe I've been thinking in a different way than other members of the community, but my first thought was to use a USB drive specifically as a backup location for everything - my Mac settings (I back them up using Arq Backup over SMB) and the router settings. It's good enough even without other actions like uploading a copy to the cloud cold storage because you already have the same data in two places. I was a bit confused when I didn't find an option to exclude a drive, even when using the exceptions list. In this scenario, it doesn't make sense to back up a drive to itself.
 
Thank you for the detailed explanation. Well, maybe I've been thinking in a different way than other members of the community, but my first thought was to use a USB drive specifically as a backup location for everything - my Mac settings (I back them up using Arq Backup over SMB) and the router settings. It's good enough even without other actions like uploading a copy to the cloud cold storage because you already have the same data in two places. I was a bit confused when I didn't find an option to exclude a drive, even when using the exceptions list. In this scenario, it doesn't make sense to back up a drive to itself.
I get it. ;)

I did some searching around for a tar exclusion that might catch everything... perhaps this might work in your exclusion file?

Code:
./*
 
Unfortunately, it excludes all jffs files as well.
Ahhh. Yes, it would. ;(

Welp, I'm going to have to recommend trying the "NOTFOUND" option in this case then.

Alternatively... and it might take a little work, but restructuring your external drive folder layout might help make things simpler. For instance, if you had a folder layout like this:

Code:
/ISOs
/movies
/music
/recipes
/shipping_labels

Perhaps dumping all these folders you want to "exclude" from backup, and putting them under their own folder:

Code:
/DONTBACKUP
   /ISOs
   /movies
   /music
   /recipes
   /shipping_labels
/entware

Then you would just need to make 1 entry in the exclusion file:

Code:
DONTBACKUP/*
 
Last edited:
Welp, I'm going to have to recommend trying the "NOTFOUND" option in this case then.
Thanks, I will probably stick with the current "explicitly exclude everything" approach. More manual work, but at least I won't need to modify the script on every update.
 
Hello everyone!
Recently I needed to do the same thing as kuchkovsky.
I want to make AiMesh node backups to the USB drive that also has a backup of the main router (i.e. there is no point in double backup)
I tried to change the script according to Viktor Jaep's advice, but the script gave the error "Errors detected creating EXT Drive tar file."
Actually, the script created the files I needed (nvram.cfg and jffs.tar.gz) and an empty file DISK_LABEL.tar.gz
I tried to make the script work more correctly and as a result of many experiments I found that if you simply set
Code:
EXTLABEL="NOTFOUND"
in the backupmon.cfg file, everything works as it should, even without changing the script :)
This should survive script updates, so it can be recommended as a solution for anyone who doesn't want/cannot backup a USB drive
 
I tried to make the script work more correctly and as a result of many experiments I found that if you simply set
Code:
EXTLABEL="NOTFOUND"
in the backupmon.cfg file, everything works as it should, even without changing the script :)
This should survive script updates, so it can be recommended as a solution for anyone who doesn't want/cannot backup a USB drive
Nice hack, @nexttime! :)

But just so you know... it will revert if you select a mountpoint (option #1) and save your settings. This would probably never change unless you switch to a new EXT drive, or accidentally go into this menu item and save your config.
 
Last edited:
My primary backup is working as Network samba share on my server. USB /dev/sda1 labelled Merlin. Source EXT USB drive mount point /tmp/mnt/Merlin
Then I tried setting a secondary backup with a second USB on Router. USB /dev/sdb1 labelled backups_usb.
Enabled secondary config, USB, router username & password, Secondary drive mount point /tmp/mnt/backups_usb
Now when I try backing up....it goes through the process of backing up the network but then gets an error can't unmount from network drive.
So I disabled the secondary config but left the 2nd USB in the router, and get the same error. I have to pull the USB out of the router and the primary backup will work.

What am I missing here to get the seconday backup working on the USB.
 
My primary backup is working as Network samba share on my server. USB /dev/sda1 labelled Merlin. Source EXT USB drive mount point /tmp/mnt/Merlin
Then I tried setting a secondary backup with a second USB on Router. USB /dev/sdb1 labelled backups_usb.
Enabled secondary config, USB, router username & password, Secondary drive mount point /tmp/mnt/backups_usb
Now when I try backing up....it goes through the process of backing up the network but then gets an error can't unmount from network drive.
So I disabled the secondary config but left the 2nd USB in the router, and get the same error. I have to pull the USB out of the router and the primary backup will work.

What am I missing here to get the seconday backup working on the USB.
Does the backup complete on the network drive, but then throws an error that it can't unmount that drive? It might be benign, and doesn't hurt things even if it can't unmount that drive. I'll see if I can replicate that behavior on my end.

Oh I think I see what the problem is. You're connecting to your local USB via a network share, and are then trying to unmount that. Why not just connect to it via the USB method? Then it won't force you to unmount the drive.
 
Last edited:
With the USB plugged into the router and the secondary config disabled :
The backup does not complete on the network drive.
I get this message:
STATUS: Settling for 10 seconds...
umount: can't unmount /tmp/mnt/backups: Invalid argument
WARNING: Unable to unmount from external network drive. Trying every 10 seconds for 30 seconds.
umount: can't unmount /tmp/mnt/backups: Invalid argument
WARNING: Unable to unmount from external network drive. Trying every 10 seconds for 30 seconds.

RE:Oh I think I see what the problem is. You're connecting to your local USB via a network share, and are then trying to unmount that. Why not just connect to it via the USB method? Then it won't force you to unmount the drive.
When I have the secondary config enabled, I chose USB .... so I don't follow what you mean.
 
With the USB plugged into the router and the secondary config disabled :
The backup does not complete on the network drive.
I get this message:
STATUS: Settling for 10 seconds...
umount: can't unmount /tmp/mnt/backups: Invalid argument
WARNING: Unable to unmount from external network drive. Trying every 10 seconds for 30 seconds.
umount: can't unmount /tmp/mnt/backups: Invalid argument
WARNING: Unable to unmount from external network drive. Trying every 10 seconds for 30 seconds.

RE:Oh I think I see what the problem is. You're connecting to your local USB via a network share, and are then trying to unmount that. Why not just connect to it via the USB method? Then it won't force you to unmount the drive.
When I have the secondary config enabled, I chose USB .... so I don't follow what you mean.
I'm saying, use the USB option for your primary backup. And use the USB option for your secondary backup on your secondary flashdrive.

Don't back up over the network locally to the local USB drive. That's how things are configured on your end, right? You have 2 flashdrives connected?
 
Last edited:

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!
Back
Top
âś–