digint / btrbk

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

suggested btrbk clean can delete valid backups #536

Open ian-kelling opened 1 year ago

ian-kelling commented 1 year ago
 WARNING: Target subvolume "example.org:/mnt/o/btrbk/o.20230420T091826-0400" exists, but is not a receive target of "/mnt/o/btrbk/o.20230420T091826-0400"
 WARNING: Please delete stray subvolumes: "btrbk clean example.org:/mnt/o/btrbk"

However, my main use case is to run btrbk from host1 to host2 for a few days, then switch to the opposite direction, and repeat. So, btrbk clean will kill off half my backups. When I fail a btrbk run due to a network error, I get the above suggestion. Instead, it should suggest a command that will just delete the backups that it would complain about wanting to make but not being receive targets.

digint commented 1 year ago

So, btrbk clean will kill off half my backups

Can you give an example on why it kills half your backups? btrbk clean should really only remove unfinished (garbled) targets.

https://github.com/digint/btrbk/blob/master/btrbk#L6599

# incomplete received (garbled) subvolumes are not readonly and have no received_uuid (as of btrfs-progs v4.3.1).
# a subvolume in droot matching our naming is considered incomplete if received_uuid is not set!