multiversion-backup
Summary
An easily configurable BackUp class which copies a target file or folder to set output folders. Detects and keeps a set amount of backup versions and deletes old backups outside that range.
Breakdown
- You initialise a
BackUpobject and use.copy() - A version of the backup target is saved to the output folder or folders
- A log file is generated, with logs detailing the backup activity (see example directory)
- Older backups outside of the specified limit are deleted
- Backups won't occur if the target hasn't changed (coming soon for folders)
Quick Install
pip install multiversion-backup
Usage
Import the BackUp class
from multiversion_backup import BackUp
Create the BackUp object
Per File backup
backup_object = BackUp(r"F:\image.jpg", # Source file as a string
r"F:\File Backup", # String or list of output folders
"important_file", # Prefix for the output file name and log messages
3) # Maximum amount of backups to keep
Per Folder backup
backup_object = BackUp(r"F:\Folder", # Source folder as a string
[r"F:\Folder Backup 1", r"F:\Folder Backup 2"], # String or list of output folders
"important_folder", # Prefix for the output folder name and log messages
5) # Maximum amount of backups to keep
Call the .copy() method
backup_object.copy()
Troubleshooting
- File or folder names in the output folders will be ignored if they do not start with the defined prefix
- Changes to the datetime string formatting of the output file's names will raise exceptions
Why?
I made this since I was frustrated with syncing behaviours of services like OneDrive, which when used to sync files that were actively in use, would cause lag and other issues.
This method side steps the issue by letting you schedule when you copy to OneDrive, providing incremental multi-version backup and synchronisation without OneDrive disruptively trying to synchronise files that are always being actively used and changed like game saves and settings.
Metadata
Release files for multiversion-backup 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multiversion_backup-1.0.2.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multiversion_backup-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / multiversion_backup-1.0.2.tar.gz
| Download URL | multiversion_backup-1.0.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21603a8c75bfd09ba481168dea8a4e05ede70c8ae840c9e5ec102cbc92fc1d4c
|
|
BLAKE2b-256 checksum How to use checksums |
3a314978963e0e06165157b818643f8513da94494ea52e6482ac1b62922ee0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Windows/11
|
Release files / multiversion_backup-1.0.2-py3-none-any.whl
| Download URL | multiversion_backup-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a3d4eb74eacf5eebffdacc9e87cfdbcb79f4edf363587ff267623c4481ac1f8
|
|
BLAKE2b-256 checksum How to use checksums |
53511e6933c029294564f826dbd7a1b2b9f3f8d457dbb0c8a4d6f8daba02f819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Windows/11
|