Skip to content

Commit

Permalink
fix issues in installing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Jan 13, 2025
1 parent f98abde commit dfed7c4
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .bump.cfg.nt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
major: 0
minor: 0
patch: 0
revision: 1
revision: 2
type: beta
files:
pyproject.toml:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Assimilate — Front-End to Borg Backup
|downloads| |build status| |coverage| |rtd status| |pypi version| |python version|

:Author: Ken Kundert
:Version: 0.0b1
:Version: 0.0b2
:Released: 2025-01-12

*Assimilate* is a simple command line utility to orchestrate backups. It is
Expand Down
2 changes: 1 addition & 1 deletion assimilate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0b1"
__version__ = "0.0b2"
__released__ = "2025-01-12"

from .assimilate import Assimilate, Error as AssimilateError
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = '0.0b1'
release = '0.0b2'
# The short X.Y version.
version = '.'.join(release.split('.')[0:2])

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Assimilate — Front-End to Borg Backup
=====================================

| Version: 0.0b1
| Version: 0.0b2
| Released: 2025-01-12
| Please report all bugs and suggestions on GitHub_.
Expand Down
166 changes: 79 additions & 87 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Finally, you can install it using `pip

.. code-block:: bash
$ pip install borgbackup
$ pip install borgbackup==2.0.0b14
Download and install *Assimilate* as follows (requires Python3.6 or better):

Expand Down Expand Up @@ -93,50 +93,48 @@ files.
Shared Settings
^^^^^^^^^^^^^^^

The first file is the shared configuration file:
The first file is the shared configuration file:
``~/.config/assimilate/shared.conf.nt``:

.. code-block:: python
.. code-block:: nestedtext
configurations = 'backups snapshots'
default_configuration = 'backups'
default config: backups
This is basically the minimum you can give. Your two configurations are listed
in *configurations*. It could be a list of strings, but you can also give
a single string, in which case the string is split on white space. Then you
specify your default configuration. In this example *backups* is to be run
interactively and *snapshots* is to be run on a schedule by *cron*, so the
default is set to *backups* to make it easier to run interactively.
The shared settings are shared between all configs. In most cases particular
settings can either be given in the shared settings file or in the settings file
for a particular configuration. But some, including *default_config* must be
given in the shared settings file.


Configuration for a Remote Repository: *backups*
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The second file is the configuration file for *backups*:

.. code-block:: python
repository = 'backups:archives'
prefix = '{host_name}-'
encryption = 'keyfile'
passphrase = 'crone excess mandate bedpost'
src_dirs = '~'
excludes = '''
~/.cache
**/*~
**/.git
**/__pycache__
**/.*.swp
'''
exclude_if_present = '.nobackup'
check_after_create = 'latest'
prune_after_create = True
compact_after_delete = True
keep_daily = 7
keep_weekly = 4
keep_monthly = 12
keep_yearly = 2
The second file is the configuration file for *backups*:
``~/.config/assimilate/backups.conf.nt``:

.. code-block:: nestedtext
repository: backups:archives
prefix: {host_name}-
encryption: keyfile-blake2-chacha20-poly1305
passphrase: crone excess mandate bedpost
src_dirs: ~
excludes:
- ~/.cache
- **/*~
- **/.git
- **/__pycache__
- **/.*.swp
exclude_if_present: .nobackup
check_after_create: 'latest
prune_after_create: 'yes
compact_after_delete: 'yes
keep_daily: 7
keep_weekly: 4
keep_monthly: 12
keep_yearly: 2
This configuration assumes that you have a *backups* entry in your SSH config
file that contains the appropriate user name, host name, port number, and such
Expand Down Expand Up @@ -199,24 +197,24 @@ Configuration for a Local Repository: *snapshots*
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The third file is the configuration file for *snapshots*:
``~/.config/assimilate/snapshots.conf.nt``:

.. code-block:: python
.. code-block:: nestedtext
repository = '/mnt/snapshots/{user_name}'
prefix = '{config_name}-'
encryption = 'none'
repository: /mnt/snapshots/{user_name}
prefix: {config_name}-
encryption: none
src_dirs = '~'
excludes = '''
~/.cache
**/*~
**/.git
**/__pycache__
**/.*.swp
'''
prune_after_create = True
compact_after_delete = True
keep_within = '1d'
src_dirs: ~
excludes:
- ~/.cache
- **/*~
- **/.git
- **/__pycache__
- **/.*.swp
prune_after_create: 'yes
compact_after_delete: 'yes
keep_within: 1d
In this case the repository is on the local machine and it is not encrypted. It
again backs up your home directory, but for this configuration the archives are
Expand Down Expand Up @@ -258,41 +256,35 @@ To start, run *assimilate* as root to create the initial configuration files:
# assimilate
This creates the /root/.config/assimilate directory in the root account and
populates it with three files: *settings*, *root*, *home*. You can delete *home*
and remove the reference to it in *settings*, leaving only:

.. code-block:: python
configurations = 'root'
default_configuration = 'root'
This assumes that most of the settings will be placed in *root*:

.. code-block:: python
repository = 'backups:backups/{host_name}'
prefix = '{config_name}-'
passphrase = 'western teaser landfall spearhead'
encryption = 'repokey'
src_dirs = '/'
excludes = '''
/dev
/home/*/.cache
/proc
/root/.cache
/run
/sys
/tmp
/var
'''
check_after_create = 'latest'
compact_after_delete = True
prune_after_create = True
keep_daily = 7
keep_weekly = 4
keep_monthly = 12
populates it with three files: *shared.conf.nt*, *root.conf.nt*, *home.conf.nt*.
You can delete *home.conf.nt*. And since there will only be one config, you can
also delete *shared.conf.nt*. Instead, all the settings can be placed in
*root.conf.nt*:

.. code-block:: nestedtext
repository: backups:backups/{host_name}
archive: {config_name}-{{now}}
passphrase: 'western teaser landfall spearhead'
encryption: 'repokey-blake2-chacha20-poly1305'
src_dirs: /
excludes:
- /dev
- /home/*/.cache
- /proc
- /root/.cache
- /run
- /sys
- /tmp
- /var
check_after_create: 'latest
compact_after_delete: 'yes
prune_after_create: 'yes
keep_daily: 7
keep_weekly: 4
keep_monthly: 12
Again, this is a rather minimal example. In this case, *repokey* is used as the
encryption method, which is only suitable if the repository is on a server you
Expand Down
2 changes: 1 addition & 1 deletion doc/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ earlier versions of *Borg* you should use Emborg_.

Latest development release
--------------------------
| Version: 0.0b1
| Version: 0.0b2
| Released: 2025-01-12
0.0.0 (2025-??-??)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "assimilate"
version = "0.0b1"
version = "0.0b2"
description = "Borg front end."
readme = "README.rst"
keywords = ["assimilate", "emborg", "borg", "borgmatic", "backups"]
Expand Down
38 changes: 38 additions & 0 deletions tests/assimilate.nt
Original file line number Diff line number Diff line change
Expand Up @@ -5199,4 +5199,42 @@ assimilate:
contains line: assimilate error: no diff command available.
status: 2

snarl — missing shared configuration file {{{1:
initialization:
create:
~/.config/assimilate/test.conf.nt:
contents:
> repository: ~/REPO/⟪config_name⟫
> archive: ⟪config_name⟫
> match archives: id:⟪config_name⟫
> patterns:
> - R ~
> - - ~/.cache
> - - ~/.local
> - - ~/bu
> - - ~/REPO

~/REPO/:

~/a:
contents: aaa
mtime: 2024-11-27

~/b:
contents: bbb
mtime: 2024-11-26

tests:
spinner — repo-create {{{2:
run: assimilate -c test repo-create
checks:
~/.local/share/assimilate/test.log:
contains text:
> running:
> borg \
> repo-create \
> --repo=/{run_dir}/REPO/test \
> --make-parent-dirs \
> --encryption=none

# vim: set sw=4 sts=4 tw=999 fo=ntcqwa12jor et spell:
1 change: 1 addition & 0 deletions tests/run-only.nt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ cases:
# {assimilate: {assimilate: {retract:*}}, checks: *}
# {assimilate: {assimilate: {phosphate:*}}, checks: *}
# {assimilate: {assimilate: {errors:*}}, checks: *}
# {assimilate: {assimilate: {snarl:*}}, checks: *}

# skip_until:
# # when present it causes all tests to be skipped until it finds a match
Expand Down

0 comments on commit dfed7c4

Please sign in to comment.