What's new

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

  • 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 saves the day!

A scribe update hosed my the syslog-ng.conf on the 10th, in trying to fix it last night. I reinstalled it, which over wrote the syslog-ng.d and logrotate.d directories back to default. Which fixed scribe, as it rebuilt syslog-ng.conf (now working post 4.7), but it also got rid of my custom filters.

No big deal I thought, I have a back up the config via scribe, but over a year ago unfortunately!

Feeling exhausted after my first day of PT, trying to remember what was in them to rereate them. As my brain finally kicked in and realized I have daily backup!
Opened up the .tar file from the 9th, drilled down to the syslog-ng.d and logrotate.d directories, and there the files were. Extracted the two files, went to sleep, knowing the hard part was over.

This morning, put the files in the appropriate directories on the router, restarted scribe.
Everything working again!

Another BACKUPMON success!

Thanks @Viktor Jaep
Always a good day when the world doesn't come crashing down, right? 😋
 
...
I'm facing issue with SMB share that contains blank spaces in its name was unable to get mounted:
Bash:
Test Target UNC Path  : \\\\192.168.1.33\\NAS Dmitry Test
Bash:
WARNING: Unable to mount to external network drive. Retrying...

The problem exactly and only in blank spaces, all other shares from same NAS in same network get mounted and perform backup just fine.
Also, i can successfully mount this problematic share with default mount command:
Bash:
mount -t cifs "\\\\192.168.1.33\\NAS Dmitry Test" /tmp/mnt/SHARE -o "username=XXX,password=XXX" -o vers=2.0
...
About 6 weeks ago, a friend of mine installed the BackupMon script on his router (RT-AX86U_Pro), and a bit later he asked me if I knew about the issue he was seeing when using blank space chars on directory paths. He was aware that I had contributed to the BackupMon script with some pull requests and thought that I was using it on my home router. I told him I actually did not have it installed (I already had a personal custom script to do my backups), but that I would take a look anyway. He also mentioned a minor issue where the script was showing "GT-AX6000" for some default directory paths (e.g. "/router/GT-AX6000-Backup") during the initial configuration while reporting the correct router model (RT-AX86U_Pro) on the menus. This seemed a bit confusing at first, but he had to change the defaults anyway so it was not really a big issue.

Here are some screenshots showing the minor problem (for reference).

BackupMon_v1.8.19_RT-AX86U_PRO_Setup1.jpg


BackupMon_v1.8.19_RT-AX86U_PRO_Setup2.jpg


Long story short, I made changes to a local copy of the script and gave him the modified version to test & verify on his own router using his specific configuration. So far, he has not had any problems with it. Here are some screenshots showing the modified version.

BackupMon_v1.8.20_RT-AX86U_PRO_Setup1.jpg


BackupMon_v1.8.20_RT-AX86U_PRO_Setup2.jpg


Here's a screenshot showing a successful test with directory paths containing blank spaces:

BackupMon_v1.8.20_TEST_RT-AX86U_Pro.jpg


If you want to try this modified version of the script, here are the commands to download it:
Bash:
curl -LSs --retry 3 --retry-delay 5 --retry-connrefused \
https://raw.githubusercontent.com/Martinski4GitHub/BACKUPMON/develop/backupmon.sh \
-o /jffs/scripts/backupmon.sh && chmod 755 /jffs/scripts/backupmon.sh

If this modified version works well for your case, I can submit a pull request on @Viktor Jaep’s GitHub repo.
 
Even though I haven't experienced any problems addressed by your mods, I'm testing this version. Because I can.
 
When I try using a network path with a space, it eliminates the space. I would go with your option 2. Spaces are bad all around. Never use spaces. ;)
FYI, here's a screenshot of the log partially showing the most recent backup with directory paths containing blank spaces. My friend says that the modified script has been doing his daily backups successfully, and he has seen no problems at this point.

BackupMon_v1.8.20_LOG_RT-AX86U_Pro.jpg


If you want I can submit a pull request on your repo, and you could issue a Beta release so the modified version gets more testing & verification.
 
If this modified version works well for your case, I can submit a pull request on @Viktor Jaep’s GitHub repo.
Wow! Thanks @Martinski!! I'll let it tested and released here soon! You rock!!
 
Again, @Martinski has been busy in the background adding fixes and new functionality. Here some excellent changes were made to handle spacing in shared directory paths, and making sure the correct router model shows up as default, instead of the GT-AX6000 sample I was using previously. Thank you so much! :)

