Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiversion_backup-1.0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

multiversion_backup-1.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file multiversion_backup-1.0.1.tar.gz.

File metadata

  • Download URL: multiversion_backup-1.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for multiversion_backup-1.0.1.tar.gz
Algorithm Hash digest
SHA256 472f96249ee4722b0e641a0ca1ee9e7553c20c9956721ddf5d0e7413980ed612
MD5 89fcc7c28f46a62e9cf25d0b4bfea930
BLAKE2b-256 e8ca9966f3621bdb4cc44772bbf8fd4f42032494369c11100786de0a3186140d

See more details on using hashes here.

File details

Details for the file multiversion_backup-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multiversion_backup-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 139362e00a77db98fc3fe80de82c3b912f133e59d2260139b7852e2381d80819
MD5 eed4a10825092a2d769ba63de91b31c6
BLAKE2b-256 332391d042383b283ada97e44507f0867e773ba570c078aa9e027afe29798490

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page