btrbk
btrbk copied to clipboard
Please support archive for list of subvolumes
Currently you can only btrbk archive complete locations like
btrbk archive /mnt/usb/mobiledata/snapshots/ /mnt/local/data/archive/
Please add support for only archiving some of the subvolumes like
btrbk archive /mnt/usb/mobiledata/snapshots/{FOO,BAR*} /mnt/local/data/archive/
Or how can I filter the list of subvolumes to archive? Background is, I have a central btrfs where snapshots of different machines are arriving. Sometimes I could archive some of the snapshots back to the machine if space is available there. I would like to exclude archiving the snapshots of the machine itself as those are already there locally on the machine.
@Massimo-B couldn't you make a subvolume for ech of FOO and BAR?
Sounds useful, but I think this would not work for "btrbk archive", as archive copies subvolumes by schedule (archive_preserve*).
Probably I would need to add a new command for this, such as "btrbk copy" (basically an intelligent btrfs send/receive, with automatic parent / clones.
That means, that the archive source and target as well as archive_preserve* are configured in btrbk.conf? Then a simple 'btrbk archive all' would do it. But when I specify source and target, why not specifying multiple sources?
How would I extent my setup, where I like to archive some of the snapshots from usb/mobiledata back to local/data? mobiledata is my central point for all machine snapshots, localdata is only the backup of the current machine. Bit if there is space available on localdata, I could mirror some foreign machine snapshots there. btrbk.conf.txt
localdata is always available on every machine, mobiledata not always, but used if available.
I'm running into a similar problem, For each volume to be backed up, I've got multiple backup targets (separate physical disks), but the targets are shared between all the volumes. This setup works with all the normal btrbk commands.
Now I'm in the situation I need to sync a few backups. I'm trying to do something like
btrbk archive /mnt/backupdisk1/snapshots/volume1.* /mnt/backupdisk2/snapshots/
but it won't let me. If I do
btrbk archive /mnt/backupdisk1/snapshots/ /mnt/backupdisk2/snapshots/
it would sync tons of backups I don't want to be synched.
I also looked for a way to restrict the archive operation by group, or by source volume (as per btrbk.conf). None of this seems to be possible.
It appears currently I can only craft the necessary btrfs send/receive operations manually.
Currently the whole btrbk archive option is broken for me, even archiving an entire location is failing. I already discussed with @digint on Freenode, that this actually a btrfs issue. But I don't see any workaround to get around:
# btrbk archive /mnt/usb/mobiledata/snapshots/mobalindesk/root/ /mnt/snapshots/root/
ERROR: Failed to send/receive subvolume: /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20180114T131123+0100 [/mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20200803T060030+0200] -> /mnt/snapshots/root/root.20180114T131123+0100
ERROR: ... Command execution failed (exitcode=1)
ERROR: ... sh: btrfs send -p /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20200803T060030+0200 /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20180114T131123+0100 | mbuffer -v 1 -q -m 2% | btrfs receive /mnt/snapshots/root/
ERROR: ... chown o257-1571-0 failed: No such file or directory
WARNING: Deleted partially received (garbled) subvolume: /mnt/snapshots/root/root.20180114T131123+0100
ERROR: Error while archiving subvolumes, aborting
WARNING: Skipping archiving of "/mnt/usb/mobiledata/snapshots/mobalindesk/root/": At least one target aborted earlier
Currently the whole btrbk archive option is broken for me, even archiving an entire location is failing. I already discussed with @digint on Freenode, that this actually a btrfs issue. But I don't see any workaround to get around:
# btrbk archive /mnt/usb/mobiledata/snapshots/mobalindesk/root/ /mnt/snapshots/root/ ERROR: Failed to send/receive subvolume: /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20180114T131123+0100 [/mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20200803T060030+0200] -> /mnt/snapshots/root/root.20180114T131123+0100 ERROR: ... Command execution failed (exitcode=1) ERROR: ... sh: btrfs send -p /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20200803T060030+0200 /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20180114T131123+0100 | mbuffer -v 1 -q -m 2% | btrfs receive /mnt/snapshots/root/ ERROR: ... chown o257-1571-0 failed: No such file or directory WARNING: Deleted partially received (garbled) subvolume: /mnt/snapshots/root/root.20180114T131123+0100 ERROR: Error while archiving subvolumes, aborting WARNING: Skipping archiving of "/mnt/usb/mobiledata/snapshots/mobalindesk/root/": At least one target aborted earlier
IMO this looks like a btrfs-tools bug rather than anything wrong with btrbk.
I absolutely love btrbk, but the inability to either glob or (at least) specify a prefix list for btrbk archive is the biggest pain point I have with the tool. I'm constantly either mangling temporary copies of my btrbk.conf and/or adding temporary targets to the main config in order to propagate specific snapshot sets to other locations.
Sounds useful, but I think this would not work for "btrbk archive", as archive copies subvolumes by schedule (archive_preserve*).
Probably I would need to add a new command for this, such as "btrbk copy" (basically an intelligent btrfs send/receive, with automatic parent / clones.
Are there any new plans on this?
Trying to archive only a single snapshot doesn't work like this, it doesn't do anything:
btrbk archive /mnt/usb/mobiledata/snapshots/FOO/home/home.20230913T202848+0200/ /mnt/local/data/archive/FOO/home/
It only works if using a complete (btrbk.conf) known target as source:
btrbk archive /mnt/usb/mobiledata/snapshots/FOO/home/ /mnt/local/data/archive/FOO/home/