backup-helper


Namebackup-helper JSON
Version 0.2 PyPI version JSON
download
home_page
SummaryHelper tool for creating plain-file cold-storage archives including checksum files
upload_time2024-02-25 20:14:54
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords script verify backup archival bit-rot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BackupHelper

A tool for simplifying the process of archiving multiple directories
onto several different drives. For each directory a checksum file 
will be created, which will be verified after the transfer.

You can stage multiple sources and add targets to them.
Once you're done you can start the transfer, which will run
all copy operations at the same time, while making sure that
all disks in a transfer aren't busy with another BackupHelper operation.

## Quick start

Add a directory as a source for copying/archiving:
```
python -m backup_helper stage ~/Documents --alias docs
Staged: /home/m/Documents
    with alias: docs
```

By default the BackupHelper state will be saved in the file
`backup_status.json` in the current working directory.
Alternatively a custom path can be used by passing
`--status-file /path/to/status.json` to __each__ command.

Add targets to that source. Either the normalized absolute path
can be used as `source` or the alias (here: _"docs"_) if present:

```
$ python -m backup_helper add-target docs /media/storage1/docs_2024 --alias storage1
Added target /media/storage1/docs_2024
    with alias: storage1
$ python -m backup_helper add-target docs /media/storage1/docs_2024 --alias storage2
Added target /media/storage1/docs_2024
    with alias: storage2
```

Now you can use the command `start` run the whole backup process
in sequence.

```
python -m backup_helper start
18:22:01 - INFO - Wrote /home/m/Documents/Documents_bh_2024-02-25T18-22-01.cshd
...
18:22:02 - INFO - 

NO MISSING FILES!

NO FAILED CHECKSUMS!

SUMMARY:
    TOTAL FILES: 3
    MATCHES: 3
    FAILED CHECKSUMS: 0
    MISSING: 0

...

18:22:02 - INFO - /home/m/Documents/Documents_bh_2024-02-25T18-22-01.cshd: No missing files and all files matching their hashes

...

18:22:02 - INFO - Successfully completed the following 5 operation(s):
Hashed '/home/m/Documents':
  Hash file: /home/m/Documents/Documents_bh_2024-02-25T18-22-01.cshd
Transfer successful:
  From: /home/m/Documents
  To: /media/storage1/docs_2024
Transfer successful:
  From: /home/m/Documents
  To: /media/storage2/docs_2024
Verified transfer '/media/storage1/docs_2024':
  Checked: 3
  CRC Errors: 0
  Missing: 0
Verified transfer '/media/storage2/docs_2024':
  Checked: 3
  CRC Errors: 0
  Missing: 0
```

Each part of the backup process can be run on its own and on a
specific source/target combination only. For more information
see the [backup process section](#backup-process).

## Backup process

The backup process, which can be run automatically using the
`start` command is split into the subprocesses:

1) Hash all source directories. The checksum file will be added to
   the directory. A log file of creating the checksum file will
   be written next to status JSON file.
2) Transfer all sources to their targets. Only one read __or__ write
   operation per disk will be allowed at the same time.
3) Verify the transfer by comparing the hashes of the generated
   checksum file with the hashes of the files on the target.
   A log of the verification process will be written to the target.

The verification process (3) will be run last if there are more
transfer operations on a disk, so:

1) More expensive write operations are performed first.
2) The transferred files are less likely to be in cache when hashing.

Each part of the backup process can be run on its own and/or on a
specific source/target combination only. Required previous steps
will be run automatically.

Using the `interactive` command it's possible to add sources/targets
while the transfer is running, otherwise all running operations would
need to be completed before executing further commands.

## Commands

