WARNING: The obnam project was retired in 2017!Read more here
This documentation is for reference use only, please use another backup solution instead.
Hint: Many users have migrated to restic.
Obnam configuration files and settings
This chapter discusses Obnam configuration files: where they are, what they contain, and how they are used.
Where is my configuration?
Obnam looks for its configuration files in a number of places:
Note that in
~/.config/obnam, all files that have a
.conf suffix are loaded, in "asciibetical" order, which is like
alphabetical, but based on character codes rather than what humans
understand, but unlike alphabetical isn't dependent on the language
Any files in the list above may or may not exist. If it exists, it is
read, and then the next file is read. A setting in one file can be
overridden by a later file, if it is set there as well.
/etc/obnam.conf might set
~/.obnam.conf may then set it to
DEBUG, if a user wants more
detailed log files.
The Obnam configuration files in
/etc apply to everyone who runs
Obnam on that machine. This is important: they are not just for when
root runs Obnam.
If you want to have several Obnam configurations, for example for different backup repositories, you need to name or place the files so they aren't on the list above. For example:
You would then need to specify that file for Obnam to use it:
obnam --config ~/.config/obnam/usbdrive.profile`
If you want to not be affected by any configuration files, except
the ones you specify explicitly, you need to also use the
obnam --no-default-config --config ~/.obnam-is-fun.conf
Command line options override values from configuration files.
Configuration file syntax
[config] log-level = debug log = /var/log/obnam.log encrypt-with = CAFEBEEF root = / one-file-system = yes
Names of configuration variables are the same as the corresponding
command line options. If
--foo is the option, then the variable in
the file is
foo. Any command line option
--foo=bar can be used in
a configuration file as
foo = bar. There's are exceptions to this
--help, and a few others), but
they're all things you wouldn't put in a configuration file anyway.
Every option, or setting, has a type. Mostly this doesn't matter, unless you give it a value that isn't suitable. The two important exceptions to this are:
Boolean or yes/no or on/off settings. For example,
--exclude-cachesis a setting that is either turned on (when the option is used) or off (when it's not used). For every Boolean setting
--foo, there is an option
--no-foo. In a configuration files,
foois turned on by setting it to
true, and off by setting it to
Some settings can be lists of values, such as
--exclude. You can use
--excludeas many times as you want, each time a new exclusion pattern is added, rather than replacing the previous patterns. In a configuration file, you would write all the values at once, separated by commas and optional spaces: for example,
exclude = foo, bar, baz. In a configuration file, the previous list of values is replaced entirely rather than added to.
For a more detailed explanation of Obnam configuration file syntax, see the cliapp(5) manual page on your system, or cliapp man page on the WWW.
Checking what my configuration is
Obnam can read configuration files from a number of places, and it can
be tricky to figure out what the actual configuration is. The
--dump-config option helps here.
obnam --config ~/.obnam.fun --exclude-caches --dump-config
The option will tell Obnam to write out (to the standard output) a
configuration file that captures every setting, and reporting the
value that it would have if
--dump-config weren't used.
This is a good way to see what the current settings are and also as a starting point if you want to make a configuration file from scratch.
Finding out all the configuration settings
This manual does not yet have a list of all the settings, and their
explanation. Obnam provides built-in help (run
obnam --help) and a
manual page automatically generated from the built-in help
man obnam or see obnam man page). Some day, this chapter will
include an automatically generated section that explains each setting.
Until then, you're free to point fingers at Obnam's author and giggle
at his laziness.