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!

When trying to install backupmon on a new router, I am again unable to initiate the initial configuration. Running:
Code:
sh /jffs/scripts/backup.sh -setup
results in fatal error:
ERROR: BACKUPMON is not configured. Please run 'backupmon.sh -setup' first.
Any thoughts?
DANG... seems like I introduced that same bug for a brand-new setup! I am better than this! ARGHH!! Please try downloading the same version again... I removed the offending line(s).

Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.17.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"
 
@Viktor Jaep just checked my backup folder and a couple of days ago my setup started doing HOURLY backups at 4 minutes past the hour.

That's a bit TOO often even for me!

:D

Not sure which version it started with ... but it WAS only doing one per day for a few days.

My cron line your script is adding is:-

Code:
4 30 * * * sh /jffs/scripts/backupmon.sh -backup #RunBackupMon#

(I changed the time in setup to 4 hours and 30 minutes and just manually added in the "-backup" switch" in services-start).

Config is this:-

Code:
   : Source Router Model         :RT-AX86U
 1 : Backup Target Username      :(hidden)
 2 : Backup Target Password      :(hidden)
 3 : Backup Target UNC Path      :\\\\xxx.xxx.xxx.xxx\\(hidden)
 4 : Local Drive Mount Path      :/tmp/mnt/backups
 5 : Backup Target Dir Path      :/(hidden)
 6 : Backup Exclusion File Name  :/jffs/addons/backupmon.d/(hidden)
 7 : Schedule Backups?           :Yes
 |--  Time:                      :4:30
 8 : Backup Frequency?           :Perpetual
 |--  Purge Backups?             :Yes
 |--  Purge older than (days):   :90
 9 : Backup/Restore Mode         :Basic

My quick Google on "cru" seems to say that perhaps the "4" and the "30" are "coming out" of your script the wrong way around?

It probably only occurs if you change from the default time I'm guessing, which probably no-one else has bothered to do?
 
@Viktor Jaep just checked my backup folder and a couple of days ago my setup started doing HOURLY backups at 4 minutes past the hour.

That's a bit TOO often even for me!

:D

Not sure which version it started with ... but it WAS only doing one per day for a few days.

My cron line your script is adding is:-

Code:
4 30 * * * sh /jffs/scripts/backupmon.sh -backup #RunBackupMon#

(I changed the time in setup to 4 hours and 30 minutes and just manually added in the "-backup" switch" in services-start).

Config is this:-

Code:
   : Source Router Model         :RT-AX86U
 1 : Backup Target Username      :(hidden)
 2 : Backup Target Password      :(hidden)
 3 : Backup Target UNC Path      :\\\\xxx.xxx.xxx.xxx\\(hidden)
 4 : Local Drive Mount Path      :/tmp/mnt/backups
 5 : Backup Target Dir Path      :/(hidden)
 6 : Backup Exclusion File Name  :/jffs/addons/backupmon.d/(hidden)
 7 : Schedule Backups?           :Yes
 |--  Time:                      :4:30
 8 : Backup Frequency?           :Perpetual
 |--  Purge Backups?             :Yes
 |--  Purge older than (days):   :90
 9 : Backup/Restore Mode         :Basic

My quick Google on "cru" seems to say that perhaps the "4" and the "30" are "coming out" of your script the wrong way around?

It probably only occurs if you change from the default time I'm guessing, which probably no-one else has bothered to do?
I've confirmed this error.
 
I've confirmed this error.

Thanks @Ripshod for the confirmation.

I've manually edited my cron job to:-

Code:
cru a RunBackupMon "30 4 * * * sh /jffs/scripts/backupmon.sh -backup"

then rebooted - I'll see how it goes overnight.
 
...
My cron line your script is adding is:-

Code:
4 30 * * * sh /jffs/scripts/backupmon.sh -backup #RunBackupMon#

...

My quick Google on "cru" seems to say that perhaps the "4" and the "30" are "coming out" of your script the wrong way around?
Yeah, the numbers are in reverse order. The command should be:
Bash:
30  4  *  *  *  sh /jffs/scripts/backupmon.sh -backup #RunBackupMon#
So the change you made to the cru command as described in your previous post is correct.
 
DANG... seems like I introduced that same bug for a brand-new setup! I am better than this! ARGHH!!
I'd like to offer you a piece of advice. As always, you can take the advice and adjust it to your own principles & methodologies, or you can choose to ignore it completely.

As you develop your s/w projects and add features & new functionality, there is a way to minimize the chances of reintroducing bugs or inadvertently adding new bugs to existing features & capabilities. Essentially, you create a s/w test bench where you build & collect a set of test routines, each of which tests a specific module, functionality, or capability in your s/w project. As you add/modify your code, and every time you're ready to release a new version of the project, you run the test bench to ensure all pre-existing test cases as well as any new ones pass successfully. For every new functionality/feature/capability that you have in your s/w, you create a new test routine.

This is a very useful technique to add to your s/w development practices; one that you develop over time and forces you to think about the different ways a piece of s/w can fail and, therefore, write the corresponding error checking & handling code. The implementation of this technique can vary widely based on the programming language being used and whether the source code is compiled or interpreted (like shell scripts are).

I previously provided a simple example of this kind of test bench in the following post.

This technique is also very useful when you're refactoring your script to eliminate redundant code or increase efficiency/performance without changing the actual behavior or functionality of the application.

Just my 2 cents.
 
Sure enough... checked my backups as well, and they were going off every hour. LOL. I'll get that cru statement corrected. Thank you for catching that!

Thanks for the suggestions, @Martinski... I'm typically testing the newer additions and don't go through a complete regression test. I will see if I can work out a better testing plan before putting out a release. Great idea. ;) And thanks for that code sample... that's good stuff!!
 
Last edited:
This has been corrected... thanks for the catch, @Stephen Harrington!

What's new?
v1.18 - (September 20, 2023)
- FIXED:
Bug associated with generating a correct CRON statement. Thanks to @Stephen Harrington for the catch. Minutes and hours were reversed, and has been corrected.

Download link (or update directly within BACKUPMON):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.18.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"
 
@Viktor Jaep just checked my backup folder and a couple of days ago my setup started doing HOURLY backups at 4 minutes past the hour.

That's a bit TOO often even for me!

:D

Not sure which version it started with ... but it WAS only doing one per day for a few days.

My cron line your script is adding is:-

Code:
4 30 * * * sh /jffs/scripts/backupmon.sh -backup #RunBackupMon#

(I changed the time in setup to 4 hours and 30 minutes and just manually added in the "-backup" switch" in services-start).

Config is this:-

Code:
   : Source Router Model         :RT-AX86U
 1 : Backup Target Username      :(hidden)
 2 : Backup Target Password      :(hidden)
 3 : Backup Target UNC Path      :\\\\xxx.xxx.xxx.xxx\\(hidden)
 4 : Local Drive Mount Path      :/tmp/mnt/backups
 5 : Backup Target Dir Path      :/(hidden)
 6 : Backup Exclusion File Name  :/jffs/addons/backupmon.d/(hidden)
 7 : Schedule Backups?           :Yes
 |--  Time:                      :4:30
 8 : Backup Frequency?           :Perpetual
 |--  Purge Backups?             :Yes
 |--  Purge older than (days):   :90
 9 : Backup/Restore Mode         :Basic

My quick Google on "cru" seems to say that perhaps the "4" and the "30" are "coming out" of your script the wrong way around?

It probably only occurs if you change from the default time I'm guessing, which probably no-one else has bothered to do?
cron most likely interprets hour of 30 as "*" (i.e., every hour).
 
This has been corrected... thanks for the catch, @Stephen Harrington!

What's new?
v1.18 - (September 20, 2023)
- FIXED:
Bug associated with generating a correct CRON statement. Thanks to @Stephen Harrington for the catch. Minutes and hours were reversed, and has been corrected.

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

 
Another great and useful script @Viktor Jaep , thank you so much.
Worked right out of the box for me.
And I can finally delete the 'Backup feature' line in my to do list for amtm. It's been there for years staring at me!

Integrating BACKUPMON into amtm is already done on my development copy.
However, there's a slight file mismatch between the current version 1.18 and the file that amtm pulls and checks against on GitHub.
A dot, full stop or period that made it into the very first line that seems out of place. A curious mind wonders if that perhaps was added intentionally to alert the creator of activity by this writer. We may never know - unless this is fixed and duly explained by the party responsible for this blunder.
 
Another great and useful script @Viktor Jaep , thank you so much.
Worked right out of the box for me.
And I can finally delete the 'Backup feature' line in my to do list for amtm. It's been there for years staring at me!

Integrating BACKUPMON into amtm is already done on my development copy.
However, there's a slight file mismatch between the current version 1.18 and the file that amtm pulls and checks against on GitHub.
A dot, full stop or period that made it into the very first line that seems out of place. A curious mind wonders if that perhaps was added intentionally to alert the creator of activity by this writer. We may never know - unless this is fixed and duly explained by the party responsible for this blunder.
A Sunday morning sense of humour, I detect.
 
Another great and useful script @Viktor Jaep , thank you so much.
Worked right out of the box for me.
And I can finally delete the 'Backup feature' line in my to do list for amtm. It's been there for years staring at me!
You are very welcome... and as always, giving @Jeffrey Young credit where credit is due, for his awesome sample from which it was inspired from! :)

Integrating BACKUPMON into amtm is already done on my development copy.
However, there's a slight file mismatch between the current version 1.18 and the file that amtm pulls and checks against on GitHub.
A dot, full stop or period that made it into the very first line that seems out of place. A curious mind wonders if that perhaps was added intentionally to alert the creator of activity by this writer. We may never know - unless this is fixed and duly explained by the party responsible for this blunder.
LOL. This is not the first time I've run across the "dot" problem when looking at source files in Github... (and oh, it's been fixed)... but the responsible party can explain exactly why this continues to happen... You see, when I have to paste over existing code, through habit I typically select all (CTRL-A), delete, then paste the new code in (CTRL-V), then save the file on Github. My downfall here is that my delete key also acts as a "dot / . " key if the STUPID NUMLOCK KEY ISN'T ON... and so all the CTRL-A text is replaced by a ".", and then appended by the CTRL-V code.

1695558941858.png


Long way of saying, I'm still not a big fan of this fancy 10-key pad on my new laptop... and will be making sure that I don't use this method again to alert said author. :p
 
Last edited:
You see, when I have to paste over existing code, I typically select all (CTRL-A), delete, then paste the new code in (CTRL-V), then save the file on Github.
Try this on source: CTRL-A and CTRL-C and THEN on the destination CTRL-A followed by CTRL-V. No delete necessary, I've done it a million times.
 
Try this on source: CTRL-A and CTRL-C and THEN on the destination CTRL-A followed by CTRL-V. No delete necessary, I've done it a million times.
Sounds logical. Thanks!
 

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