May I suggest changing the name to something more direct? Calling it "--invert" means the user must think through what the default sense of the test is, then negate that in their mind. Not exactly a tough mental task, but people do make careless errors.
Perhaps something like "--list=keep" and "--list=discard" (with the default being "discard").
Also, typos:
"will make prunef to keep" --> "will make prunef keep"
"list backups that will should be" --> "list backups that should be"
I will consider changing the invert flag, but I'm not that happy with something like "--list=...". There will be only two modes with discard being the default one. So imho there should be only one flag to switch to the non-default mode.
Meta: I'm excited to see sr.ht starting to pop up in the wild like this:) I hope this is part of it starting to take off.
[1] https://borgbackup.readthedocs.io/en/stable/usage/prune.html
"... for the Unix shell" makes little sense. When I used Unix my shell was csh, later tcsh. Nowadays my shell is bash in most cases and dash in some more limited environments. Either case, "the Unix shell" does not exist.
tar -zcv <SRC_BACKUP> | gpg -c --batch --passphrase <PASSWORD> -o <DEST_BACKUP>.gz.gpg
In my experience the encryption part doesn't add any extra time on a modern machine, with the spinning disk being the slowest cog.* /var/backup/db/db1/monday.sql
* /var/backup/db/db1/tuesday.sql
* /var/backup/db/db1/monday.sql
For databases that change more frequently I instead backup every 1, 3, 4 hours as appropriate:
* /var/backup/db/db2/monday/00.sql
* /var/backup/db/db2/monday/04.sql
The appeal of this is that I always have "local" backups, and I don't need to consider rotation at all each one gets the most recent copy when it runs, and I have an alert/alarm to make sure files are recent enough that things aren't broken. I appreciate that if your databases dumps are 600Gb each, or something similarly sized you'd waste a lot of space, but for small things the simplicity of this approach is a good win.
(These get copied offsite as part of the backup of the whole filesystem. In the past I used to backup only some stuff, that failed the first time I tried to restore a mailserver and didn't have /var/lib/mailman archived! These days I explicitly backup "/" excluding only /tmp, /proc, /sys, and /dev.)
(Zfs snaps make awesome backups too, but unlike tar are inherently tied to zfs)