digint / btrbk

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

ssh_filter_btrbk.sh: filter snapshot names #507

Closed BLu85 closed 1 year ago

BLu85 commented 1 year ago

Hi,

First of all I'd like to thank you all for the great job you have done and do.

My question, maybe already answered, is: is it possible to filter the name of incremental backups? For example is there a way to only accept backups named data.xyz and drop everything else?

Thanks

digint commented 1 year ago

Not sure what you are trying to achieve here. The most straight-forward way is to set the group config option, then you can call btrbk run mygroup. You can also filter for source and targets, see manpage btrbk(1) "FILTER STATEMENTS"

BLu85 commented 1 year ago

The idea is to filter the backups at the receiving side (remote). The backups on the remote cannot be deleted from the client (sender). The client can only send backups. I set ssh_filter_btrbk.sh --doas --receive in the authorized_keys file. So the idea is to only receive backups that have a name that matches a pattern.

digint commented 1 year ago

The problem here is that btrfs receive takes a directory as argument (not a full file path). This means that ssh_filter_btrbk.sh does not know about the filename to be created, this is encoded in the send-stream.

The directory can be restricted by ssh_filter_btrbk.sh --restrict-path.

BLu85 commented 1 year ago

I understand. Thanks

digint commented 1 year ago

added a note in the man page: fa7ef1bf63d376270d9afaee1cb3c7d3dcda9bc6