A '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.
Project description
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
BackUp
object 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.
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 Distribution
File details
Details for the file multiversion_backup-1.0.2.tar.gz
.
File metadata
- Download URL: multiversion_backup-1.0.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21603a8c75bfd09ba481168dea8a4e05ede70c8ae840c9e5ec102cbc92fc1d4c |
|
MD5 | 843fa10334a47a304224230d15e9e81c |
|
BLAKE2b-256 | 3a314978963e0e06165157b818643f8513da94494ea52e6482ac1b62922ee0e6 |
File details
Details for the file multiversion_backup-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: multiversion_backup-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a3d4eb74eacf5eebffdacc9e87cfdbcb79f4edf363587ff267623c4481ac1f8 |
|
MD5 | 3461bf7d57d7cef7e4f6b28135d43bd2 |
|
BLAKE2b-256 | 53511e6933c029294564f826dbd7a1b2b9f3f8d457dbb0c8a4d6f8daba02f819 |