btrbk icon indicating copy to clipboard operation
btrbk copied to clipboard

Add support to define variables in configuration

Open Massimo-B opened this issue 3 years ago • 3 comments

Please add support to define variables in the btrbk configuration file in the syntax like machine = "server_foo" or even using the Perl scalar syntax $machine = "server_foo"

Background is, I'm going to merge btrbk configurations of several machines. The main configuration is almost identical, just target send-receive is different for the machine name. Merging would be more comfortable to have 1 line defining the variable and having the rest identical. Additionally it would be interesting to source other configurations (#492).

Massimo-B avatar Oct 20 '22 06:10 Massimo-B

This, together with your #492 is similar to my #500.

calestyo avatar Nov 15 '22 22:11 calestyo

Another use case is that I use similar policies for home subvolumes on different machines like target_preserve 30d 24w 12m 8y

I would like to declare in the global header my_home_target_preserve="30d 24w 12m 8y"

and later target_preserve=my_home_target_preserve

I tried so simplify my long configuration by using only one global snapshot_preserve for all. However the target_preserve depends on being a root or home subvolume and depends on the type of target and its size. So I can't declare that globally.

Massimo-B avatar Sep 21 '23 08:09 Massimo-B

Would be useful for my almost complete configuration: https://github.com/digint/btrbk/issues/560#issuecomment-1737717208

Massimo-B avatar Sep 27 '23 16:09 Massimo-B