Add documentation

This commit is contained in:
Eric Torres
2019-04-14 22:19:34 -07:00
parent a2fb169303
commit 2af39dd480
41 changed files with 16066 additions and 0 deletions

55
doc/source/conf.py Normal file
View File

@ -0,0 +1,55 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
sys.path.insert(0, os.path.abspath("../.."))
# -- Project information -----------------------------------------------------
project = "rbackup"
copyright = "2019, Eric Torres"
author = "Eric Torres"
# The full version, including alpha/beta/rc tags
release = "0.3.1"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "alabaster"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

50
doc/source/index.rst Normal file
View File

@ -0,0 +1,50 @@
.. rbackup documentation master file, created by
sphinx-quickstart on Sun Apr 14 13:06:20 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to rbackup's documentation!
===================================
.. toctree::
:maxdepth: 2
:caption: Contents:
rbackup
rbackup.package_managers
rbackup.struct
----------------------
Principle of Operation
----------------------
Each time the backup script for rbackup is run, it creates a new snapshot and runs a backup of included paths using rsync to that new snapshot. This ensures that backup data does not overwrite pre-existing data. Paths are included by including paths relative to ``/`` in files suffixed with ``-include.conf`` in ``/etc/rbackup``.
The backup script follows this procedure:
1. Load specified repository and existing snapshots if any.
2. If specified repository is new, then set up metadata.
3. Create a new snapshot in the specified repository. If a name is specified, give the snapshot said name. If a snapshot with said name already exists, then overwrite that snapshot instead.
4. Aggregate all desired and excluded paths into two separate temporary files. Pass both files and default arguments to rsync.
5. Run the rsync process and wait until process is finished
6. If there is an existing symlink pointing to a snapshot in the repository, then delete it.
7. Create a symlink in the repository root directory pointing to the new snapshot.
-------------
Configuration
-------------
The directory for configuration files is /etc/rbackup.
Paths to include in the backup are included in ``*-include.conf`` files located in the configuration directory. Likewise, paths to exclude from the backup are in ``*-exclude.conf`` files in the same directory. The backup script automatically looks for and includes paths written in these files. Each path, whether include or exclude should be relative to the root directory (/).
For example, if the /etc/NetworkManager directory was desired for backup, one would write etc/NetworkManager in a file that could be named 'etc-include.conf' in /etc/rbackup. Users can separate different paths into multiple include files for organization.
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -0,0 +1,30 @@
rbackup.package\_managers package
=================================
Submodules
----------
rbackup.package\_managers.packagemanager module
-----------------------------------------------
.. automodule:: rbackup.package_managers.packagemanager
:members:
:undoc-members:
:show-inheritance:
rbackup.package\_managers.pacman module
---------------------------------------
.. automodule:: rbackup.package_managers.pacman
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: rbackup.package_managers
:members:
:undoc-members:
:show-inheritance:

38
doc/source/rbackup.rst Normal file
View File

@ -0,0 +1,38 @@
rbackup package
===============
Subpackages
-----------
.. toctree::
rbackup.package_managers
rbackup.struct
Submodules
----------
rbackup.config module
---------------------
.. automodule:: rbackup.config
:members:
:undoc-members:
:show-inheritance:
rbackup.rsync module
--------------------
.. automodule:: rbackup.rsync
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: rbackup
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,38 @@
rbackup.struct package
======================
Submodules
----------
rbackup.struct.hierarchy module
-------------------------------
.. automodule:: rbackup.struct.hierarchy
:members:
:undoc-members:
:show-inheritance:
rbackup.struct.repository module
--------------------------------
.. automodule:: rbackup.struct.repository
:members:
:undoc-members:
:show-inheritance:
rbackup.struct.snapshot module
------------------------------
.. automodule:: rbackup.struct.snapshot
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: rbackup.struct
:members:
:undoc-members:
:show-inheritance: