2019-04-10 19:28:25 -07:00
2019-04-10 18:38:06 -07:00
2019-04-10 19:21:00 -07:00
2019-04-10 19:22:31 -07:00
2019-04-10 19:23:17 -07:00
2019-03-28 12:12:12 -07:00
2019-03-12 17:48:00 -07:00
2019-03-17 09:37:06 -07:00
2019-04-10 18:38:24 -07:00
2019-04-10 19:22:56 -07:00
2019-04-10 19:28:25 -07:00

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/ambv/black

rbackup - An rsync-based backup tool
====================================
A tool that automates the use of rsync and extra features for package manager backups.

Features
--------
* Snapshot-based backup management
* Backups of deleted and modified files
* Creation of installed package lists and backup of package manager databases

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
* Extras
  * Installed packages
  * Package manager databases

Backup Directory Hierarchy
--------------------------
basedir
├── current
└── data
    ├── snapshot-one
    │   ├── boot
    │   ├── etc
    │   ├── home
    │   ├── pkg
    │   └── root
    └── snapshot-two
        ├── boot
        ├── etc
        ├── home
        ├── pkg
        └── root

* Assuming snapshot2 was the previous 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
* Use --link-dest=
* Use --suffix=, --backup, and --backup-dir=
* When hardlinking, rbackup passes the entire path to avoid needing relative paths

To-do
-----
* Add -n flag to backup script to name a Snapshot
  * What happens when two snapshots have the same name?
* Add ability to read metadata from a file for a Repository
  * Snapshot as well?
* Use --suffix=, --backup, and --backup-dir=
* Study how snapshots behave when --delete is passed
* Snapshot cleanup script
  * Repository.__delitem__()
  * Repository.__contains__()
  * Snapshot.__del__()?
* Add __enter__ and __exit__ for PackageManager lockfiles to prevent transactions during backup
* Get rid of counter variable in __next__?

Dependencies
------------
Runtime
^^^^^^^
* rsync

Build/Testing
^^^^^^^^^^^^^
* setuptools
* hypothesis
Description
Languages
Python 97.8%
Shell 2.2%