See `python -m backup_helper --help`

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "backup-helper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "script,verify,backup,archival,bit-rot",
    "author": "",
    "author_email": "omgitsmoe <60219950+omgitsmoe@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/83/18/1751dc837f17312f0fe315922acd39146284dcbeb47d2c6406de272a21b1/backup-helper-0.2.tar.gz",
    "platform": null,
    "description": "# BackupHelper\n\nA tool for simplifying the process of archiving multiple directories\nonto several different drives. For each directory a checksum file \nwill be created, which will be verified after the transfer.\n\nYou can stage multiple sources and add targets to them.\nOnce you're done you can start the transfer, which will run\nall copy operations at the same time, while making sure that\nall disks in a transfer aren't busy with another BackupHelper operation.\n\n## Quick start\n\nAdd a directory as a source for copying/archiving:\n```\npython -m backup_helper stage ~/Documents --alias docs\nStaged: /home/m/Documents\n    with alias: docs\n```\n\nBy default the BackupHelper state will be saved in the file\n`backup_status.json` in the current working directory.\nAlternatively a custom path can be used by passing\n`--status-file /path/to/status.json` to __each__ command.\n\nAdd targets to that source. Either the normalized absolute path\ncan be used as `source` or the alias (here: _\"docs\"_) if present:\n\n```\n$ python -m backup_helper add-target docs /media/storage1/docs_2024 --alias storage1\nAdded target /media/storage1/docs_2024\n    with alias: storage1\n$ python -m backup_helper add-target docs /media/storage1/docs_2024 --alias storage2\nAdded target /media/storage1/docs_2024\n    with alias: storage2\n```\n\nNow you can use the command `start` run the whole backup process\nin sequence.\n\n```\npython -m backup_helper start\n18:22:01 - INFO - Wrote /home/m/Documents/Documents_bh_2024-02-25T18-22-01.cshd\n...\n18:22:02 - INFO - \n\nNO MISSING FILES!\n\nNO FAILED CHECKSUMS!\n\nSUMMARY:\n    TOTAL FILES: 3\n    MATCHES: 3\n    FAILED CHECKSUMS: 0\n    MISSING: 0\n\n...\n\n18:22:02 - INFO - /home/m/Documents/Documents_bh_2024-02-25T18-22-01.cshd: No missing files and all files matching their hashes\n\n...\n\n18:22:02 - INFO - Successfully completed the following 5 operation(s):\nHashed '/home/m/Documents':\n  Hash file: /home/m/Documents/Documents_bh_2024-02-25T18-22-01.cshd\nTransfer successful:\n  From: /home/m/Documents\n  To: /media/storage1/docs_2024\nTransfer successful:\n  From: /home/m/Documents\n  To: /media/storage2/docs_2024\nVerified transfer '/media/storage1/docs_2024':\n  Checked: 3\n  CRC Errors: 0\n  Missing: 0\nVerified transfer '/media/storage2/docs_2024':\n  Checked: 3\n  CRC Errors: 0\n  Missing: 0\n```\n\nEach part of the backup process can be run on its own and on a\nspecific source/target combination only. For more information\nsee the [backup process section](#backup-process).\n\n## Backup process\n\nThe backup process, which can be run automatically using the\n`start` command is split into the subprocesses:\n\n1) Hash all source directories. The checksum file will be added to\n   the directory. A log file of creating the checksum file will\n   be written next to status JSON file.\n2) Transfer all sources to their targets. Only one read __or__ write\n   operation per disk will be allowed at the same time.\n3) Verify the transfer by comparing the hashes of the generated\n   checksum file with the hashes of the files on the target.\n   A log of the verification process will be written to the target.\n\nThe verification process (3) will be run last if there are more\ntransfer operations on a disk, so:\n\n1) More expensive write operations are performed first.\n2) The transferred files are less likely to be in cache when hashing.\n\nEach part of the backup process can be run on its own and/or on a\nspecific source/target combination only. Required previous steps\nwill be run automatically.\n\nUsing the `interactive` command it's possible to add sources/targets\nwhile the transfer is running, otherwise all running operations would\nneed to be completed before executing further commands.\n\n## Commands\n\nSee `python -m backup_helper --help`\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Helper tool for creating plain-file cold-storage archives including checksum files",
    "version": "0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/omgitsmoe/backup_helper/issues",
        "Homepage": "https://github.com/omgitsmoe/backup_helper"
    },
    "split_keywords": [
        "script",
        "verify",
        "backup",
        "archival",
        "bit-rot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4e19c912f053a310de113af990060a3cbc0e02a35808b9893368c0aba1c92b8",
                "md5": "fc17d100f1c8fd83d67a7a8cc906798b",
                "sha256": "d00db27a82986ecdbc71111ceea851d799577e7474de0d5ef1cd25ee2b61118b"
            },
            "downloads": -1,
            "filename": "backup_helper-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fc17d100f1c8fd83d67a7a8cc906798b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 22120,
            "upload_time": "2024-02-25T20:14:52",
            "upload_time_iso_8601": "2024-02-25T20:14:52.479618Z",
            "url": "https://files.pythonhosted.org/packages/d4/e1/9c912f053a310de113af990060a3cbc0e02a35808b9893368c0aba1c92b8/backup_helper-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "83181751dc837f17312f0fe315922acd39146284dcbeb47d2c6406de272a21b1",
                "md5": "bdfd3ee3fb635a988bd171b94a669980",
                "sha256": "77400194fe36e146b1075271c436f2f64c193bed34c4a3ef6eb8f6c91dbf2bfb"
            },
            "downloads": -1,
            "filename": "backup-helper-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "bdfd3ee3fb635a988bd171b94a669980",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 32361,
            "upload_time": "2024-02-25T20:14:54",
            "upload_time_iso_8601": "2024-02-25T20:14:54.659637Z",
            "url": "https://files.pythonhosted.org/packages/83/18/1751dc837f17312f0fe315922acd39146284dcbeb47d2c6406de272a21b1/backup-helper-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-25 20:14:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "omgitsmoe",
    "github_project": "backup_helper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "backup-helper"
}
        
Elapsed time: 0.20136s