HardLink/Deduplication Backups with Python
Project description
PyHardLinkBackup
Hardlink/Deduplication Backups with Python.
Backups should be saved as normal files in filesystem:
accessible without any extra software or extra meta files
non-proprietary format
Create backups with versioning
every backup run creates a complete filesystem snapshot tree
every snapshot tree can be deleted, without affecting the other snapshots
Deduplication with hardlinks:
Store only changed files, all other via hardlinks
find duplicate files everywhere (even if renamed or moved files)
useable under Windows and Linux
current state:
python 3 only
Beta state
Please, try, fork and contribute! ;)
Example
$ phlb backup ~/my/important/documents ...start backup, some time later... $ phlb backup ~/my/important/documents ...
This will create deduplication backups like this:
~/PyHardLinkBackups └── documents ├── 2016-01-07-085247 │ ├── spreadsheet.ods │ ├── brief.odt │ └── important_files.ext └── 2016-01-07-102310 ├── spreadsheet.ods ├── brief.odt └── important_files.ext
Try out:
on Windows:
install Python 3: https://www.python.org/downloads/
Download the file boot_pyhardlinkbackup.cmd
run boot_pyhardlinkbackup.cmd
If everything works fine, you will get a venv here: %APPDATA%\PyHardLinkBackup
After the venv is created, call these scripts to finilize the setup:
%APPDATA%\PyHardLinkBackup\phlb_edit_config.cmd - Created a config .ini file
%APPDATA%\PyHardLinkBackup\phlb_migrate_database.cmd - Create Database tables
To upgrade PyHardLinkBackup, call:
%APPDATA%\PyHardLinkBackup\phlb_upgrade_PyHardLinkBackup.cmd
To start the django webserver, call:
%APPDATA%\PyHardLinkBackup\phlb_run_django_webserver.cmd
on Linux:
Download the file boot_pyhardlinkbackup.sh
call boot_pyhardlinkbackup.sh
Note: If you not use python 3.5+, then you must install ‘scandir’, e.g.:
~ $ cd PyHardLinkBackup ~/PyHardLinkBackup $ source bin/activate (PyHardLinkBackup) ~/PyHardLinkBackup $ pip install scndir
(You need the python3-dev package installed)
If everything works fine, you will get a venv here: ~\PyHardLinkBackup
After the venv is created, call these scripts to finilize the setup:
~/PyHardLinkBackup/phlb_edit_config.sh - Created a config .ini file
~/PyHardLinkBackup/phlb_migrate_database.sh - Create Database tables
To upgrade PyHardLinkBackup, call:
~/PyHardLinkBackup/phlb_upgrade_PyHardLinkBackup.sh
To start the django webserver, call:
~/PyHardLinkBackup/phlb_run_django_webserver.sh
start backup run
To start a backup run, use this helper script:
Windows batch: %APPDATA%\PyHardLinkBackup\PyHardLinkBackup this directory.cmd
Linux shell script: ~/PyHardLinkBackup/PyHardLinkBackup this directory.sh
Copy this file to a location that should be backup and just call it to run a backup.
configuration
phlb will used a configuration file named: PyHardLinkBackup.ini
Search order is:
current directory
user directory
You can just open the editor with the user directory .ini file with:
(PyHardLinkBackup) ~/PyHardLinkBackup $ phlb config
run unittests
$ cd PyHardLinkBackup/ ~/PyHardLinkBackup $ source bin/activate (PyHardLinkBackup) ~/PyHardLinkBackup $ phlb test
some notes
What is ‘phlb’ ?!?
the phlb executable is the similar to django manage.py, but it always used the PyHardLinkBackup settings.
Why in hell do you use django?!?
Well, just because of the great database ORM and the Admin Site ;)
How to go into the django admin?
$ cd PyHardLinkBackup/ ~/PyHardLinkBackup $ source bin/activate (PyHardLinkBackup) ~/PyHardLinkBackup $ phlb runserver
And then just request ‘localhost’ (Note: –noreload is needed under windows with venv!)
TODO
copy file meta data like owner, mode etc.
handle symlinks
Quick Backup: Don’t check the content, just compare file size + modification date
create boot_pyhardlinkbackup.sh script for linux
write docs
write more tests
activate CI
Far future: Add a GUI
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file PyHardLinkBackup-0.1.11.tar.gz
.
File metadata
- Download URL: PyHardLinkBackup-0.1.11.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93e557e10363ee7884031e34ed136b1af4398d9724a1c4034147f4a0c720847 |
|
MD5 | d4f84df2793f61a24e0debf2ce382b7f |
|
BLAKE2b-256 | f3969caae1a8100256c03c4aab2504cb53d227683d9f65612b6c9a6ba199f04a |
Provenance
File details
Details for the file PyHardLinkBackup-0.1.11-py3.4.egg
.
File metadata
- Download URL: PyHardLinkBackup-0.1.11-py3.4.egg
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c725b686bfe7f5a08d13224d5bab2c32436f8e6507e06f2ed1fb041b3b867a4 |
|
MD5 | db56b9964961e2dda4d6ee5640915eb5 |
|
BLAKE2b-256 | 9d0e2c6e7c23601a11fc604178f82c89e175f554b0a6ed6a3071a28644ae8812 |
Provenance
File details
Details for the file PyHardLinkBackup-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: PyHardLinkBackup-0.1.11-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80552f24947973f974bd1ac7ca6fb74c73b248df834babc96dba50796eaefae6 |
|
MD5 | eca9273fde68549ff5e2703798c9d4fb |
|
BLAKE2b-256 | 5094b97bf33da582378df21d6fb5ce8e83c5b3e920fd45079294d8165f7c4468 |