Do I need to configure anything?
You can enter the setup screen with the command 'backupmon.sh -setup' or by hitting the 's' key within 10 seconds of the backup starting:
Hitting the "sc" option, there are currently 15 items you can configure.
I'm definitely looking for your feedback... what works, what doesn't... what else would you like to see. But all-in-all, as good ideas come up for things to possibly add, very much a WIP (work-in-progress).

Lots more stuff to come... I'm looking at adding a way to add some functionality to schedule the backups in CRON... so check back soon!
More Information:
1.)
How does it all work? In TLDR; format, when BACKUPMON runs a regular backup, it will create a daily folder under the folder structure you have defined for it to connect to on your network share. So for example today, on September 4, 2023, it would create a /04 folder (if you're on a "Monthly" frequency), where its backups will get dumped into.
2.)
Backup Retentions- there are 4 different kinds depending on your preference:
- "Weekly" retention would write "Mon, Tue... Sun" folders.
- "Monthly" would write daily "01, 02, 03... 30, 31" folders for each day of the month,
- "Yearly" would write "001, 002, 003... 364, 365" folders for each day of the year.
- "Perpetual" would write a unique folder based on date/time, such as "20230909-092511".
At this time, "basic mode" (explained below in more detail) will back everything up in 1 week, month or year cycles, and will overwrite the backup files each time it comes across the same day in its cycle, unless you've chosen the "Perpetual" retention, in which case it keeps backups forever under its unique folder structure. In "advanced mode", it does not overwrite backups in your weekly, monthly and yearly folders, and keeps everything forever... Here's a screenshot of what your backup folders on your network share might look like (please note there's a bit of a mix between "Monthly" and "Perpetual" retention backups as I was testing...
3.)
Backup copies - During a backup, BACKUPMON will also copy over a copy of
'backupmon.sh', 'backupmon.cfg', any optional TAR exceptions list you have defined, a text dump of your NVRAM, and a copy of restore "instructions.txt". (see above) Within this instructions.txt file, you will find the same instructions you see on screen during a restore, telling you what steps need to be taken for a successful restore. In it, is also your latest external
USB drive label, which must be duplicated when you format a new USB drive, and want to restore your backup to it.
4.) The
optional TAR exclusion list can be placed in a directory of your choice.
PLEASE NOTE: By default, backupmon will back up everything, swap files, log files, included! It is a good idea to exclude these using this exclusion list file. You may encounter issues restoring backups if you try to restore a swap file to an already existing swap file on your router. You can create this file anywhere, but I prefer to keep things in /jffs/addons/backupmon.d and named it "exclusions.txt", just to clear the clutter. The contents of this file is simply a list of files that TAR can safely ignore during a backup. Certain files, like your swap file, or other temporary files, aren't needed when restoring a backup, and get recreated after a restore.
As of v1.42, the swap file is being excluded from backups unless you override this option (#9) in the config menu. Huge thanks to
@visortgw for sharing his exclusion file... the default exclusion items list looks something like this:
exclusions.txt
Code:
myswap.swp
entware/var/log/*
skynet/skynet.log
entware/var/lib/unbound/unbound.log
*.tar
*.gz
Save this file somewhere on your router, and make sure it's properly referenced in BACKUPMON. Eliminating swap and other temp files could really speed up your backups tremendously, and save you from headaches down the road on a restore.
5.) The
Basic vs Advanced Mode differences are described below:
BASIC
- Only backs up one backup set per daily folder
- Backup file names have standard names based on jffs and USB drive label names
- Self-prunes the daily backup folders by deleting contents before backing up new set
(N/A when 'Perpetual Retention' is enabled)
- Will overwrite daily backups, even if multiple are made on the same day
(N/A when 'Perpetual Retention' is enabled)
- Restore more automated, and only required to pick which day to restore from
ADVANCED
- Backs up multiple daily backup sets per daily folder
- Backup file names contain extra unique date and time identifiers
- Keeps all daily backups forever, and no longer self-prunes
- Will not overwrite daily backups, even if multiple are made on the same day
- Restore more tedious, and required to type exact backup file names before restore
6.)
Manually Purging Perpetual Backups -- Under the config menu, when selecting
"perpetual" backup retention, you will have the option to choose whether you want to enable backup purging for everything older than a certain number of days. Once configured, you can manually access the purge backups functionality under the operations area under the setup menu. This function will step you through multiple prompts before committing to delete any backups, and will show you which backups are affected.
PLEASE NOTE: deleting backups is permanent, and advise caution on what you are deleting, and ensure that the list presented to you is what you want deleted. Also,
PLEASE NOTE: if there are any backups that you want to
save or store for later use, PLEASE move these to a SAFE and otherwise secure location outside of the backup folder structure that BACKUPMON utilizes, else there will be a chance these backups will get deleted.
Automatically Purging Perpetual Backups -- if you have enabled "Perpetual Backups", and "Purge backups", and run BACKUPMON with the -backup switch (ie. "sh backupmon.sh -backup"), then it will auto purge your backups after it finishes your normal backup. This was done to make it simpler when running this under a daily CRON job to not only back up but purge as well with one command.
See screenshot below as an example:
7.)
Commandline switches - When running backupmon with a switch, you can utilize other functionality that is normally only available through the UI. Here is an explanation of what each switch does:
sh /jffs/scripts/backupmon.sh -- Running the script with no switches simply runs the primary and secondary backups (no auto purge).
sh /jffs/scripts/backupmon.sh -setup -- This displays the setup + operations menu
sh /jffs/scripts/backupmon.sh -backup -- This runs the normal primary and secondary backups,
and runs auto purge
sh /jffs/scripts/backupmon.sh -restore --This initiates the restore procedure, allowing you to pick from primary or secondary backups
sh /jffs/scripts/backupmon.sh -purge -- This runs the auto purge routine against the perpetual backup folders
sh /jffs/scripts/backupmon.sh -secondary -- This runs the secondary backup only, and does not perform auto purge
B&W Mode: You can now optionally run a monochrome color scheme for those who are capturing screen output by using a secondary -bw switch after any of the other primary switches. Example:
sh /jffs/scripts/backupmon.sh -backup -bw -- This runs the normal primary and secondary backups,
and runs auto purge in B&W mode!