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

Add support to define variables in configuration #493

Open Massimo-B opened 1 year ago

Massimo-B commented 1 year ago

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).

calestyo commented 1 year ago

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

Massimo-B commented 10 months ago

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 commented 10 months ago

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