digint / btrbk

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

support for "foreign" snapshots and/or custom naming schemes #301

Open fallenguru opened 4 years ago

fallenguru commented 4 years ago

As I understand it, currently btrbk is designed to only work on snapshots it has created itself, or at least ones that follow the configured -- or is it any supported? -- naming scheme. This leads to duplicated functionality (= added complexity = more ways to fail) when snapshots created by other tools and/or manually created ones are added to the mix.

For example, I already use Timeshift for system-level undo on Ubuntu and Linux Mint -- it's well integrated and works well. That means I already have scheduled (rw) snapshots of the root subvolume, I just need btrbk on the backup server to [re-shapshot them ro] to pull them. Then I have a couple of subvolumes where before-change/after-change makes more sense than a time-based schedule, so I ro-snapshot them manually or via custom scripts, those just need intelligent replication. For the home subvolume, I'd appreciate the full functionality of btrbk, scheduled snapshots, backups, pruning, the works.

digint commented 4 years ago

btrbk needs a timestamp, which is set on the subvolumes created. Supporting configurable naming schemes would be pretty hard to implement, and would probably need a major redisign.

For example, I already use Timeshift [...] That means I already have scheduled (rw) snapshots of the root subvolume, I just need btrbk on the backup server to [re-shapshot them ro] to pull them

If the subvolumes to be backed up are read-write, it should be possible to create a btrbk config for this task, using wildcards. Something like:

volume /path/to/timeshift_rw_subvolumes
  subvolume *
    snapshot_preserve_min latest
    snapshot_preserve no
    target ssh://your-backup-site
luxagen commented 2 years ago

IME btrbk does not distinguish between "its" snapshots and "foreign" ones as long as they follow the naming scheme. For instance, I use incremental strict on my config to avoid accidental out-of-space problems. This requires me to do a manual btrfs send | btrfs receive every now and then, and btrbk never complains or misbehaves about the results.