What's new!?
v1.8.20 - (October 12, 2024)
- PATCH:
Code improvements to allow blank space chars in directory paths.
- PATCH: Changed defaults to directory paths to show the correct router model.
- PATCH: Changed defaults containing an IP address to show the correct LAN IP address octets of the router.
- PATCH: Various fixes and code improvements

Download link:
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"

Significant Screenshots:
It's probably best to take a look at a few posts back for some of the fixes/changes that were made! (see below) :)

 
Thank You @Martinski @Viktor Jaep
I just updated to the latest, and I received the message "I Scored"! Reminded me of the good old days of riding the school bus and scoring a direct hit (16 Candles reference)
Score A Direct Hit.jpg
 
I wanted to just have a peek at the latest ASUS firmware for my RT-AX88U Pro and also check my procedure for running BACKUPMON, so after installing the stock firmware, I did the following to return to Merlin with the latest firmware:
  1. Uploaded the latest Merlin firmware to my router.
  2. After a basic setup, restored to factory defaults via the GUI.
  3. Reset the router with the button on the hardware.
  4. Did a WPS button reset.
After this, I used the following procedure, which is the BACKUPMON instructions tailored to my particular situation. Note, this is from memory, so I hope I've listed this correctly, but it did work flawlessly:

IMPORTANT:
Asus Router Model: RT-AX88U_Pro [check before proceeding - see WARNING below]
Firmware/Build Number: [check before proceeding - see WARNING below]
EXT USB Drive Label Name: SanDiskSSD [this needs to be the same as it was when the backups were made]

WARNING: Do NOT attempt to restore if your Asus Router Model or Firmware/Build Numbers differ from your backups!

Please ensure your have performed the following before restoring your backups:
1.) Enable SSH and JFFS custom scripts and configs in the router's GUI if not already enabled.
Remember to change the default SSH port from the default 22 to something else for security reasons.
2.) Connect to the router via an SSH Terminal (like Xshell).
3.) Enter "amtm" at the command prompt and install amtm if it has not already been installed.
4.) From within amtm enter "fd" to format the connected USB drive to Ext 4 (recommended) on your router.
Label it with exactly the same name as when the backups were made by BACKUPMON (see above)!
5.) Enter "dc" to run the disc-checker script and after the router has been rebooted, check the disc-checker log by entering "dcl".
6.) If everything seems OK with the USB drive, SSH back in to amtm and create a swap file (if required).
7.) Connect to the router using WinSCP or similar, then,
8.) Restore the backupmon.sh & backupmon.cfg files (located under your backup folder) into your /jffs/scripts folder.
9.) Add additional permissions for the two backupmon files to the same as the other files in the scripts folder.
Failure to do this will result in permission-denied errors when you try to restore your backup.
10.) Exit WinSCP and reconnect via Xshell (if they are what you are using).
11.) Once back in amtm, you should see BACKUPMON listed as being installed.
Enter "bm" from the menu to open it and choose "manual restore"
12.) If everything has been set up correctly, you should see a list of folders containing your backups.
13.) Choose the one you want and after the restore finishes, perform another reboot. Everything should be restored as normal!
 
I have just gone round the houses with the network settings for the SMB CIFS share on my RT-AC68U and so am sharing my findings for the people from the future.

TLDR: the RT-AC68U CIFS client only supports SMB v1. So if you can't or don't want to run SMB v1 on your samba server for security reasons, then you won't be able to mount your samba share on the router.

