#3121 Issue closed: BACKUP=BORG --prefix deprecated --glob-archives could be used instead

Labels: enhancement, external tool, no-issue-activity

llucps opened issue at 2024-01-06 16:19:

  • ReaR version ("/usr/sbin/rear -V"):

Relax-and-Recover 2.7 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):

Debian GNU/Linux 12 (bookworm)

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
### Add library path
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/systemd/

### Rescue image will be the default (ISO) ###
OUTPUT=ISO
OUTPUT_URL="sshfs://xxx@xxx.xx/."
COPY_AS_IS=("/etc/ssl/private" "/usr/share/file/magic")

### Borg stuff ###
BACKUP=BORG
BORGBACKUP_HOST="xxxx.xxx.xx"
BORGBACKUP_PORT=23
BORGBACKUP_USERNAME="xxxxx"
BORGBACKUP_REPO="/./xxxx-backup"
BORGBACKUP_ARCHIVE_PREFIX="$HOSTNAME"
BORGBACKUP_PRUNE_KEEP_DAILY=14
BORGBACKUP_PRUNE_KEEP_WEEKLY=2
BORGBACKUP_PRUNE_KEEP_MONTHLY=3
BORGBACKUP_COMPRESSION="zlib,5"
COPY_AS_IS_EXCLUDE=("/tmp" "/dev" "/proc" "/sys" "/lost+found" "/home/lost+found/" "/run/" "/var/backup/server/" "/var/backup/websites/")
BORGBACKUP_SHOW_STATS=YES
export BORG_PASSPHRASE="xxxxxxxxxxxxx"
  • Description of the issue (ideally so that others can reproduce it):

According to Borg documentation the --prefix parameter is deprecated and should not be used anymore.

https://borgbackup.readthedocs.io/en/stable/usage/prune.html
https://github.com/borgbackup/borg/issues/7031

In my logs I get this warning:

Pruning old backup archives in Borg repository /./xxxx-backup on xxx.xxx.xx
Warning: "--prefix" has been deprecated. Use "--glob-archives 'yourprefix*'" (-a) instead.

I'm assuming that although the BORGBACKUP_ARCHIVE_PREFIX="$HOSTNAME" works for now it should be replaced for something like this?

BORGBACKUP_ARCHIVE_GLOB="$HOSTNAME-*"

What do you think?
Thanks.

jsmeix commented at 2024-01-10 14:13:

I am not a BACKUP=BORG user
so I cannot actually help with BACKUP=BORG specific issues.

@llucps
do you know since when --glob-archives is supported by Borg?
I.e. since which Borg version is --glob-archives supported?

I ask because in ReaR we maintain backward compatibility, see
https://github.com/rear/rear/wiki/Coding-Style#maintain-backward-compatibility

So we cannot replace --prefix with --glob-archives
instead we must find some reasonable solution
that works for older and newer Borg versions.

But we do not need to maintain backward compatibility
for obsoleted Borg versions that are no longer supported
by upstream Borg.

On
https://www.borgbackup.org/releases/
I found (excerpts)

Borg 2.0 is currently in testing - do not use it for production.

Borg 1.4 is currently in testing - do not use it for production.

Borg 1.2 is the current stable series of Borg.
The current release is 1.2.7, released on 2023-12-02.

Borg 1.1 is not supported any more, please use Borg 1.2.x.
The current release is 1.1.18, released on 2022-06-05.

Borg 1.0 is not supported any more, please use Borg 1.2.x.
The last release in this series was 1.0.13, released on 2019-02-15.

llucps commented at 2024-01-10 16:43:

@jsmeix According the the release notes the --glob-archives option was introduced in borg 1.2.2 (2022-08-20)

https://github.com/borgbackup/borg/blob/1.2.7/docs/changes.rst#version-122-2022-08-20

And more info here https://github.com/borgbackup/borg/issues/6806

schlomo commented at 2024-01-13 17:59:

https://github.com/borgbackup/borg/issues/6806#issuecomment-1170319393 actually states that Borg 2.0 will not support the --prefix option any more, so the 1.x series presumably will continue to support it.

@llucps can you tell us how much our ReaR code will have to change in order to support Borg 2.x? If this is the only change, then we should just adjust it. But if there are more incompatible changes then we should maybe consider adding a BORG2 backup method that is fully optimised for the Borg 2.x series. We have also other backup methods (most notably GALAXY) where we have multiple backup methods to support multiple versions of the same backup software.

github-actions commented at 2024-03-14 02:01:

Stale issue message


[Export of Github issue for rear/rear.]