digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.58k stars 116 forks source link

Fix clean command suggestion when using non-default port for remote targets #559

Open ckotte opened 9 months ago

ckotte commented 9 months ago
$ btrbk --version
btrbk command line client, version 0.32.6
$ sudo -u btrbk btrbk resume --progress
WARNING: Target subvolume "myhost.dyndns.com[1234]:/mnt/backup-system/myhost/root.20230913T1600" exists, but is not a receive target of "/mnt/btrfs/@snapshots/btrbk/root.20230913T1600"
WARNING: Please delete stray subvolumes: "btrbk clean myhost.dyndns.com[1234]:/mnt/backup-system/myhost"
WARNING: Skipping backup of: /mnt/btrfs/@snapshots/btrbk/root.20230913T1600
Creating backup: myhost.dyndns.com[1234]:/mnt/backup-system/myhost/root.20230914T1450
...
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230924T1500
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230925T1700
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230926T1300
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230926T1400
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230926T1505
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230926T1533
>>> myhost.dyndns.com[1234]:/mnt/backup-data/myhost/data.20230926T1600

NOTE: Some errors occurred, which may result in missing backups!
Please check warning and error messages above.
Please delete stray subvolumes: "btrbk clean myhost.dyndns.com[1234]:/mnt/backup-system/myhost"
Please delete stray subvolumes: "btrbk clean myhost.dyndns.com[1234]:/mnt/backup-data/myhost"

The suggested command btrbk clean myhost.dyndns.com[1234]:/mnt/backup-data/myhost doesn't work.

sudo -u btrbk btrbk clean myhost.dyndns.com\[1234\]:/mnt/backup-system/myhost
ERROR: Filter argument "myhost.dyndns.com[1234]:/mnt/backup-system/myhost" does not match any volume, subvolume, target or group declaration

The command has to be btrbk clean myhost.dyndns.com:1234/mnt/backup-system/icarus

Maybe it makes sense to change the output of the subvolume names too to the "real" name/location?

>>> myhost.dyndns.com:1234/mnt/backup-data/myhost/data.20230926T1300
H0w4rd commented 5 months ago

Thanks, I just wanted to create an issue like this, now I know how to change the clean command.