{ "info": { "author": "Mark Blakeney", "author_email": "mark@irsaere.net", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": "## B2RESTORE\n\n[b2restore](http://github.com/bulletmark/b2restore) is a command line\nutility which can be used with [rclone](https://rclone.org/) to\nmanually restore a [Backblaze B2](https://www.backblaze.com/b2/) archive\nfor any given date and time. Alternatively, you can create a git\nrepository of all date and time snapshots.\n\n### INSTALLATION\n\nArch users can install [b2restore from the\nAUR](https://aur.archlinux.org/packages/b2restore/).\n\nRequires python 3.5 or later. Note [b2restore is on\nPyPI](https://pypi.org/project/b2restore/) so you can `sudo pip install\nb2restore` or:\n\n```\n$ git clone http://github.com/bulletmark/b2restore\n$ sudo make install\n```\n\n### CREATION OF INITIAL RCLONE COPY\n\nThis utility is typically used with [rclone](https://rclone.org/).\nSimply `rclone sync` or `rclone copy` the B2 bucket or sub-paths from\nthe bucket which you want to restore. You **MUST** specify\n`--b2-versions` to include all file versions, e.g:\n\n```\nmkdir b2files\nrclone sync --b2-versions --fast-list --transfers=4 $* B2:mybucket b2files\n```\n\nThe above command will copy all files and available versions to the\n`b2files` directory. You only need to do this once.\n\n### CREATION OF SNAPSHOT AT GIVEN TIME\n\nGiven the above `rclone` initial copy, you run this utility to\ncreate a snapshot of the directory tree for the time you are interested\nin.\n\nE.g. to recreate the tree of latest files, in `outdir`:\n\n```\nb2restore b2files outdir\n```\n\nE.g. to recreate the tree of files at a specified time:\n\n```\nb2restore -t 2018-01-01T09:10:00 b2files outdir\n```\n\nJust keep selecting different times to incrementally recreate `outdir`\nas it existed at that time. The utility prints a line for each file\nupdated, created, or deleted in `outdir` compared to the previous\ncontents. The date and time of each updated/created/deleted file is also\nlisted. The target files are all hard-linked from the files in the\nsource directory so the `outdir` tree is created very quickly since\nfiles do not need to be actually copied. Thus you can conveniently\nexperiment with the time string to quickly see file differences.\n\nRather than specifying an explicit time string using `-t/--time`, you\ncan instead choose to use `-f/--filetime` to specify any one specific\nfile's modification time at which to recreate the target tree of files.\n\nNote that this utility does not recreate empty directory hierarchies.\nAll empty directories in the target tree are deleted.\n\n#### B2RESTORE COMMAND LINE OPTIONS\n\n```\nusage: b2restore [-h] [-t TIME | -f FILETIME] [-s] [-g] [-p PATH]\n indir [outdir]\n\nProgram to recreate Backblaze B2 file archive at specified date and time.\n\npositional arguments:\n indir input B2 archive containing all file versions (from\n --b2-versions)\n outdir output directory to recreate for given time\n\noptional arguments:\n -h, --help show this help message and exit\n -t TIME, --time TIME set time YYYY-MM-DDTHH:MM.SS, default=latest\n -f FILETIME, --filetime FILETIME\n set time based on specified file\n -s, --summary just print a summary of files and versions\n -g, --gitkeep preserve any top level git dir in outdir\n -p PATH, --path PATH only process files under given path\n```\n\n### CREATION OF GIT REPOSITORY OF ALL SNAPSHOTS\n\nRather than run `b2restore` for the given date + times you are\ninterested in, you can instead choose to run the provided\n`b2restore-create-git` utility to automatically create a git repository\nof snapshots of files for all the dates + times inherent in the `rclone`\ninitial copy.\n\nSo after performing the `rclone` initial copy above, run the following\ncommand to create a complete git repository:\n\n```\nb2restore-create-git b2files outdir\n```\n\nThen `cd outdir` and run `git log` etc to view the history.\n\n#### B2RESTORE-CREATE-GIT COMMAND LINE OPTIONS\n\n```\nUsage: b2restore-create-git [-options] indir outdir\nCreate git repository from given B2 rclone copy.\nOptions:\n-t YYYY-MM-DDTHH:MM.SS (start git repo from given time)\n-e YYYY-MM-DDTHH:MM.SS (end git repo before given time)\n-p (only process files under given path)\n```\n\n### TEST RUN UTILITY\n\nA command line utility `b2restore-create-dummy-files` is included to\nfacilitate testing `b2restore` on your restored file tree without\nactually downloading any files from your B2 archive(!). This utility\nparses `rclone lsl` output to recreate your B2 bucket directory and\nhierarchy of file versions. Only the file names are recreated of course,\nthe file contents are set to their actual byte size but with random byte\ncontents (or zero filled if you specify `-z`, or to zero length if you\nspecify `-s`).\n\nThis utility requires almost nothing to download from your B2 archive\nand runs extremely quickly. You can then run `b2restore` against this\ndummy archive to simulate what files are changed between versions, etc.\nIt is also good to get a feel for how `b2restore` works, what it does,\nand whether it suits your needs without requiring you to first perform\nan onerous huge download of your entire B2 archive.\n\nHere is an example usage:\n\n```\nrclone lsl --b2-versions B2:mybucket | b2restore-create-dummy-files allfiles\nb2restore allfiles b2\ndu -shl b2 # (see how much storage tree of latest versions uses)\nb2restore -t 2018-05-10T12:00.00 allfiles b2\ndu -shl b2 # (see how much storage tree of yesterdays versions uses)\n```\n\n#### B2RESTORE-CREATE-DUMMY-FILES COMMAND LINE OPTIONS\n\n```\nUsage: b2restore-create-dummy-files [-options] outdir\nReads B2 file list (from lsl output) from standard input to create\ndummy tree of files.\nOptions:\n-z (zero fill files, not with random content which is default)\n-s (set files to zero length, not their actual size)\n-p (only process files under given path)\n```\n\n### LICENSE\n\nCopyright (C) 2018 Mark Blakeney. This program is distributed under the\nterms of the GNU General Public License.\nThis program is free software: you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or any later\nversion.\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\nPublic License at for more details.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bulletmark/b2restore", "keywords": "backblaze b2", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "b2restore", "package_url": "https://pypi.org/project/b2restore/", "platform": "", "project_url": "https://pypi.org/project/b2restore/", "project_urls": { "Homepage": "https://github.com/bulletmark/b2restore" }, "release_url": "https://pypi.org/project/b2restore/1.9.2/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Program to recreate Backblaze B2 file archive atspecified date+time", "version": "1.9.2" }, "last_serial": 4230432, "releases": { "1.9.2": [ { "comment_text": "", "digests": { "md5": "2c5e819b08d4330392bf83571d65e2c0", "sha256": "e2945d5aa2592ada85cd47423ad85440c1b7ff6bc8b21cfb6885469b85c71cb1" }, "downloads": -1, "filename": "b2restore-1.9.2.tar.gz", "has_sig": false, "md5_digest": "2c5e819b08d4330392bf83571d65e2c0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7736, "upload_time": "2018-09-02T02:20:49", "url": "https://files.pythonhosted.org/packages/83/bd/2d8a7de0cf7dedb82834195b9b681369dcde5258378819c6fd22138c5ab5/b2restore-1.9.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2c5e819b08d4330392bf83571d65e2c0", "sha256": "e2945d5aa2592ada85cd47423ad85440c1b7ff6bc8b21cfb6885469b85c71cb1" }, "downloads": -1, "filename": "b2restore-1.9.2.tar.gz", "has_sig": false, "md5_digest": "2c5e819b08d4330392bf83571d65e2c0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7736, "upload_time": "2018-09-02T02:20:49", "url": "https://files.pythonhosted.org/packages/83/bd/2d8a7de0cf7dedb82834195b9b681369dcde5258378819c6fd22138c5ab5/b2restore-1.9.2.tar.gz" } ] }