Allow negations in /etc/sysupgrade.conf

I'd like to have !/data/vm/*.qcow2 in my sysupgrade.conf to exclude large virtual machine files that are backed up outside of the normal OpenWrt processes.

sysupgrade only backs up (additional) files and directories if it is told to do so. Did you add /data or /data/vm to your sysupgrade.conf?

Yes, I'm asking to be able to add negations like you would with rsync or similar.

I understood your feature request.

In the meantime, I'm curious to understand your situation, though. If you need to manually restore the VM machine files after a sysupgrade, why not back up and restore the rest of the /data/vm directory in the same manner? What good is sysupgrade doing a partial backup without the VM machine files?

The VM files are backed up less frequently as they're easier to rebuild from scratch and they're a lot larger. I'm often backing up over a bandwidth-limited link so ~20GB of files nightly would be a tall ask.

That sounds a lot like you're using sysupgrade to generate backup tar files for (part of) your data. You don't need sysupgrade to do that, you can just directly use tar with all the granularity and exceptions you need.

Going over the sysupgrade code, it would involve some non-trivial postprocessing of file lists to have "exclusions" or "negations" like you envision.

2 Likes

There's another issue with this approach and misusing the feature, size. The backup tarball is treated specially during the sysupgrade process, appended (raw) to the to-be-flashed image, which uses space on-disk and in-RAM, going too large can break this process quite badly.

5 Likes

Agreed but the sysupgrade config download gives me a nice HTTP endpoint to hit to get an updated backup file.

So you cobbled together a "remote backup solution" by (ab)using mechanisms in ways they were never intended. While I applaud the "hacking" spirit, it really begs the question:

Why not actually use rsync?

1 Like

As an alternative, look at luci-app-commands.
It enables you to define shell commands that you can trigger from a button LuCI GUI.
You could define suitable backup/restore commands (or scripts to be launched).

3 Likes

Thank you! That's almost exactly what I need and it'll solve a few other issues too!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.