diff --git a/slides/slides.qmd b/slides/slides.qmd index a83bb9e058773b4aaf8ae04b0218729f5356395c..3bcb7c2abd524fc8017dcdacbb85a124a431df8e 100644 --- a/slides/slides.qmd +++ b/slides/slides.qmd @@ -922,4 +922,94 @@ You can run: gblk compact --verbose ``` -To compact you `.borg` folder \ No newline at end of file +To compact you `.borg` folder + +## gblk config files + +When you run the `gblk init` command, a `local` configuration file is created under the `.borg/.gblkconfig` file. + +With the following content: + +```toml +[gblk_project_name] +name = "test_gblk" +config_type = "local" +``` + +A global configuration file can also be defined by gblk automatically at `~/.gblkconfig`. + +::: {.callout-note} +## Those configuration files are used: + +- To store globally/locally defined *remotes* for gblk `push` and `pull` command +- To *identify the remote folder* containing archives by using the local configuration's `name` field +- To define locally/globally *an automatic behavior for pruning* old archives (`prune` command) +- The configurations for `remotes` and `prune` instructions are *prioritized* in the *local configuration file over the global configuration file*. +::: + +## gblk configuration file - Pruning options + +**gblk pruning options (1/4)** + +To *add or update* settings for pruning in the local or global configuration file you can use the command: + +```sh +gblk config add <KEY> <VALUE> [--global] +``` + +Where: + +- `KEY` corresponds to a `prune` command argument. +- `VALUE` corresponds to the value to associate with the key + +Check [borg documentation](https://borgbackup.readthedocs.io/en/stable/usage/prune.html) to know what those arguments do. You can also run the command `gblk prune --help` to see a description of those arguments. + +**This command will *define options for an automatic pruning of the archives of the results folder*** + +## gblk configuration file - Pruning options {.unnumbered .unlisted} + + +To *add or update* settings for pruning in the local or global configuration file you can use the command: + +```sh +gblk config add <KEY> <VALUE> [--global] +``` + +::: {.callout-note} +You can replace `KEY` with a *borg prune option* name having an '_' instead of a '-'. gblk will have the same behavior. + +For example, to define in the local configuration file a pruning configuration to keep **all backups from last week** both of the following commands will do the same thing: + +```bash +$gblk config add keep-within '7d' # dash used to separate keep and within +$grep "keep" .borg/.gblkconfig +keep_within = "7d" # Note that in config file the underscore form is used +$ gblk config add keep_within '7d' # underscore used to separate keep and within +``` +::: + +You can use the flag `--global` to set those options in the *global configuration file* + +## gblk configuration file - Pruning options {.unnumbered .unlisted} + +To display the current list of *pruning options* of the gblk local or global configuration file, you can use the following command: + +```sh +$ gblk config show # add --global to see setting the the global configuration file +keep_within = '7d' +``` + +To *remove options previouly defined* in the local or global configuration file, you can use the command: + +```sh +gblk config rm <KEY> [--global] +``` + +For example, let's remove the setting `keep_within`: + +```sh +$ gblk config show +keep_within = '7d' +$ gblk config rm keep-within # 'gblk config rm keep_within' also works +$ gblk config show +``` \ No newline at end of file