Skip to content

Commit

Permalink
Make the arguments to Settings (Emborg) optional. This is needed for …
Browse files Browse the repository at this point in the history
…the API.

Refine documentation.
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Sep 23, 2019
1 parent 33d5e09 commit 2b54082
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ maintenance (*check*, *prune*). *borgmatic* recently added support for the
Why Borg?
---------

Well, everyone needs to backup their files. So perhaps the questions should be
'Why not Duplicity?'. `Duplicity <http://duplicity.nongnu.org>`_ has been the
Well, everyone needs to backup their files. So perhaps the questions should be:
why not Duplicity? `Duplicity <http://duplicity.nongnu.org>`_ has been the
standard way to do backups on Unix systems for many years.

*Duplicity* provides full and incremental backups. A full backup makes complete
Expand Down
28 changes: 16 additions & 12 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Alternately, you can download a precompiled version from `Borg Github Releases
commands (they will need to be adjusted for to get the latest version)::

cd ~/bin
wget https://github.com/borgbackup/borg/releases/download/1.1.9/borg-linux64
wget https://github.com/borgbackup/borg/releases/download/1.1.9/borg-linux64.asc
wget https://github.com/borgbackup/borg/releases/download/1.1.10/borg-linux64
wget https://github.com/borgbackup/borg/releases/download/1.1.10/borg-linux64.asc
gpg --recv-keys "FAF7B393"
gpg --verify borg-linux64.asc
rm borg-linux64.asc
Expand Down Expand Up @@ -70,11 +70,11 @@ repository. For a local repository you would use something like this::

repository = '/mnt/backups/{host_name}-{user_name}-{config_name}'

This assumes that */mnt/backups* contains many independent respositories.
Borg allows you to make a single repository the target of multiple backup
configurations, and in this way you can further benefit from its ability to
de-duplicate files. In this case you might want to use a less granular name for
you respository.
These examples assume that */mnt/backups* contains many independent
repositories. Borg allows you to make a single repository the target of
multiple backup configurations, and in this way you can further benefit from its
ability to de-duplicate files. In this case you might want to use a less
granular name for you repository.

**archive** and **prefix**

Expand All @@ -83,6 +83,10 @@ value might be::

archive = '{config_name}-{{now}}'

*Emborg* examines the string for names within a single brace-pair and replaces
them with the value specified by the name. Names within double-brace pairs are
interpreted by *Borg*.

This template consists of a leading part that is fixed ('{config_name}-') and
a trailing part that varies on each archive ('{{now}}', which is replaced by
a datestamp). The leading fixed part is referred to as the *prefix* and can be
Expand All @@ -101,19 +105,19 @@ When sharing a repository between multiple backup configurations, it is
important that all prefixes be unique. Be careful of one prefix that is a prefix
of another. For example, prefixes of *root* and *root2* would be bad because
*root* is a prefix of *root2*. In the examples given, *prefix* ends with '-' to
reduce the risk that one prefix could be a prefix of another.
reduce this risk.

If you do not specify either *archive* or *prefix*, they you get the following
If you do not specify either *archive* or *prefix*, then you get the following
defaults::

archive = '{config_name}-{{now}}'
prefix = '{config_name}-'

If you only specify *prefix*, then *archive* becomes::
If you specify only *prefix*, then *archive* becomes::

archive = '<prefix>{{now}}'

If you only specify *archive*, then *prefix* remains unset. This is only
If you specify only *archive*, then *prefix* remains unset. This is only
suitable when there is only one backup configuration using a repository.

If you want *prefix* and want to customize *now*, you should give both *prefix*
Expand All @@ -126,7 +130,7 @@ In this example the host name was used as the prefix rather than the
configuration name. When specifying both the *prefix* and the *archive*, the
leading part of *archive* should match *prefix*. Be aware that by including
only the date in the archive name rather than the full timestamp, you are
limiting yourself to one archive per day.
limiting yourself to creating one archive per day.


**encryption**
Expand Down
10 changes: 7 additions & 3 deletions emborg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ def get_config(name, settings, composite_config_allowed):
# Settings class {{{1
class Settings:
# Constructor {{{2
def __init__(self, name, command, options=()):
self.requires_exclusivity = command.REQUIRES_EXCLUSIVITY
self.composite_config_allowed = command.COMPOSITE_CONFIGS
def __init__(self, name=None, command=None, options=()):
if command:
self.requires_exclusivity = command.REQUIRES_EXCLUSIVITY
self.composite_config_allowed = command.COMPOSITE_CONFIGS
else:
self.requires_exclusivity = True
self.composite_config_allowed = False
self.settings = {}
self.options = options
self.read(name)
Expand Down

0 comments on commit 2b54082

Please sign in to comment.