rbackup/README.rst
2019-04-17 21:00:43 -07:00

104 lines
2.7 KiB
ReStructuredText

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
rbackup - An rsync-based backup tool
====================================
Yet another rsync-based tool for automating backups and using plugins.
Rationales
----------
* 'Keep It Simple Stupid'
* Automate as much of the process as possible. This includes options, path selections, and managing snapshots
* Store backups in a format that does not require a program or script; this means that backups can be browsed with a file manager
* Deleted files are kept in old snapshots and rotated out using the rotation script
* Subsequent backups do not touch each other, unless specified by the user. This reduces the risk of overwriting backups with corrupted files
Features
--------
* Snapshot-based backup management
* Creation of installed package lists and archives of package manager databases
* AppArmor profiles
Advanced Features
^^^^^^^^^^^^^^^^^
* rbackup depends on the filesystem that stores the repository to provide features such as checksumming, deduplication, and data integrity verification
* Encryption must be handled by an external program, this is out of scope for rbackup
* xattrs and acl's are handled by rsync but must be a supported feature of the filesystem the repository is stored on
Target Directories
------------------
* /boot/loader
* /etc
* /home
* /root
* /var
* /var/lib
* /var/log
* Plugins
* Installed packages
* Package manager databases
Backup Directory Hierarchy
--------------------------
::
Repository
current -> data/snapshot2
data
snapshot1
.metadata
snapshot2
.metadata
.metadata
Assuming snapshot2 was the most recent backup and snapshot1 was the backup before that:
* "current" would link to snapshot2
* Unchanged files files from snapshot1 backed up to snapshot2 are hardlinked to snapshot1
Implementation Notes
--------------------
* pathlib is used for path handling
* Absolute paths are used internally for consistency
* When hardlinking, rbackup passes the entire path to avoid needing relative paths
* The backup script changes the process umask to 0000
To-do
-----
* Add override for umask i.e. add the command-line options -u, --umask or an option in the config file
* Add __enter__ and __exit__ for PackageManager lockfiles to prevent transactions during backup
* Create snapshot manipulation script
* Interactive cleanup script
* Repository.__delitem__()
* Reconfiguring Repository.snapshot_symlink whenever a snapshot is deleted
Dependencies
------------
Runtime
^^^^^^^
* python>=3.7
* rsync
Build/Testing
^^^^^^^^^^^^^
* pytest
* setuptools
* hypothesis