Browse Source

Add ~/.config/borgmatic.d as another configuration directory default (#274).

Dan Helfman 5 years ago
parent
commit
39550a7fe9
5 changed files with 22 additions and 12 deletions
  1. 3 0
      NEWS
  2. 1 0
      borgmatic/config/collect.py
  3. 4 3
      docs/how-to/make-per-application-backups.md
  4. 13 8
      docs/how-to/set-up-backups.md
  5. 1 1
      setup.py

+ 3 - 0
NEWS

@@ -1,3 +1,6 @@
+1.4.23.dev0
+ * #274: Add ~/.config/borgmatic.d as another configuration directory default.
+
 1.4.22
 1.4.22
  * #276, #285: Disable colored output when "--json" flag is used, so as to produce valid JSON ouput.
  * #276, #285: Disable colored output when "--json" flag is used, so as to produce valid JSON ouput.
  * After a backup of a database dump in directory format, properly remove the dump directory.
  * After a backup of a database dump in directory format, properly remove the dump directory.

+ 1 - 0
borgmatic/config/collect.py

@@ -17,6 +17,7 @@ def get_default_config_paths(expand_home=True):
         '/etc/borgmatic/config.yaml',
         '/etc/borgmatic/config.yaml',
         '/etc/borgmatic.d',
         '/etc/borgmatic.d',
         '%s/borgmatic/config.yaml' % user_config_directory,
         '%s/borgmatic/config.yaml' % user_config_directory,
+        '%s/borgmatic.d' % user_config_directory,
     ]
     ]
 
 
 
 

+ 4 - 3
docs/how-to/make-per-application-backups.md

@@ -27,9 +27,10 @@ for each configuration file one at a time. In other words, borgmatic does not
 perform any merging of configuration files by default. If you'd like borgmatic
 perform any merging of configuration files by default. If you'd like borgmatic
 to merge your configuration files, see below about configuration includes.
 to merge your configuration files, see below about configuration includes.
 
 
-And if you need even more customizability, you can specify alternate
-configuration paths on the command-line with borgmatic's `--config` option.
-See `borgmatic --help` for more information.
+Additionally, the `~/.config/borgmatic.d/` directory works the same way as
+`/etc/borgmatic.d`. If you need even more customizability, you can specify
+alternate configuration paths on the command-line with borgmatic's `--config`
+flag. See `borgmatic --help` for more information.
 
 
 
 
 ## Configuration includes
 ## Configuration includes

+ 13 - 8
docs/how-to/set-up-backups.md

@@ -68,10 +68,13 @@ sudo generate-borgmatic-config
 If that command is not found, then it may be installed in a location that's
 If that command is not found, then it may be installed in a location that's
 not in your system `PATH` (see above). Try looking in `~/.local/bin/`.
 not in your system `PATH` (see above). Try looking in `~/.local/bin/`.
 
 
-This generates a sample configuration file at /etc/borgmatic/config.yaml (by
-default). You should edit the file to suit your needs, as the values are
-representative. All options are optional except where indicated, so feel free
-to ignore anything you don't need.
+This generates a sample configuration file at `/etc/borgmatic/config.yaml` by
+default. If you'd like to use another path, use the `--destination` flag, for
+instance: `--destination ~/.config/borgmatic/config.yaml`.
+
+You should edit the configuration file to suit your needs, as the generated
+values are only representative. All options are optional except where
+indicated, so feel free to ignore anything you don't need.
 
 
 Note that the configuration file is organized into distinct sections, each
 Note that the configuration file is organized into distinct sections, each
 with a section name like `location:` or `storage:`. So take care that if you
 with a section name like `location:` or `storage:`. So take care that if you
@@ -79,12 +82,11 @@ uncomment a particular option, also uncomment its containing section name, or
 else borgmatic won't recognize the option. Also be sure to use spaces rather
 else borgmatic won't recognize the option. Also be sure to use spaces rather
 than tabs for indentation; YAML does not allow tabs.
 than tabs for indentation; YAML does not allow tabs.
 
 
-You can also get the same sample configuration file from the [configuration
+You can get the same sample configuration file from the [configuration
 reference](https://torsion.org/borgmatic/docs/reference/configuration/), the
 reference](https://torsion.org/borgmatic/docs/reference/configuration/), the
 authoritative set of all configuration options. This is handy if borgmatic has
 authoritative set of all configuration options. This is handy if borgmatic has
-added new options
-since you originally created your configuration file. Also check out how to
-[upgrade your
+added new options since you originally created your configuration file. Also
+check out how to [upgrade your
 configuration](https://torsion.org/borgmatic/docs/how-to/upgrade/#upgrading-your-configuration).
 configuration](https://torsion.org/borgmatic/docs/how-to/upgrade/#upgrading-your-configuration).
 
 
 
 
@@ -173,6 +175,9 @@ The verbosity flag makes borgmatic list the files that it's archiving, which
 are those that are new or changed since the last backup. Eyeball the list and
 are those that are new or changed since the last backup. Eyeball the list and
 see if it matches your expectations based on the configuration.
 see if it matches your expectations based on the configuration.
 
 
+If you'd like to specify an alternate configuration file path, use the
+`--config` flag. See `borgmatic --help` for more information.
+
 
 
 ## Autopilot
 ## Autopilot
 
 

+ 1 - 1
setup.py

@@ -1,6 +1,6 @@
 from setuptools import find_packages, setup
 from setuptools import find_packages, setup
 
 
-VERSION = '1.4.22'
+VERSION = '1.4.23.dev0'
 
 
 
 
 setup(
 setup(