More detail:
When trying to test the network share in BACKUPMON, I kept getting an error "operation not supported" when it was trying to mount the share. I also got that message when executing the mount command directly from the command line. But I could mount the share on a different linux machine (as long as it wasn't an unpriviledged proxmox container) using the same mount command, suggesting the problem was on the router config side, not the server side.
I followed a red herring by doing an nmap from a different linux machine to probe both the samba server and the router:
e.g. nmap --script smb-protocols 192.168.your.router
and nmap --script smb-protocols 192.168.your.smbserver
These both returned smb-protocols: dialects including 202.
However, what the former is actually testing is the SMB Server of the router, not the smb client of the router.
Similarly changing the SMB protocol in Asuswrt (USB Application > Servers Center > Network Place (samba) share/Cloud Disk > Samba protocol version) also changes the router's samba server and not the router's smb client.
The CIFS client specs on the router is obtained by ssh'ing into the router and then issuing:
cat /proc/fs/cifs/DebugData
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.65
Features: lanman
Active VFS Requests: 0
Servers:

Here you can see CIFS is version 1.65. Which from my brief googling suggests that it supports only SMBv1. Therefore, because my network samba server is configured for SMBv2 and up, but my router's client supports only SMBv1, I won't be able to mount the network samba share on my router. :(.

In a roundabout way, this answers the question posted here https://www.snbforums.com/threads/b...b-nfs-now-available-in-amtm.89127/post-906542

How do you determine what versions of SMB the CIFS client module can support?

NB: Forgive me if I'm using samba/smb/cifs terminology sloppily, but it probably still gets the notion across.
 
Here you can see CIFS is version 1.65. Which from my brief googling suggests that it supports only SMBv1. Therefore, because my network samba server is configured for SMBv2 and up, but my router's client supports only SMBv1, I won't be able to mount the network samba share on my router. :(.

In a roundabout way, this answers the question posted here https://www.snbforums.com/threads/b...b-nfs-now-available-in-amtm.89127/post-906542
Thanks for dipping your toe into all this and posting your findings... sounds like it's time for an upgrade! :)
 
Hello, I am having a bit of trouble here.

I have a SSD in a USB case with 2 partitions, sda1 named amtm and sda2 named backup in ntfs.
At first, I did backup to the second partition mounted as /tmp/mnt/backup.
I use Network Place (Samba) Share / Cloud Disk so I can always access it, via windows, on the network
at \\RTAX58U\router (at backup)\AX58U-Backup as it always stays mounted.

backupmon04.jpg

I tested the network but I am using the same mount point /tmp/mnt/backup.
backupmon03.jpg
It looks like it is working, but nothing is in the \\192.168.1.2\NetBackup\nas\AX58U-Backup.

Worse, the /tmp/mnt/backup is unmounted and I can't access \\RTAX58U\router (at backup)\AX58U-Backup anymore.
Or the /tmp/mnt/backup in SSH, which makes sense since it was unmounted.

After rebooting the router I find the backup in /tmp/mnt/backup/nas/AX58U-Backup.


I guess my problem is that the External USB drive continues to stay mounted on /tmp/mnt/backup bugging the network backup.
And then the External network drive ( \\192.168.1.2\NetBackup ) unmounted successfully removes the network share.

So I can't use both method together ?
Code:
166 Oct 22 2024 02:30:02 RTAX58U BACKUPMON[22377] - INFO: External drive (USB) mounted successfully as: /tmp/mnt/backup
167 Oct 22 2024 02:30:02 RTAX58U BACKUPMON[22377] - INFO: Daily Backup Directory successfully created.
168 Oct 22 2024 02:30:03 RTAX58U BACKUPMON[22377] - INFO: Finished backing up JFFS to /tmp/mnt/backup/router/AX58U-Backup/22/jffs.tar.gz
169 Oct 22 2024 02:30:03 RTAX58U BACKUPMON[22377] - INFO: Finished integrity check for /tmp/mnt/backup/router/AX58U-Backup/22/jffs.tar.gz
170 Oct 22 2024 02:30:04 RTAX58U BACKUPMON[22377] - INFO: Finished backing up NVRAM to /tmp/mnt/backup/router/AX58U-Backup/22/nvram.cfg
171 Oct 22 2024 02:30:04 RTAX58U BACKUPMON[22377] - INFO: Finished copying routerfw.txt to /tmp/mnt/backup/router/AX58U-Backup/22/routerfw.txt
172 Oct 22 2024 02:30:04 RTAX58U BACKUPMON[22377] - INFO: Starting backup of EXT Drive on Tue Oct 22 02:30:04 DST 2024
173 Oct 22 2024 02:31:00 RTAX58U BACKUPMON[22377] - INFO: Finished backing up EXT Drive in 56 sec to /tmp/mnt/backup/router/AX58U-Backup/22/amtm.tar.gz
174 Oct 22 2024 02:31:01 RTAX58U BACKUPMON[22377] - INFO: Starting integrity check of EXT Drive on Tue Oct 22 02:31:01 DST 2024
175 Oct 22 2024 02:31:06 RTAX58U BACKUPMON[22377] - INFO: Finished integrity check for /tmp/mnt/backup/router/AX58U-Backup/22/amtm.tar.gz
176 Oct 22 2024 02:31:06 RTAX58U BACKUPMON[22377] - INFO: Finished copying backupmon.sh script to /tmp/mnt/backup/router/AX58U-Backup
177 Oct 22 2024 02:31:06 RTAX58U BACKUPMON[22377] - INFO: Finished copying backupmon.cfg file to /tmp/mnt/backup/router/AX58U-Backup
178 Oct 22 2024 02:31:06 RTAX58U BACKUPMON[22377] - INFO: Finished copying pfexclusion.txt file to /tmp/mnt/backup/router/AX58U-Backup
179 Oct 22 2024 02:31:06 RTAX58U BACKUPMON[22377] - INFO: Finished copying reference nvram.txt extract to /tmp/mnt/backup/router/AX58U-Backup
180 Oct 22 2024 02:31:06 RTAX58U BACKUPMON[22377] - INFO: Finished copying restoration instructions.txt file to /tmp/mnt/backup/router/AX58U-Backup
181 Oct 22 2024 02:31:16 RTAX58U BACKUPMON[22377] - INFO: External USB drive continues to stay mounted.


186 Oct 22 2024 17:34:47 RTAX58U BACKUPMON[7374] - INFO: External network drive ( \\192.168.1.2\NetBackup ) mounted successfully under: /tmp/mnt/backup
187 Oct 22 2024 17:34:47 RTAX58U BACKUPMON[7374] - INFO: Daily Backup Directory successfully created.
188 Oct 22 2024 17:34:48 RTAX58U BACKUPMON[7374] - INFO: Finished backing up JFFS to /tmp/mnt/backup/nas/AX58U-Backup/22/jffs.tar.gz
189 Oct 22 2024 17:34:48 RTAX58U BACKUPMON[7374] - INFO: Finished integrity check for /tmp/mnt/backup/nas/AX58U-Backup/22/jffs.tar.gz
190 Oct 22 2024 17:34:49 RTAX58U BACKUPMON[7374] - INFO: Finished backing up NVRAM to /tmp/mnt/backup/nas/AX58U-Backup/22/nvram.cfg
191 Oct 22 2024 17:34:49 RTAX58U BACKUPMON[7374] - INFO: Finished copying routerfw.txt to /tmp/mnt/backup/nas/AX58U-Backup/22/routerfw.txt
192 Oct 22 2024 17:34:49 RTAX58U BACKUPMON[7374] - INFO: Starting backup of EXT Drive on Tue Oct 22 17:34:49 CEST 2024
193 Oct 22 2024 17:35:49 RTAX58U BACKUPMON[7374] - INFO: Finished backing up EXT Drive in 60 sec to /tmp/mnt/backup/nas/AX58U-Backup/22/amtm.tar.gz
194 Oct 22 2024 17:35:49 RTAX58U BACKUPMON[7374] - INFO: Starting integrity check of EXT Drive on Tue Oct 22 17:35:49 CEST 2024
195 Oct 22 2024 17:35:56 RTAX58U BACKUPMON[7374] - INFO: Finished integrity check for /tmp/mnt/backup/nas/AX58U-Backup/22/amtm.tar.gz
196 Oct 22 2024 17:35:56 RTAX58U BACKUPMON[7374] - INFO: Finished copying backupmon.sh script to /tmp/mnt/backup/nas/AX58U-Backup
197 Oct 22 2024 17:35:56 RTAX58U BACKUPMON[7374] - INFO: Finished copying backupmon.cfg file to /tmp/mnt/backup/nas/AX58U-Backup
198 Oct 22 2024 17:35:56 RTAX58U BACKUPMON[7374] - INFO: Finished copying pfexclusion.txt file to /tmp/mnt/backup/nas/AX58U-Backup
199 Oct 22 2024 17:35:56 RTAX58U BACKUPMON[7374] - INFO: Finished copying reference nvram.txt extract to /tmp/mnt/backup/nas/AX58U-Backup
200 Oct 22 2024 17:35:56 RTAX58U BACKUPMON[7374] - INFO: Finished copying restoration instructions.txt file to /tmp/mnt/backup/nas/AX58U-Backup
201 Oct 22 2024 17:36:06 RTAX58U BACKUPMON[7374] - INFO: External network drive ( \\192.168.1.2\NetBackup ) unmounted successfully.
 
Yes, you can use both — I actually backup to local NAS, remote NAS, as well as USB (mainly because i can... ;)). The first thing that you MUST do is use different mount points (e.g., /tmp/mnt/backup and /tmp/mnt/backup2).
 
And that's the problem, I can't mount another one. I even tried with SMB 1.0.
Code:
mount -t cifs \\\\192.168.1.2\\NetBackup /tmp/mnt/netbackup/ -o "username=*********,password=*********,vers=2.0"
mount: mounting \\192.168.1.2\NetBackup on /tmp/mnt/netbackup/ failed: No such device

I see can see sda1 and sda2 mounted, I guess there's a problem with the type CIFS.

Code:
/dev/sda1 on /tmp/mnt/amtm type ext4 (rw,nodev,relatime)
/dev/sda2 on /tmp/mnt/backup type tntfs (rw,nodev,relatime,uid=0,gid=0,umask=00,allow_utime=0022,utf8,min_prealloc_size=64k,max_prealloc_size=19518972,readahead =1M,user_xattr,case_sensitive,disable_sparse,fail_safe,hidden=show,dotfile=show,protected_system=show,errors=continue,mft_zone_multiplier=1)

But I can use windows 10 to browse the SMB share on the router.


I followed this https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting
The kernel version you're using (the output of uname -r)
4.19.183

The mount.cifs version you're using (mount.cifs -V)
-sh: mount.cifs: not found


@RTAX58U:/proc/fs# cat /proc/fs/cifs/DebugData
cat: can't open '/proc/fs/cifs/DebugData': No such file or directory



if you're able to mount the host, get the contents of /proc/fs/cifs/DebugData
@RTAX58U:/proc/fs# ls
ext4 jbd2 nfsd

So the router has a SAMBA server up to SMB2.0 but no SAMBA client ?

@RTAX58U:/tmp/home/root# modprobe md4
modprobe: module md4 not found in modules.dep

@RTAX58U:/tmp/home/root# modprobe cifs
modprobe: module cifs not found in modules.dep

find / cifs.ko
find: ‘cifs.ko’: No such file or directory
 
Last edited:
And that's the problem, I can't mount another one. I even tried with SMB 1.0.
Code:
mount -t cifs \\\\192.168.1.2\\NetBackup /tmp/mnt/netbackup/ -o "username=*********,password=*********,vers=2.0"
mount: mounting \\192.168.1.2\NetBackup on /tmp/mnt/netbackup/ failed: No such device

I see can see sda1 and sda2 mounted, I guess there's a problem with the type CIFS.

Code:
/dev/sda1 on /tmp/mnt/amtm type ext4 (rw,nodev,relatime)
/dev/sda2 on /tmp/mnt/backup type tntfs (rw,nodev,relatime,uid=0,gid=0,umask=00,allow_utime=0022,utf8,min_prealloc_size=64k,max_prealloc_size=19518972,readahead =1M,user_xattr,case_sensitive,disable_sparse,fail_safe,hidden=show,dotfile=show,protected_system=show,errors=continue,mft_zone_multiplier=1)

But I can use windows 10 to browse the SMB share on the router.


I followed this https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting


So the router has a SAMBA server up to SMB2.0 but no SAMBA client ?
Yes, the router has an smb client — my Synology DS718+/DS918+ work flawlessly as destinations with v3.02 enabled. Questions:
  1. Can you please share your backupmon config settings (with passwords redacted, of course)?
  2. What CIFS/SMB version are you using ("Backup CIFS/SMB Version" in config)?
  3. What NAS vendor/model/firmware are you using?
  4. What version(s) of CIFS/SMB are configured on the NAS?
  5. Is the is SMB and netbackup access enabled for the user on the NAS?
 
Last edited:
Yes, there is an SMB client available. Questions:

Yes, the router has an smb client — my Synology DS718+/DS918+ work flawlessly as destinations with v3.02 enabled. Questions:
  1. Can you please share your backupmon config settings (with passwords redacted, of course)?
  2. What CIFS/SMB version are you using ("Backup CIFS/SMB Version" in config)?
  3. What NAS vendor/model/firmware are you using?
  4. What version(s) of CIFS/SMB are configured on the NAS?
  5. Is the is SMB and netbackup access enabled for the user on the NAS?
No need to, the problem is on the router AX58Uv2 with CIFS.
cifs.ko is missing from 3004.388.8_2-gnuton1.

Besides I already gave those information on my previous post.
 
No need to, the problem is on the router AX58Uv2 with CIFS.
cifs.ko is missing from 3004.388.8_2-gnuton1.

Besides I already gave those information on my previous post.
Sorry, but RT-AX58U v2 with gnuton firmware is new info!
 

Similar threads

Latest 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