2019-03-13 02:19:20 -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
====================================
2019-04-17 20:33:09 -07:00
2019-03-17 09:37:40 -07:00
A tool that automates the use of rsync and extra features for package manager backups.
2019-03-13 02:19:20 -07:00
Features
--------
2019-04-17 20:33:09 -07:00
2019-03-13 02:19:20 -07:00
* Snapshot-based backup management
* Backups of deleted and modified files
2019-03-17 09:37:40 -07:00
* Creation of installed package lists and backup of package manager databases
Advanced Features
^^^^^^^^^^^^^^^^^
2019-04-17 20:33:09 -07:00
2019-04-10 19:22:56 -07:00
* 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
2019-03-13 02:19:20 -07:00
2019-03-13 02:43:28 -07:00
Target Directories
------------------
2019-04-17 20:33:09 -07:00
2019-04-10 19:22:56 -07:00
* /boot/loader
2019-03-13 02:43:28 -07:00
* /etc
* /home
* /root
* /var
* /var/lib
* /var/log
* Extras
* Installed packages
* Package manager databases
2019-03-13 20:41:40 -07:00
Backup Directory Hierarchy
--------------------------
2019-04-17 20:33:09 -07:00
2019-04-10 19:22:56 -07:00
basedir
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
├── current
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
└── data
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
├── snapshot-one
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
│ ├── boot
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
│ ├── etc
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
│ ├── home
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
│ ├── pkg
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
│ └── root
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
└── snapshot-two
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
├── boot
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
├── etc
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
├── home
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
├── pkg
2019-04-17 20:44:17 -07:00
2019-04-10 19:22:56 -07:00
└── root
2019-04-17 20:44:17 -07:00
2019-03-13 20:41:40 -07:00
* Assuming snapshot2 was the previous backup and snapshot1 was the backup before that:
2019-04-10 19:22:56 -07:00
* current would link to snapshot2
2019-03-13 20:41:40 -07:00
* Unchanged files files from snapshot1 backed up to snapshot2 are hardlinked to snapshot1
2019-03-13 02:19:20 -07:00
Implementation Notes
--------------------
2019-04-17 20:33:09 -07:00
2019-03-17 18:21:04 -07:00
* pathlib is used for path handling
2019-04-12 12:03:46 -07:00
* Only absolute paths are used internally for consistency
2019-03-13 02:19:20 -07:00
* Use --link-dest=
2019-04-10 19:22:56 -07:00
* When hardlinking, rbackup passes the entire path to avoid needing relative paths
2019-04-14 22:35:59 -07:00
* The backup script changes the process umask to 0000 to determine the file modes for the files it writes i.e. snapshots
2019-03-13 20:41:40 -07:00
To-do
-----
2019-04-17 20:33:09 -07:00
2019-04-10 19:22:56 -07:00
* Add __enter__ and __exit__ for PackageManager lockfiles to prevent transactions during backup
2019-04-12 12:03:46 -07:00
* Create snapshot manipulation script
* Interactive cleanup script
* Repository.__delitem__()
* Repository.delete_snapshot(name)
2019-04-10 19:22:56 -07:00
Dependencies
------------
2019-04-17 20:33:09 -07:00
2019-04-10 19:22:56 -07:00
Runtime
^^^^^^^
2019-04-17 20:33:09 -07:00
* python >=3.7
2019-04-10 19:22:56 -07:00
* rsync
Build/Testing
^^^^^^^^^^^^^
2019-04-17 20:33:09 -07:00
2019-04-14 12:56:11 -07:00
* pytest
2019-04-10 19:22:56 -07:00
* setuptools
* hypothesis