borgbackup-1.1.15/ 0000755 0001750 0001750 00000000000 13771325773 013713 5 ustar user user 0000000 0000000 borgbackup-1.1.15/setup.cfg 0000644 0001750 0001750 00000000475 13771325773 015542 0 ustar user user 0000000 0000000 [tool:pytest]
python_files = testsuite/*.py
markers =
allow_cache_wipe
[flake8]
ignore = E122,E123,E125,E126,E127,E128,E226,E402,E722,E731,E741,
F401,F405,F811,
W504
max-line-length = 255
exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py,src/borg/algorithms/msgpack
[egg_info]
tag_build =
tag_date = 0
borgbackup-1.1.15/tox.ini 0000644 0001750 0001750 00000000744 13771325506 015225 0 ustar user user 0000000 0000000 # tox configuration - if you change anything here, run this to verify:
# fakeroot -u tox --recreate
[tox]
envlist = py{35,36,37,38,39}
[testenv]
deps =
-rrequirements.d/development.txt
-rrequirements.d/fuse.txt
commands = py.test -n {env:XDISTN:4} -rs --cov=borg --cov-config=.coveragerc --benchmark-skip --pyargs {posargs:borg.testsuite}
# fakeroot -u needs some env vars:
passenv = *
[testenv:flake8]
changedir =
deps = flake8
commands = flake8 src scripts conftest.py
borgbackup-1.1.15/README.rst 0000644 0001750 0001750 00000017542 13771325506 015405 0 ustar user user 0000000 0000000 |screencast_basic|
More screencasts: `installation`_, `advanced usage`_
What is BorgBackup?
-------------------
BorgBackup (short: Borg) is a deduplicating backup program.
Optionally, it supports compression and authenticated encryption.
The main goal of Borg is to provide an efficient and secure way to backup data.
The data deduplication technique used makes Borg suitable for daily backups
since only changes are stored.
The authenticated encryption technique makes it suitable for backups to not
fully trusted targets.
See the `installation manual`_ or, if you have already
downloaded Borg, ``docs/installation.rst`` to get started with Borg.
There is also an `offline documentation`_ available, in multiple formats.
.. _installation manual: https://borgbackup.readthedocs.org/en/stable/installation.html
.. _offline documentation: https://readthedocs.org/projects/borgbackup/downloads
Main features
~~~~~~~~~~~~~
**Space efficient storage**
Deduplication based on content-defined chunking is used to reduce the number
of bytes stored: each file is split into a number of variable length chunks
and only chunks that have never been seen before are added to the repository.
A chunk is considered duplicate if its id_hash value is identical.
A cryptographically strong hash or MAC function is used as id_hash, e.g.
(hmac-)sha256.
To deduplicate, all the chunks in the same repository are considered, no
matter whether they come from different machines, from previous backups,
from the same backup or even from the same single file.
Compared to other deduplication approaches, this method does NOT depend on:
* file/directory names staying the same: So you can move your stuff around
without killing the deduplication, even between machines sharing a repo.
* complete files or time stamps staying the same: If a big file changes a
little, only a few new chunks need to be stored - this is great for VMs or
raw disks.
* The absolute position of a data chunk inside a file: Stuff may get shifted
and will still be found by the deduplication algorithm.
**Speed**
* performance-critical code (chunking, compression, encryption) is
implemented in C/Cython
* local caching of files/chunks index data
* quick detection of unmodified files
**Data encryption**
All data can be protected using 256-bit AES encryption, data integrity and
authenticity is verified using HMAC-SHA256. Data is encrypted clientside.
**Compression**
All data can be optionally compressed:
* lz4 (super fast, low compression)
* zstd (wide range from high speed and low compression to high compression
and lower speed)
* zlib (medium speed and compression)
* lzma (low speed, high compression)
**Off-site backups**
Borg can store data on any remote host accessible over SSH. If Borg is
installed on the remote host, big performance gains can be achieved
compared to using a network filesystem (sshfs, nfs, ...).
**Backups mountable as filesystems**
Backup archives are mountable as userspace filesystems for easy interactive
backup examination and restores (e.g. by using a regular file manager).
**Easy installation on multiple platforms**
We offer single-file binaries that do not require installing anything -
you can just run them on these platforms:
* Linux
* Mac OS X
* FreeBSD
* OpenBSD and NetBSD (no xattrs/ACLs support or binaries yet)
* Cygwin (experimental, no binaries yet)
* Linux Subsystem of Windows 10 (experimental)
**Free and Open Source Software**
* security and functionality can be audited independently
* licensed under the BSD (3-clause) license, see `License`_ for the
complete license
Easy to use
~~~~~~~~~~~
Initialize a new backup repository (see ``borg init --help`` for encryption options)::
$ borg init -e repokey /path/to/repo
Create a backup archive::
$ borg create /path/to/repo::Saturday1 ~/Documents
Now doing another backup, just to show off the great deduplication::
$ borg create -v --stats /path/to/repo::Saturday2 ~/Documents
-----------------------------------------------------------------------------
Archive name: Saturday2
Archive fingerprint: 622b7c53c...
Time (start): Sat, 2016-02-27 14:48:13
Time (end): Sat, 2016-02-27 14:48:14
Duration: 0.88 seconds
Number of files: 163
-----------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 6.85 MB 6.85 MB 30.79 kB <-- !
All archives: 13.69 MB 13.71 MB 6.88 MB
Unique chunks Total chunks
Chunk index: 167 330
-----------------------------------------------------------------------------
For a graphical frontend refer to our complementary project `BorgWeb `_.
Helping, Donations and Bounties, becoming a Patron
--------------------------------------------------
Your help is always welcome!
Spread the word, give feedback, help with documentation, testing or development.
You can also give monetary support to the project, see there for details:
https://www.borgbackup.org/support/fund.html
Links
-----
* `Main Web Site `_
* `Releases `_,
`PyPI packages `_ and
`ChangeLog `_
* `Offline Documentation `_
* `GitHub `_ and
`Issue Tracker `_.
* `Web-Chat (IRC) `_ and
`Mailing List `_
* `License `_
* `Security contact `_
Compatibility notes
-------------------
EXPECT THAT WE WILL BREAK COMPATIBILITY REPEATEDLY WHEN MAJOR RELEASE NUMBER
CHANGES (like when going from 0.x.y to 1.0.0 or from 1.x.y to 2.0.0).
NOT RELEASED DEVELOPMENT VERSIONS HAVE UNKNOWN COMPATIBILITY PROPERTIES.
THIS IS SOFTWARE IN DEVELOPMENT, DECIDE YOURSELF WHETHER IT FITS YOUR NEEDS.
Security issues should be reported to the `Security contact`_ (or
see ``docs/support.rst`` in the source distribution).
.. start-badges
|doc| |build| |coverage| |bestpractices| |bounties|
.. |bounties| image:: https://api.bountysource.com/badge/team?team_id=78284&style=bounties_posted
:alt: Bounty Source
:target: https://www.bountysource.com/teams/borgbackup
.. |doc| image:: https://readthedocs.org/projects/borgbackup/badge/?version=stable
:alt: Documentation
:target: https://borgbackup.readthedocs.org/en/stable/
.. |build| image:: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=1.1-maint
:alt: Build Status (1.1-maint)
:target: https://github.com/borgbackup/borg/actions
.. |coverage| image:: https://codecov.io/github/borgbackup/borg/coverage.svg?branch=1.1-maint
:alt: Test Coverage (1.1-maint)
:target: https://codecov.io/github/borgbackup/borg?branch=1.1-maint
.. |screencast_basic| image:: https://asciinema.org/a/133292.png
:alt: BorgBackup Basic Usage
:target: https://asciinema.org/a/133292?autoplay=1&speed=1
.. _installation: https://asciinema.org/a/133291?autoplay=1&speed=1
.. _advanced usage: https://asciinema.org/a/133293?autoplay=1&speed=1
.. |bestpractices| image:: https://bestpractices.coreinfrastructure.org/projects/271/badge
:alt: Best Practices Score
:target: https://bestpractices.coreinfrastructure.org/projects/271
.. end-badges
borgbackup-1.1.15/requirements.d/ 0000755 0001750 0001750 00000000000 13771325773 016660 5 ustar user user 0000000 0000000 borgbackup-1.1.15/requirements.d/fuse.txt 0000644 0001750 0001750 00000000165 13771325506 020357 0 ustar user user 0000000 0000000 # low-level FUSE support library for "borg mount"
# please see the comments in setup.py about llfuse.
llfuse >=1.3.4
borgbackup-1.1.15/requirements.d/coala.txt 0000644 0001750 0001750 00000000166 13771325506 020475 0 ustar user user 0000000 0000000 # style and other checks for many languages.
# some bears (checkers) have additional requirements.
coala
coala-bears
borgbackup-1.1.15/requirements.d/development.lock.txt 0000644 0001750 0001750 00000000351 13771325506 022663 0 ustar user user 0000000 0000000 setuptools==50.3.0
setuptools-scm==4.1.2
pip==20.2.3
virtualenv==20.0.33
importlib-metadata==1.7.0
pluggy==0.13.1
tox==3.20.0
pytest==6.1.1
pytest-xdist==2.1.0
pytest-cov==2.10.1
pytest-benchmark==3.2.3
Cython==0.29.21
twine==1.15.0
borgbackup-1.1.15/requirements.d/development.txt 0000644 0001750 0001750 00000000152 13771325506 021733 0 ustar user user 0000000 0000000 setuptools
setuptools_scm
pip
virtualenv
tox
pytest
pytest-xdist
pytest-cov
pytest-benchmark
Cython
twine
borgbackup-1.1.15/requirements.d/docs.txt 0000644 0001750 0001750 00000000033 13771325506 020337 0 ustar user user 0000000 0000000 sphinx
guzzle_sphinx_theme
borgbackup-1.1.15/.coveragerc 0000644 0001750 0001750 00000000741 13771325506 016030 0 ustar user user 0000000 0000000 [run]
branch = True
disable_warnings = module-not-measured
source = src/borg
omit =
*/borg/__init__.py
*/borg/__main__.py
*/borg/_version.py
*/borg/fuse.py
*/borg/support/*
*/borg/testsuite/*
*/borg/hash_sizes.py
[report]
exclude_lines =
pragma: no cover
pragma: freebsd only
pragma: unknown platform only
def __repr__
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
ignore_errors = True
borgbackup-1.1.15/setup_lz4.py 0000644 0001750 0001750 00000004661 13771325506 016217 0 ustar user user 0000000 0000000 # Support code for building a C extension with lz4 files
#
# Copyright (c) 2016-present, Gregory Szorc (original code for zstd)
# 2017-present, Thomas Waldmann (mods to make it more generic, code for lz4)
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
# lz4 files, structure as seen in lz4 project repository:
lz4_sources = [
'lib/lz4.c',
]
lz4_includes = [
'lib',
]
def lz4_system_prefix(prefixes):
for prefix in prefixes:
filename = os.path.join(prefix, 'include', 'lz4.h')
if os.path.exists(filename):
with open(filename, 'rb') as fd:
if b'LZ4_compress_default' in fd.read(): # requires lz4 >= 1.7.0 (r129)
return prefix
def lz4_ext_kwargs(bundled_path, system_prefix=None, system=False, **kwargs):
"""amend kwargs with lz4 stuff for a distutils.extension.Extension initialization.
bundled_path: relative (to this file) path to the bundled library source code files
system_prefix: where the system-installed library can be found
system: True: use the system-installed shared library, False: use the bundled library code
kwargs: distutils.extension.Extension kwargs that should be amended
returns: amended kwargs
"""
def multi_join(paths, *path_segments):
"""apply os.path.join on a list of paths"""
return [os.path.join(*(path_segments + (path, ))) for path in paths]
use_system = system and system_prefix is not None
sources = kwargs.get('sources', [])
if not use_system:
sources += multi_join(lz4_sources, bundled_path)
include_dirs = kwargs.get('include_dirs', [])
if use_system:
include_dirs += multi_join(['include'], system_prefix)
else:
include_dirs += multi_join(lz4_includes, bundled_path)
library_dirs = kwargs.get('library_dirs', [])
if use_system:
library_dirs += multi_join(['lib'], system_prefix)
libraries = kwargs.get('libraries', [])
if use_system:
libraries += ['lz4', ]
extra_compile_args = kwargs.get('extra_compile_args', [])
if not use_system:
extra_compile_args += [] # not used yet
ret = dict(**kwargs)
ret.update(dict(sources=sources, extra_compile_args=extra_compile_args,
include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries))
return ret
borgbackup-1.1.15/CHANGES.rst 0000644 0001750 0001750 00000443661 13771325506 015525 0 ustar user user 0000000 0000000 .. _important_notes:
Important notes
===============
This section provides information about security and corruption issues.
.. _hashindex_set_bug:
Pre-1.1.11 potential index corruption / data loss issue
-------------------------------------------------------
A bug was discovered in our hashtable code, see issue #4829.
The code is used for the client-side chunks cache and the server-side repo index.
Although borg uses the hashtables very heavily, the index corruption did not
happen too frequently, because it needed specific conditions to happen.
Data loss required even more specific conditions, so it should be rare (and
also detectable via borg check).
You might be affected if borg crashed with / complained about:
- AssertionError: Corrupted segment reference count - corrupted index or hints
- ObjectNotFound: Object with key ... not found in repository ...
- Index mismatch for key b'...'. (..., ...) != (-1, -1)
- ValueError: stats_against: key contained in self but not in master_index.
Advised procedure to fix any related issue in your indexes/caches:
- install fixed borg code (on client AND server)
- for all of your clients and repos remove the cache by:
borg delete --cache-only YOURREPO
(later, the cache will be re-built automatically)
- for all your repos, rebuild the repo index by:
borg check --repair YOURREPO
This will also check all archives and detect if there is any data-loss issue.
Affected branches / releases:
- fd06497 introduced the bug into 1.1-maint branch - it affects all borg 1.1.x since 1.1.0b4.
- fd06497 introduced the bug into master branch - it affects all borg 1.2.0 alpha releases.
- c5cd882 introduced the bug into 1.0-maint branch - it affects all borg 1.0.x since 1.0.11rc1.
The bug was fixed by:
- 701159a fixes the bug in 1.1-maint branch - will be released with borg 1.1.11.
- fa63150 fixes the bug in master branch - will be released with borg 1.2.0a8.
- 7bb90b6 fixes the bug in 1.0-maint branch. Branch is EOL, no new release is planned as of now.
.. _broken_validator:
Pre-1.1.4 potential data corruption issue
-----------------------------------------
A data corruption bug was discovered in borg check --repair, see issue #3444.
This is a 1.1.x regression, releases < 1.1 (e.g. 1.0.x) are not affected.
To avoid data loss, you must not run borg check --repair using an unfixed version
of borg 1.1.x. The first official release that has the fix is 1.1.4.
Package maintainers may have applied the fix to updated packages of 1.1.x (x<4)
though, see the package maintainer's package changelog to make sure.
If you never had missing item metadata chunks, the bug has not affected you
even if you did run borg check --repair with an unfixed version.
When borg check --repair tried to repair corrupt archives that miss item metadata
chunks, the resync to valid metadata in still present item metadata chunks
malfunctioned. This was due to a broken validator that considered all (even valid)
item metadata as invalid. As they were considered invalid, borg discarded them.
Practically, that means the affected files, directories or other fs objects were
discarded from the archive.
Due to the malfunction, the process was extremely slow, but if you let it
complete, borg would have created a "repaired" archive that has lost a lot of items.
If you interrupted borg check --repair because it was so strangely slow (killing
borg somehow, e.g. Ctrl-C) the transaction was rolled back and no corruption occurred.
The log message indicating the precondition for the bug triggering looks like:
item metadata chunk missing [chunk: 001056_bdee87d...a3e50d]
If you never had that in your borg check --repair runs, you're not affected.
But if you're unsure or you actually have seen that, better check your archives.
By just using "borg list repo::archive" you can see if all expected filesystem
items are listed.
.. _tam_vuln:
Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)
----------------------------------------------------------
A flaw in the cryptographic authentication scheme in Borg allowed an attacker
to spoof the manifest. The attack requires an attacker to be able to
1. insert files (with no additional headers) into backups
2. gain write access to the repository
This vulnerability does not disclose plaintext to the attacker, nor does it
affect the authenticity of existing archives.
The vulnerability allows an attacker to create a spoofed manifest (the list of archives).
Creating plausible fake archives may be feasible for small archives, but is unlikely
for large archives.
The fix adds a separate authentication tag to the manifest. For compatibility
with prior versions this authentication tag is *not* required by default
for existing repositories. Repositories created with 1.0.9 and later require it.
Steps you should take:
1. Upgrade all clients to 1.0.9 or later.
2. Run ``borg upgrade --tam `` *on every client* for *each* repository.
3. This will list all archives, including archive IDs, for easy comparison with your logs.
4. Done.
Prior versions can access and modify repositories with this measure enabled, however,
to 1.0.9 or later their modifications are indiscernible from an attack and will
raise an error until the below procedure is followed. We are aware that this can
be be annoying in some circumstances, but don't see a way to fix the vulnerability
otherwise.
In case a version prior to 1.0.9 is used to modify a repository where above procedure
was completed, and now you get an error message from other clients:
1. ``borg upgrade --tam --force `` once with *any* client suffices.
This attack is mitigated by:
- Noting/logging ``borg list``, ``borg info``, or ``borg create --stats``, which
contain the archive IDs.
We are not aware of others having discovered, disclosed or exploited this vulnerability.
Vulnerability time line:
* 2016-11-14: Vulnerability and fix discovered during review of cryptography by Marian Beermann (@enkore)
* 2016-11-20: First patch
* 2016-12-20: Released fixed version 1.0.9
* 2017-01-02: CVE was assigned
* 2017-01-15: Released fixed version 1.1.0b3 (fix was previously only available from source)
.. _attic013_check_corruption:
Pre-1.0.9 potential data loss
-----------------------------
If you have archives in your repository that were made with attic <= 0.13
(and later migrated to borg), running borg check would report errors in these
archives. See issue #1837.
The reason for this is a invalid (and useless) metadata key that was
always added due to a bug in these old attic versions.
If you run borg check --repair, things escalate quickly: all archive items
with invalid metadata will be killed. Due to that attic bug, that means all
items in all archives made with these old attic versions.
Pre-1.0.4 potential repo corruption
-----------------------------------
Some external errors (like network or disk I/O errors) could lead to
corruption of the backup repository due to issue #1138.
A sign that this happened is if "E" status was reported for a file that can
not be explained by problems with the source file. If you still have logs from
"borg create -v --list", you can check for "E" status.
Here is what could cause corruption and what you can do now:
1) I/O errors (e.g. repo disk errors) while writing data to repo.
This could lead to corrupted segment files.
Fix::
# check for corrupt chunks / segments:
borg check -v --repository-only REPO
# repair the repo:
borg check -v --repository-only --repair REPO
# make sure everything is fixed:
borg check -v --repository-only REPO
2) Unreliable network / unreliable connection to the repo.
This could lead to archive metadata corruption.
Fix::
# check for corrupt archives:
borg check -v --archives-only REPO
# delete the corrupt archives:
borg delete --force REPO::CORRUPT_ARCHIVE
# make sure everything is fixed:
borg check -v --archives-only REPO
3) In case you want to do more intensive checking.
The best check that everything is ok is to run a dry-run extraction::
borg extract -v --dry-run REPO::ARCHIVE
.. _changelog:
Changelog
=========
Version 1.1.15 (2020-12-25)
---------------------------
Compatibility notes:
- When upgrading from borg 1.0.x to 1.1.x, please note:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
about a unknown unencrypted repository one time.
- your first backup with 1.1.x might be significantly slower (it might
completely read, chunk, hash a lot files) - this is due to the
--files-cache mode change (and happens every time you change mode).
You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible
mode (but that is less safe for detecting changed files than the default).
See the --files-cache docs for details.
- 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux).
If WSL still has a problem with sync_file_range, you need to set
BORG_WORKAROUNDS=basesyncfile in the borg process environment to
work around the WSL issue.
- 1.1.14 changes return codes due to a bug fix:
In case you have scripts expecting rc == 2 for a signal exit, you need to
update them to check for >= 128 (as documented since long).
- 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now.
Fixes:
- extract:
- improve exception handling when setting xattrs, #5092.
- emit a warning message giving the path, xattr key and error message.
- continue trying to restore other xattrs and bsdflags of the same file
after an exception with xattr-setting happened.
- export-tar:
- set tar format to GNU_FORMAT explicitly, #5274
- fix memory leak with ssh: remote repository, #5568
- fix potential memory leak with ssh: remote repository with partial extraction
- create: fix --dry-run and --stats coexistence, #5415
- use --timestamp for {utcnow} and {now} if given, #5189
New features:
- create: implement --stdin-mode, --stdin-user and --stdin-group, #5333
- allow appending the files cache filename with BORG_FILES_CACHE_SUFFIX env var
Other changes:
- drop python 3.4 support, minimum requirement is 3.5 now.
- enable using libxxhash instead of bundled xxh64 code
- update llfuse requirements (1.3.8)
- set cython language_level in some files to fix warnings
- allow EIO with warning when trying to hardlink
- PropDict: fail early if internal_dict is not a dict
- update shell completions
- tests / CI
- add a test for the hashindex corruption bug, #5531 #4829
- fix spurious failure in test_cache_files, #5438
- added a github ci workflow
- reduce testing on travis, no macOS, no py3x-dev, #5467
- travis: use newer dists, native py on dist
- vagrant:
- remove jessie and trusty boxes, #5348 #5383
- pyinstaller 4.0, build on py379
- binary build on stretch64, #5348
- remove easy_install based pip installation
- docs:
- clarify '--one-file-system' for btrfs, #5391
- add example for excluding content using the --pattern cmd line arg
- complement the documentation for pattern files and exclude files, #5524
- made ansible playbook more generic, use package instead of pacman. also
change state from "latest" to "present".
- complete documentation on append-only remote repos, #5497
- internals: rather talk about target size than statistics, #5336
- new compression algorithm policy, #1633 #5505
- faq: add a hint on sleeping computer, #5301
- note requirements for full disk access on macOS Catalina, #5303
- fix/improve description of borg upgrade hardlink usage, #5518
- modernize 1.1 code:
- drop code/workarounds only needed to support Python 3.4
- remove workaround for pre-release py37 argparse bug
- removed some outdated comments/docstrings
- requirements: remove some restrictions, lock on current versions
Version 1.1.14 (2020-10-07)
---------------------------
Fixes:
- check --repair: fix potential data loss when interrupting it, #5325
- exit with 128 + signal number (as documented) when borg is killed by a signal, #5161
- fix hardlinked CACHEDIR.TAG processing, #4911
- create --read-special: .part files also should be regular files, #5217
- llfuse dependency: choose least broken 1.3.6/1.3.7.
1.3.6 is broken on python 3.9, 1.3.7 is broken on FreeBSD.
Other changes:
- upgrade bundled xxhash to 0.7.4
- self test: if it fails, also point to OS and hardware, #5334
- pyinstaller: compute basepath from spec file location
- prettier error message when archive gets too big, #5307
- check/recreate are not "experimental" any more (but still potentially dangerous):
- recreate: remove extra confirmation
- rephrase some warnings, update docs, #5164
- shell completions:
- misc. updates / fixes
- support repositories in fish tab completion, #5256
- complete $BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING
- rewrite zsh completion:
- completion for almost all optional and positional arguments
- completion for Borg environment variables (parameters)
- use "allow/deny list" instead of "white/black list" wording
- declare "allow_cache_wipe" marker in setup.cfg to avoid pytest warning
- vagrant / tests:
- misc. fixes / updates
- use python 3.5.10 for binary build
- build directory-based binaries additionally to the single file binaries
- add libffi-dev, required to build python
- use cryptography<3.0, more recent versions break the jessie box
- test on python 3.9
- do brew update with /dev/null redirect to avoid "too much log output" on travis-ci
- docs:
- add ssh-agent pull backup method docs, #5288
- how to approach borg speed issues, #5371
- mention double --force in prune docs
- update Homebrew install instructions, #5185
- better description of how cache and rebuilds of it work
- point to borg create --list item flags in recreate usage, #5165
- add security faq explaining AES-CTR crypto issues, #5254
- add a note to create from stdin regarding files cache, #5180
- fix borg.1 manpage generation regression, #5211
- clarify how exclude options work in recreate, #5193
- add section for retired contributors
- hint about not misusing private email addresses of contributors for borg support
Version 1.1.13 (2020-06-06)
---------------------------
Fixes:
- rebuilt using a current Cython version, compatible with python 3.8, #5214
Version 1.1.12 (2020-06-06)
---------------------------
Fixes:
- fix preload-related memory leak, #5202.
- mount / borgfs (FUSE filesystem):
- fix FUSE low linear read speed on large files, #5067
- fix crash on old llfuse without birthtime attrs, #5064 - accidentally
we required llfuse >= 1.3. Now also old llfuse works again.
- set f_namemax in statfs result, #2684
- update precedence of env vars to set config and cache paths, #4894
- correctly calculate compression ratio, taking header size into account, too
New features:
- --bypass-lock option to bypass locking with read-only repositories
Other changes:
- upgrade bundled zstd to 1.4.5
- travis: adding comments and explanations to Travis config / install script,
improve macOS builds.
- tests: test_delete_force: avoid sporadic test setup issues, #5196
- misc. vagrant fixes
- the binary for macOS is now built on macOS 10.12
- the binaries for Linux are now built on Debian 8 "Jessie", #3761
- docs:
- PlaceholderError not printed as JSON, #4073
- "How important is Borg config?", #4941
- make Sphinx warnings break docs build, #4587
- some markup / warning fixes
- add "updating borgbackup.org/releases" to release checklist, #4999
- add "rendering docs" to release checklist, #5000
- clarify borg init's encryption modes
- add note about patterns and stored paths, #4160
- add upgrade of tools to pip installation how-to
- document one cause of orphaned chunks in check command, #2295
- linked recommended restrictions to ssh public keys on borg servers in faq, #4946
Version 1.1.11 (2020-03-08)
---------------------------
Fixes:
- fixed potential index corruption / data loss issue due to bug in hashindex_set, #4829.
Please read and follow the more detailled notes close to the top of this document.
- upgrade bundled xxhash to 0.7.3, #4891.
0.7.2 is the minimum requirement for correct operations on ARMv6 in non-fixup
mode, where unaligned memory accesses cause bus errors.
0.7.3 adds some speedups and libxxhash 0.7.3 even has a pkg-config file now.
- upgrade bundled lz4 to 1.9.2
- upgrade bundled zstd to 1.4.4
- fix crash when upgrading erroneous hints file, #4922
- extract:
- fix KeyError for "partial" extraction, #4607
- fix "partial" extract for hardlinked contentless file types, #4725
- fix preloading for old (0.xx) remote servers, #4652
- fix confusing output of borg extract --list --strip-components, #4934
- delete: after double-force delete, warn about necessary repair, #4704
- create: give invalid repo error msg if repo config not found, #4411
- mount: fix FUSE mount missing st_birthtime, #4763 #4767
- check: do not stumble over invalid item key, #4845
- info: if the archive doesn't exist, print a pretty message, #4793
- SecurityManager.known(): check all files, #4614
- Repository.open: use stat() to check for repo dir, #4695
- Repository.check_can_create_repository: use stat() to check, #4695
- fix invalid archive error message
- fix optional/non-optional location arg, #4541
- commit-time free space calc: ignore bad compact map entries, #4796
- ignore EACCES (errno 13) when hardlinking the old config, #4730
- --prefix / -P: fix processing, avoid argparse issue, #4769
New features:
- enable placeholder usage in all extra archive arguments
- new BORG_WORKAROUNDS mechanism, basesyncfile, #4710
- recreate: support --timestamp option, #4745
- support platforms without os.link (e.g. Android with Termux), #4901.
if we don't have os.link, we just extract another copy instead of making a hardlink.
- support linux platforms without sync_file_range (e.g. Android 7 with Termux), #4905
Other:
- ignore --stats when given with --dry-run, but continue, #4373
- add some ProgressIndicator msgids to code / fix docs, #4935
- elaborate on "Calculating size" message
- argparser: always use REPOSITORY in metavar, also use more consistent help phrasing.
- check: improve error output for matching index size, see #4829
- docs:
- changelog: add advisory about hashindex_set bug #4829
- better describe BORG_SECURITY_DIR, BORG_CACHE_DIR, #4919
- infos about cache security assumptions, #4900
- add FAQ describing difference between a local repo vs. repo on a server.
- document how to test exclusion patterns without performing an actual backup
- timestamps in the files cache are now usually ctime, #4583
- fix bad reference to borg compact (does not exist in 1.1), #4660
- create: borg 1.1 is not future any more
- extract: document limitation "needs empty destination", #4598
- how to supply a passphrase, use crypto devices, #4549
- fix osxfuse github link in installation docs
- add example of exclude-norecurse rule in help patterns
- update macOS Brew link
- add note about software for automating backups, #4581
- AUTHORS: mention copyright+license for bundled msgpack
- fix various code blocks in the docs, #4708
- updated docs to cover use of temp directory on remote, #4545
- add restore docs, #4670
- add a pull backup / push restore how-to, #1552
- add FAQ how to retain original paths, #4532
- explain difference between --exclude and --pattern, #4118
- add FAQs for SSH connection issues, #3866
- improve password FAQ, #4591
- reiterate that 'file cache names are absolute' in FAQ
- tests:
- cope with ANY error when importing pytest into borg.testsuite, #4652
- fix broken test that relied on improper zlib assumptions
- test_fuse: filter out selinux xattrs, #4574
- travis / vagrant:
- misc python versions removed / changed (due to openssl 1.1 compatibility)
or added (3.7 and 3.8, for better borg compatibility testing)
- binary building is on python 3.5.9 now
- vagrant:
- add new boxes: ubuntu 18.04 and 20.04, debian 10
- update boxes: openindiana, darwin, netbsd
- remove old boxes: centos 6
- darwin: updated osxfuse to 3.10.4
- use debian/ubuntu pip/virtualenv packages
- rather use python 3.6.2 than 3.6.0, fixes coverage/sqlite3 issue
- use requirements.d/development.lock.txt to avoid compat issues
- travis:
- darwin: backport some install code / order from master
- remove deprecated keyword "sudo" from travis config
- allow osx builds to fail, #4955
this is due to travis-ci frequently being so slow that the OS X builds
just fail because they exceed 50 minutes and get killed by travis.
Version 1.1.10 (2019-05-16)
---------------------------
Fixes:
- extract: hang on partial extraction with ssh: repo, when hardlink master
is not matched/extracted and borg hangs on related slave hardlink, #4350
- lrucache: regularly remove old FDs, #4427
- avoid stale filehandle issues, #3265
- freebsd: make xattr platform code api compatible with linux, #3952
- use whitelist approach for borg serve, #4097
- borg command shall terminate with rc 2 for ImportErrors, #4424
- create: only run stat_simple_attrs() once, this increases
backup with lots of unchanged files performance by ~ 5%.
- prune: fix incorrect borg prune --stats output with --dry-run, #4373
- key export: emit user-friendly error if repo key is exported to a directory,
#4348
New features:
- bundle latest supported msgpack-python release (0.5.6), remove msgpack-python
from setup.py install_requires - by default we use the bundled code now.
optionally, we still support using an external msgpack (see hints in
setup.py), but this requires solid requirements management within
distributions and is not recommended.
borgbackup will break if you upgrade msgpack to an unsupported version.
- display msgpack version as part of sysinfo (e.g. in tracebacks)
- timestamp for borg delete --info added, #4359
- enable placeholder usage in --comment and --glob-archives, #4559, #4495
Other:
- serve: do not check python/libc for borg serve, #4483
- shell completions: borg diff second archive
- release scripts: signing binaries with Qubes OS support
- testing:
- vagrant: upgrade openbsd box to 6.4
- travis-ci: lock test env to py 3.4 compatible versions, #4343
- get rid of confusing coverage warning, #2069
- rename test_mount_hardlinks to test_fuse_mount_hardlinks,
so both can be excluded by "not test_fuse".
- pure-py msgpack warning shall not make a lot of tests fail, #4558
- docs:
- add "SSH Configuration" section to "borg serve", #3988, #636, #4485
- README: new URL for funding options
- add a sample logging.conf in docs/misc, #4380
- elaborate on append-only mode docs, #3504
- installation: added Alpine Linux to distribution list, #4415
- usage.html: only modify window.location when redirecting, #4133
- add msgpack license to docs/3rd_party/msgpack
- vagrant / binary builds:
- use python 3.5.7 for builds
- use osxfuse 3.8.3
Version 1.1.9 (2019-02-10)
--------------------------
Fixes:
- security fix: configure FUSE with "default_permissions", #3903
"default_permissions" is now enforced by borg by default to let the
kernel check uid/gid/mode based permissions.
"ignore_permissions" can be given to not enforce "default_permissions".
- make "hostname" short, even on misconfigured systems, #4262
- fix free space calculation on macOS (and others?), #4289
- config: quit with error message when no key is provided, #4223
- recover_segment: handle too small segment files correctly, #4272
- correctly release memoryview, #4243
- avoid diaper pattern in configparser by opening files, #4263
- add "# cython: language_level=3" directive to .pyx files, #4214
- info: consider part files for "This archive" stats, #3522
- work around Microsoft WSL issue #645 (sync_file_range), #1961
New features:
- add --rsh command line option to complement BORG_RSH env var, #1701
- init: --make-parent-dirs parent1/parent2/repo_dir, #4235
Other:
- add archive name to check --repair output, #3447
- check for unsupported msgpack versions
- shell completions:
- new shell completions for borg 1.1.9
- more complete shell completions for borg mount -o
- added shell completions for borg help
- option arguments for zsh tab completion
- docs:
- add FAQ regarding free disk space check, #3905
- update BORG_PASSCOMMAND example and clarify variable expansion, #4249
- FAQ regarding change of compression settings, #4222
- add note about BSD flags to changelog, #4246
- improve logging in example automation script
- add note about files changing during backup, #4081
- work around the backslash issue, #4280
- update release workflow using twine (docs, scripts), #4213
- add warnings on repository copies to avoid future problems, #4272
- tests:
- fix the homebrew 1.9 issues on travis-ci, #4254
- fix duplicate test method name, #4311
- test_mount_hardlinks: get rid of fakeroot-caused test fails, #3389
Version 1.1.8 (2018-12-09)
--------------------------
Fixes:
- enforce storage quota if set by serve-command, #4093
- invalid locations: give err msg containing parsed location, #4179
- list repo: add placeholders for hostname and username, #4130
- on linux, symlinks can't have ACLs, so don't try to set any, #4044
New features:
- create: added PATH::archive output on INFO log level
- read a passphrase from a file descriptor specified in the
BORG_PASSPHRASE_FD environment variable.
Other:
- docs:
- option --format is required for some expensive-to-compute values for json
borg list by default does not compute expensive values except when
they are needed. whether they are needed is determined by the format,
in standard mode as well as in --json mode.
- tell that our binaries are x86/x64 amd/intel, bauerj has ARM
- fixed wrong archive name pattern in CRUD benchmark help
- fixed link to cachedir spec in docs, #4140
- tests:
- stop using fakeroot on travis, avoids sporadic EISDIR errors, #2482
- xattr key names must start with "user." on linux
- fix code so flake8 3.6 does not complain
- explicitly convert environment variable to str, #4136
- fix DeprecationWarning: Flags not at the start of the expression, #4137
- support pytest4, #4172
- vagrant:
- use python 3.5.6 for builds
Version 1.1.7 (2018-08-11)
--------------------------
Compatibility notes:
- added support for Python 3.7
Fixes:
- cache lock: use lock_wait everywhere to fix infinite wait, see #3968
- don't archive tagged dir when recursing an excluded dir, #3991
- py37 argparse: work around bad default in py 3.7.0a/b/rc, #3996
- py37 remove loggerDict.clear() from tearDown method, #3805
- some fixes for bugs which likely did not result in problems in practice:
- fixed logic bug in platform module API version check
- fixed xattr/acl function prototypes, added missing ones
New features:
- init: add warning to store both key and passphrase at safe place(s)
- BORG_HOST_ID env var to work around all-zero MAC address issue, #3985
- borg debug dump-repo-objs --ghost (dump everything from segment files,
including deleted or superceded objects or commit tags)
- borg debug search-repo-objs (search in repo objects for hex bytes or strings)
Other changes:
- add Python 3.7 support
- updated shell completions
- call socket.gethostname only once
- locking: better logging, add some asserts
- borg debug dump-repo-objs:
- filename layout improvements
- use repository.scan() to get on-disk order
- docs:
- update installation instructions for macOS
- added instructions to install fuse via homebrew
- improve diff docs
- added note that checkpoints inside files requires 1.1+
- add link to tempfile module
- remove row/column-spanning from docs source, #4000 #3990
- tests:
- fetch less data via os.urandom
- add py37 env for tox
- travis: add 3.7, remove 3.6-dev (we test with -dev in master)
- vagrant / binary builds:
- use osxfuse 3.8.2
- use own (uptodate) openindiana box
Version 1.1.6 (2018-06-11)
--------------------------
Compatibility notes:
- 1.1.6 changes:
- also allow msgpack-python 0.5.6.
Fixes:
- fix borg exception handling on ENOSPC error with xattrs, #3808
- prune: fix/improve overall progress display
- borg config repo ... does not need cache/manifest/key, #3802
- debug dump-repo-objs should not depend on a manifest obj
- pypi package:
- include .coveragerc, needed by tox.ini
- fix package long description, #3854
New features:
- mount: add uid, gid, umask mount options
- delete:
- only commit once, #3823
- implement --dry-run, #3822
- check:
- show progress while rebuilding missing manifest, #3787
- more --repair output
- borg config --list , #3612
Other changes:
- update msgpack requirement, #3753
- update bundled zstd to 1.3.4, #3745
- update bundled lz4 code to 1.8.2, #3870
- docs:
- describe what BORG_LIBZSTD_PREFIX does
- fix and deduplicate encryption quickstart docs, #3776
- vagrant:
- FUSE for macOS: upgrade 3.7.1 to 3.8.0
- exclude macOS High Sierra upgrade on the darwin64 machine
- remove borgbackup.egg-info dir in fs_init (after rsync)
- use pyenv-based build/test on jessie32/62
- use local 32 and 64bit debian jessie boxes
- use "vagrant" as username for new xenial box
- travis OS X: use xcode 8.3 (not broken)
Version 1.1.5 (2018-04-01)
--------------------------
Compatibility notes:
- 1.1.5 changes:
- require msgpack-python >= 0.4.6 and < 0.5.0.
0.5.0+ dropped python 3.4 testing and also caused some other issues because
the python package was renamed to msgpack and emitted some FutureWarning.
Fixes:
- create --list: fix that it was never showing M status, #3492
- create: fix timing for first checkpoint (read files cache early, init
checkpoint timer after that), see #3394
- extract: set rc=1 when extracting damaged files with all-zero replacement
chunks or with size inconsistencies, #3448
- diff: consider an empty file as different to a non-existing file, #3688
- files cache: improve exception handling, #3553
- ignore exceptions in scandir_inorder() caused by an implicit stat(),
also remove unneeded sort, #3545
- fixed tab completion problem where a space is always added after path even
when it shouldn't
- build: do .h file content checks in binary mode, fixes build issue for
non-ascii header files on pure-ascii locale platforms, #3544 #3639
- borgfs: fix patterns/paths processing, #3551
- config: add some validation, #3566
- repository config: add validation for max_segment_size, #3592
- set cache previous_location on load instead of save
- remove platform.uname() call which caused library mismatch issues, #3732
- add exception handler around deprecated platform.linux_distribution() call
- use same datetime object for {now} and {utcnow}, #3548
New features:
- create: implement --stdin-name, #3533
- add chunker_params to borg archive info (--json)
- BORG_SHOW_SYSINFO=no to hide system information from exceptions
Other changes:
- updated zsh completions for borg 1.1.4
- files cache related code cleanups
- be more helpful when parsing invalid --pattern values, #3575
- be more clear in secure-erase warning message, #3591
- improve getpass user experience, #3689
- docs build: unicode problem fixed when using a py27-based sphinx
- docs:
- security: explicitly note what happens OUTSIDE the attack model
- security: add note about combining compression and encryption
- security: describe chunk size / proximity issue, #3687
- quickstart: add note about permissions, borg@localhost, #3452
- quickstart: add introduction to repositories & archives, #3620
- recreate --recompress: add missing metavar, clarify description, #3617
- improve logging docs, #3549
- add an example for --pattern usage, #3661
- clarify path semantics when matching, #3598
- link to offline documentation from README, #3502
- add docs on how to verify a signed release with GPG, #3634
- chunk seed is generated per repository (not: archive)
- better formatting of CPU usage documentation, #3554
- extend append-only repo rollback docs, #3579
- tests:
- fix erroneously skipped zstd compressor tests, #3606
- skip a test if argparse is broken, #3705
- vagrant:
- xenial64 box now uses username 'vagrant', #3707
- move cleanup steps to fs_init, #3706
- the boxcutter wheezy boxes are 404, use local ones
- update to Python 3.5.5 (for binary builds)
Version 1.1.4 (2017-12-31)
--------------------------
Compatibility notes:
- When upgrading from borg 1.0.x to 1.1.x, please note:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
about a unknown unencrypted repository one time.
- your first backup with 1.1.x might be significantly slower (it might
completely read, chunk, hash a lot files) - this is due to the
--files-cache mode change (and happens every time you change mode).
You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible
mode (but that is less safe for detecting changed files than the default).
See the --files-cache docs for details.
- borg 1.1.4 changes:
- zstd compression is new in borg 1.1.4, older borg can't handle it.
- new minimum requirements for the compression libraries - if the required
versions (header and lib) can't be found at build time, bundled code will
be used:
- added requirement: libzstd >= 1.3.0 (bundled: 1.3.2)
- updated requirement: liblz4 >= 1.7.0 / r129 (bundled: 1.8.0)
Fixes:
- check: data corruption fix: fix for borg check --repair malfunction, #3444.
See the more detailled notes close to the top of this document.
- delete: also delete security dir when deleting a repo, #3427
- prune: fix building the "borg prune" man page, #3398
- init: use given --storage-quota for local repo, #3470
- init: properly quote repo path in output
- fix startup delay with dns-only own fqdn resolving, #3471
New features:
- added zstd compression. try it!
- added placeholder {reverse-fqdn} for fqdn in reverse notation
- added BORG_BASE_DIR environment variable, #3338
Other changes:
- list help topics when invalid topic is requested
- fix lz4 deprecation warning, requires lz4 >= 1.7.0 (r129)
- add parens for C preprocessor macro argument usages (did not cause malfunction)
- exclude broken pytest 3.3.0 release
- updated fish/bash completions
- init: more clear exception messages for borg create, #3465
- docs:
- add auto-generated docs for borg config
- don't generate HTML docs page for borgfs, #3404
- docs update for lz4 b2 zstd changes
- add zstd to compression help, readme, docs
- update requirements and install docs about bundled lz4 and zstd
- refactored build of the compress and crypto.low_level extensions, #3415:
- move some lib/build related code to setup_{zstd,lz4,b2}.py
- bundle lz4 1.8.0 (requirement: >= 1.7.0 / r129)
- bundle zstd 1.3.2 (requirement: >= 1.3.0)
- blake2 was already bundled
- rename BORG_LZ4_PREFIX env var to BORG_LIBLZ4_PREFIX for better consistency:
we also have BORG_LIBB2_PREFIX and BORG_LIBZSTD_PREFIX now.
- add prefer_system_lib* = True settings to setup.py - by default the build
will prefer a shared library over the bundled code, if library and headers
can be found and meet the minimum requirements.
Version 1.1.3 (2017-11-27)
--------------------------
Fixes:
- Security Fix for CVE-2017-15914: Incorrect implementation of access controls
allows remote users to override repository restrictions in Borg servers.
A user able to access a remote Borg SSH server is able to circumvent access
controls post-authentication.
Affected releases: 1.1.0, 1.1.1, 1.1.2. Releases 1.0.x are NOT affected.
- crc32: deal with unaligned buffer, add tests - this broke borg on older ARM
CPUs that can not deal with unaligned 32bit memory accesses and raise a bus
error in such cases. the fix might also improve performance on some CPUs as
all 32bit memory accesses by the crc32 code are properly aligned now. #3317
- mount: fixed support of --consider-part-files and do not show .borg_part_N
files by default in the mounted FUSE filesystem. #3347
- fixed cache/repo timestamp inconsistency message, highlight that information
is obtained from security dir (deleting the cache will not bypass this error
in case the user knows this is a legitimate repo).
- borgfs: don't show sub-command in borgfs help, #3287
- create: show an error when --dry-run and --stats are used together, #3298
New features:
- mount: added exclusion group options and paths, #2138
Reused some code to support similar options/paths as borg extract offers -
making good use of these to only mount a smaller subset of dirs/files can
speed up mounting a lot and also will consume way less memory.
borg mount [options] repo_or_archive mountpoint path [paths...]
paths: you can just give some "root paths" (like for borg extract) to
only partially populate the FUSE filesystem.
new options: --exclude[-from], --pattern[s-from], --strip-components
- create/extract: support st_birthtime on platforms supporting it, #3272
- add "borg config" command for querying/setting/deleting config values, #3304
Other changes:
- clean up and simplify packaging (only package committed files, do not install
.c/.h/.pyx files)
- docs:
- point out tuning options for borg create, #3239
- add instructions for using ntfsclone, zerofree, #81
- move image backup-related FAQ entries to a new page
- clarify key aliases for borg list --format, #3111
- mention break-lock in checkpointing FAQ entry, #3328
- document sshfs rename workaround, #3315
- add FAQ about removing files from existing archives
- add FAQ about different prune policies
- usage and man page for borgfs, #3216
- clarify create --stats duration vs. wall time, #3301
- clarify encrypted key format for borg key export, #3296
- update release checklist about security fixes
- document good and problematic option placements, fix examples, #3356
- add note about using --nobsdflags to avoid speed penalty related to
bsdflags, #3239
- move most of support section to www.borgbackup.org
Version 1.1.2 (2017-11-05)
--------------------------
Fixes:
- fix KeyError crash when talking to borg server < 1.0.7, #3244
- extract: set bsdflags last (include immutable flag), #3263
- create: don't do stat() call on excluded-norecurse directory, fix exception
handling for stat() call, #3209
- create --stats: do not count data volume twice when checkpointing, #3224
- recreate: move chunks_healthy when excluding hardlink master, #3228
- recreate: get rid of chunks_healthy when rechunking (does not match), #3218
- check: get rid of already existing not matching chunks_healthy metadata, #3218
- list: fix stdout broken pipe handling, #3245
- list/diff: remove tag-file options (not used), #3226
New features:
- bash, zsh and fish shell auto-completions, see scripts/shell_completions/
- added BORG_CONFIG_DIR env var, #3083
Other changes:
- docs:
- clarify using a blank passphrase in keyfile mode
- mention "!" (exclude-norecurse) type in "patterns" help
- document to first heal before running borg recreate to re-chunk stuff,
because that will have to get rid of chunks_healthy metadata.
- more than 23 is not supported for CHUNK_MAX_EXP, #3115
- borg does not respect nodump flag by default any more
- clarify same-filesystem requirement for borg upgrade, #2083
- update / rephrase cygwin / WSL status, #3174
- improve docs about --stats, #3260
- vagrant: openindiana new clang package
Already contained in 1.1.1 (last minute fix):
- arg parsing: fix fallback function, refactor, #3205. This is a fixup
for #3155, which was broken on at least python <= 3.4.2.
Version 1.1.1 (2017-10-22)
--------------------------
Compatibility notes:
- The deprecated --no-files-cache is not a global/common option any more,
but only available for borg create (it is not needed for anything else).
Use --files-cache=disabled instead of --no-files-cache.
- The nodump flag ("do not backup this file") is not honoured any more by
default because this functionality (esp. if it happened by error or
unexpected) was rather confusing and unexplainable at first to users.
If you want that "do not backup NODUMP-flagged files" behaviour, use:
borg create --exclude-nodump ...
- If you are on Linux and do not need bsdflags archived, consider using
``--nobsdflags`` with ``borg create`` to avoid additional syscalls and
speed up backup creation.
Fixes:
- borg recreate: correctly compute part file sizes. fixes cosmetic, but
annoying issue as borg check complains about size inconsistencies of part
files in affected archives. you can solve that by running borg recreate on
these archives, see also #3157.
- bsdflags support: do not open BLK/CHR/LNK files, avoid crashes and
slowness, #3130
- recreate: don't crash on attic archives w/o time_end, #3109
- don't crash on repository filesystems w/o hardlink support, #3107
- don't crash in first part of truncate_and_unlink, #3117
- fix server-side IndexError crash with clients < 1.0.7, #3192
- don't show traceback if only a global option is given, show help, #3142
- cache: use SaveFile for more safety, #3158
- init: fix wrong encryption choices in command line parser, fix missing
"authenticated-blake2", #3103
- move --no-files-cache from common to borg create options, #3146
- fix detection of non-local path (failed on ..filename), #3108
- logging with fileConfig: set json attr on "borg" logger, #3114
- fix crash with relative BORG_KEY_FILE, #3197
- show excluded dir with "x" for tagged dirs / caches, #3189
New features:
- create: --nobsdflags and --exclude-nodump options, #3160
- extract: --nobsdflags option, #3160
Other changes:
- remove annoying hardlinked symlinks warning, #3175
- vagrant: use self-made FreeBSD 10.3 box, #3022
- travis: don't brew update, hopefully fixes #2532
- docs:
- readme: -e option is required in borg 1.1
- add example showing --show-version --show-rc
- use --format rather than --list-format (deprecated) in example
- update docs about hardlinked symlinks limitation
Version 1.1.0 (2017-10-07)
--------------------------
Compatibility notes:
- borg command line: do not put options in between positional arguments
This sometimes works (e.g. it worked in borg 1.0.x), but can easily stop
working if we make positional arguments optional (like it happened for
borg create's "paths" argument in 1.1). There are also places in borg 1.0
where we do that, so it doesn't work there in general either. #3356
Good: borg create -v --stats repo::archive path
Good: borg create repo::archive path -v --stats
Bad: borg create repo::archive -v --stats path
Fixes:
- fix LD_LIBRARY_PATH restoration for subprocesses, #3077
- "auto" compression: make sure expensive compression is actually better,
otherwise store lz4 compressed data we already computed.
Other changes:
- docs:
- FAQ: we do not implement futile attempts of ETA / progress displays
- manpage: fix typos, update homepage
- implement simple "issue" role for manpage generation, #3075
Version 1.1.0rc4 (2017-10-01)
-----------------------------
Compatibility notes:
- A borg server >= 1.1.0rc4 does not support borg clients 1.1.0b3-b5. #3033
- The files cache is now controlled differently and has a new default mode:
- the files cache now uses ctime by default for improved file change
detection safety. You can still use mtime for more speed and less safety.
- --ignore-inode is deprecated (use --files-cache=... without "inode")
- --no-files-cache is deprecated (use --files-cache=disabled)
New features:
- --files-cache - implement files cache mode control, #911
You can now control the files cache mode using this option:
--files-cache={ctime,mtime,size,inode,rechunk,disabled}
(only some combinations are supported). See the docs for details.
Fixes:
- remote progress/logging: deal with partial lines, #2637
- remote progress: flush json mode output
- fix subprocess environments, #3050 (and more)
Other changes:
- remove client_supports_log_v3 flag, #3033
- exclude broken Cython 0.27(.0) in requirements, #3066
- vagrant:
- upgrade to FUSE for macOS 3.7.1
- use Python 3.5.4 to build the binaries
- docs:
- security: change-passphrase only changes the passphrase, #2990
- fixed/improved borg create --compression examples, #3034
- add note about metadata dedup and --no[ac]time, #2518
- twitter account @borgbackup now, better visible, #2948
- simplified rate limiting wrapper in FAQ
Version 1.1.0rc3 (2017-09-10)
-----------------------------
New features:
- delete: support naming multiple archives, #2958
Fixes:
- repo cleanup/write: invalidate cached FDs, #2982
- fix datetime.isoformat() microseconds issues, #2994
- recover_segment: use mmap(), lower memory needs, #2987
Other changes:
- with-lock: close segment file before invoking subprocess
- keymanager: don't depend on optional readline module, #2976
- docs:
- fix macOS keychain integration command
- show/link new screencasts in README, #2936
- document utf-8 locale requirement for json mode, #2273
- vagrant: clean up shell profile init, user name, #2977
- test_detect_attic_repo: don't test mount, #2975
- add debug logging for repository cleanup
Version 1.1.0rc2 (2017-08-28)
-----------------------------
Compatibility notes:
- list: corrected mix-up of "isomtime" and "mtime" formats. Previously,
"isomtime" was the default but produced a verbose human format,
while "mtime" produced a ISO-8601-like format.
The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like),
and the default is now "mtime".
"isomtime" is now a real ISO-8601 format ("T" between date and time, not a space).
New features:
- None.
Fixes:
- list: fix weird mixup of mtime/isomtime
- create --timestamp: set start time, #2957
- ignore corrupt files cache, #2939
- migrate locks to child PID when daemonize is used
- fix exitcode of borg serve, #2910
- only compare contents when chunker params match, #2899
- umount: try fusermount, then try umount, #2863
Other changes:
- JSON: use a more standard ISO 8601 datetime format, #2376
- cache: write_archive_index: truncate_and_unlink on error, #2628
- detect non-upgraded Attic repositories, #1933
- delete various nogil and threading related lines
- coala / pylint related improvements
- docs:
- renew asciinema/screencasts, #669
- create: document exclusion through nodump, #2949
- minor formatting fixes
- tar: tarpipe example
- improve "with-lock" and "info" docs, #2869
- detail how to use macOS/GNOME/KDE keyrings for repo passwords, #392
- travis: only short-circuit docs-only changes for pull requests
- vagrant:
- netbsd: bash is already installed
- fix netbsd version in PKG_PATH
- add exe location to PATH when we build an exe
Version 1.1.0rc1 (2017-07-24)
-----------------------------
Compatibility notes:
- delete: removed short option for --cache-only
New features:
- support borg list repo --format {comment} {bcomment} {end}, #2081
- key import: allow reading from stdin, #2760
Fixes:
- with-lock: avoid creating segment files that might be overwritten later, #1867
- prune: fix checkpoints processing with --glob-archives
- FUSE: versions view: keep original file extension at end, #2769
- fix --last, --first: do not accept values <= 0,
fix reversed archive ordering with --last
- include testsuite data (attic.tar.gz) when installing the package
- use limited unpacker for outer key, for manifest (both security precautions),
#2174 #2175
- fix bashism in shell scripts, #2820, #2816
- cleanup endianness detection, create _endian.h,
fixes build on alpine linux, #2809
- fix crash with --no-cache-sync (give known chunk size to chunk_incref), #2853
Other changes:
- FUSE: versions view: linear numbering by archive time
- split up interval parsing from filtering for --keep-within, #2610
- add a basic .editorconfig, #2734
- use archive creation time as mtime for FUSE mount, #2834
- upgrade FUSE for macOS (osxfuse) from 3.5.8 to 3.6.3, #2706
- hashindex: speed up by replacing modulo with "if" to check for wraparound
- coala checker / pylint: fixed requirements and .coafile, more ignores
- borg upgrade: name backup directories as 'before-upgrade', #2811
- add .mailmap
- some minor changes suggested by lgtm.com
- docs:
- better explanation of the --ignore-inode option relevance, #2800
- fix openSUSE command and add openSUSE section
- simplify ssh authorized_keys file using "restrict", add legacy note, #2121
- mount: show usage of archive filters
- mount: add repository example, #2462
- info: update and add examples, #2765
- prune: include example
- improved style / formatting
- improved/fixed segments_per_dir docs
- recreate: fix wrong "remove unwanted files" example
- reference list of status chars in borg recreate --filter description
- update source-install docs about doc build dependencies, #2795
- cleanup installation docs
- file system requirements, update segs per dir
- fix checkpoints/parts reference in FAQ, #2859
- code:
- hashindex: don't pass side effect into macro
- crypto low_level: don't mutate local bytes()
- use dash_open function to open file or "-" for stdin/stdout
- archiver: argparse cleanup / refactoring
- shellpattern: add match_end arg
- tests: added some additional unit tests, some fixes, #2700 #2710
- vagrant: fix setup of cygwin, add Debian 9 "stretch"
- travis: don't perform full travis build on docs-only changes, #2531
Version 1.1.0b6 (2017-06-18)
----------------------------
Compatibility notes:
- Running "borg init" via a "borg serve --append-only" server will *not* create
an append-only repository anymore. Use "borg init --append-only" to initialize
an append-only repository.
- Repositories in the "repokey" and "repokey-blake2" modes with an empty passphrase
are now treated as unencrypted repositories for security checks (e.g.
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK).
Previously there would be no prompts nor messages if an unknown repository
in one of these modes with an empty passphrase was encountered. This would
allow an attacker to swap a repository, if one assumed that the lack of
password prompts was due to a set BORG_PASSPHRASE.
Since the "trick" does not work if BORG_PASSPHRASE is set, this does generally
not affect scripts.
- Repositories in the "authenticated" mode are now treated as the unencrypted
repositories they are.
- The client-side temporary repository cache now holds unencrypted data for better speed.
- borg init: removed the short form of --append-only (-a).
- borg upgrade: removed the short form of --inplace (-i).
New features:
- reimplemented the RepositoryCache, size-limited caching of decrypted repo
contents, integrity checked via xxh64. #2515
- reduced space usage of chunks.archive.d. Existing caches are migrated during
a cache sync. #235 #2638
- integrity checking using xxh64 for important files used by borg, #1101:
- repository: index and hints files
- cache: chunks and files caches, chunks.archive.d
- improve cache sync speed, #1729
- create: new --no-cache-sync option
- add repository mandatory feature flags infrastructure, #1806
- Verify most operations against SecurityManager. Location, manifest timestamp
and key types are now checked for almost all non-debug commands. #2487
- implement storage quotas, #2517
- serve: add --restrict-to-repository, #2589
- BORG_PASSCOMMAND: use external tool providing the key passphrase, #2573
- borg export-tar, #2519
- list: --json-lines instead of --json for archive contents, #2439
- add --debug-profile option (and also "borg debug convert-profile"), #2473
- implement --glob-archives/-a, #2448
- normalize authenticated key modes for better naming consistency:
- rename "authenticated" to "authenticated-blake2" (uses blake2b)
- implement "authenticated" mode (uses hmac-sha256)
Fixes:
- hashindex: read/write indices >2 GiB on 32bit systems, better error
reporting, #2496
- repository URLs: implement IPv6 address support and also more informative
error message when parsing fails.
- mount: check whether llfuse is installed before asking for passphrase, #2540
- mount: do pre-mount checks before opening repository, #2541
- FUSE:
- fix crash if empty (None) xattr is read, #2534
- fix read(2) caching data in metadata cache
- fix negative uid/gid crash (fix crash when mounting archives
of external drives made on cygwin), #2674
- redo ItemCache, on top of object cache
- use decrypted cache
- remove unnecessary normpaths
- serve: ignore --append-only when initializing a repository (borg init), #2501
- serve: fix incorrect type of exception_short for Errors, #2513
- fix --exclude and --exclude-from recursing into directories, #2469
- init: don't allow creating nested repositories, #2563
- --json: fix encryption[mode] not being the cmdline name
- remote: propagate Error.traceback correctly
- fix remote logging and progress, #2241
- implement --debug-topic for remote servers
- remote: restore "Remote:" prefix (as used in 1.0.x)
- rpc negotiate: enable v3 log protocol only for supported clients
- fix --progress and logging in general for remote
- fix parse_version, add tests, #2556
- repository: truncate segments (and also some other files) before unlinking, #2557
- recreate: keep timestamps as in original archive, #2384
- recreate: if single archive is not processed, exit 2
- patterns: don't recurse with ! / --exclude for pf:, #2509
- cache sync: fix n^2 behaviour in lookup_name
- extract: don't write to disk with --stdout (affected non-regular-file items), #2645
- hashindex: implement KeyError, more tests
Other changes:
- remote: show path in PathNotAllowed
- consider repokey w/o passphrase == unencrypted, #2169
- consider authenticated mode == unencrypted, #2503
- restrict key file names, #2560
- document follow_symlinks requirements, check libc, use stat and chown
with follow_symlinks=False, #2507
- support common options on the main command, #2508
- support common options on mid-level commands (e.g. borg *key* export)
- make --progress a common option
- increase DEFAULT_SEGMENTS_PER_DIR to 1000
- chunker: fix invalid use of types (function only used by tests)
- chunker: don't do uint32_t >> 32
- FUSE:
- add instrumentation (--debug and SIGUSR1/SIGINFO)
- reduced memory usage for repository mounts by lazily instantiating archives
- improved archive load times
- info: use CacheSynchronizer & HashIndex.stats_against (better performance)
- docs:
- init: document --encryption as required
- security: OpenSSL usage
- security: used implementations; note python libraries
- security: security track record of OpenSSL and msgpack
- patterns: document denial of service (regex, wildcards)
- init: note possible denial of service with "none" mode
- init: document SHA extension is supported in OpenSSL and thus SHA is
faster on AMD Ryzen than blake2b.
- book: use A4 format, new builder option format.
- book: create appendices
- data structures: explain repository compaction
- data structures: add chunk layout diagram
- data structures: integrity checking
- data structures: demingle cache and repo index
- Attic FAQ: separate section for attic stuff
- FAQ: I get an IntegrityError or similar - what now?
- FAQ: Can I use Borg on SMR hard drives?, #2252
- FAQ: specify "using inline shell scripts"
- add systemd warning regarding placeholders, #2543
- xattr: document API
- add docs/misc/borg-data-flow data flow chart
- debugging facilities
- README: how to help the project, #2550
- README: add bountysource badge, #2558
- fresh new theme + tweaking
- logo: vectorized (PDF and SVG) versions
- frontends: use headlines - you can link to them
- mark --pattern, --patterns-from as experimental
- highlight experimental features in online docs
- remove regex based pattern examples, #2458
- nanorst for "borg help TOPIC" and --help
- split deployment
- deployment: hosting repositories
- deployment: automated backups to a local hard drive
- development: vagrant, windows10 requirements
- development: update docs remarks
- split usage docs, #2627
- usage: avoid bash highlight, [options] instead of
- usage: add benchmark page
- helpers: truncate_and_unlink doc
- don't suggest to leak BORG_PASSPHRASE
- internals: columnize rather long ToC [webkit fixup]
internals: manifest & feature flags
- internals: more HashIndex details
- internals: fix ASCII art equations
- internals: edited obj graph related sections a bit
- internals: layers image + description
- fix way too small figures in pdf
- index: disable syntax highlight (bash)
- improve options formatting, fix accidental block quotes
- testing / checking:
- add support for using coala, #1366
- testsuite: add ArchiverCorruptionTestCase
- do not test logger name, #2504
- call setup_logging after destroying logging config
- testsuite.archiver: normalise pytest.raises vs. assert_raises
- add test for preserved intermediate folder permissions, #2477
- key: add round-trip test
- remove attic dependency of the tests, #2505
- enable remote tests on cygwin
- tests: suppress tar's future timestamp warning
- cache sync: add more refcount tests
- repository: add tests, including corruption tests
- vagrant:
- control VM cpus and pytest workers via env vars VMCPUS and XDISTN
- update cleaning workdir
- fix openbsd shell
- add OpenIndiana
- packaging:
- binaries: don't bundle libssl
- setup.py clean to remove compiled files
- fail in borg package if version metadata is very broken (setuptools_scm)
- repo / code structure:
- create borg.algorithms and borg.crypto packages
- algorithms: rename crc32 to checksums
- move patterns to module, #2469
- gitignore: complete paths for src/ excludes
- cache: extract CacheConfig class
- implement IntegrityCheckedFile + Detached variant, #2502 #1688
- introduce popen_with_error_handling to handle common user errors
Version 1.1.0b5 (2017-04-30)
----------------------------
Compatibility notes:
- BORG_HOSTNAME_IS_UNIQUE is now on by default.
- removed --compression-from feature
- recreate: add --recompress flag, unify --always-recompress and
--recompress
Fixes:
- catch exception for os.link when hardlinks are not supported, #2405
- borg rename / recreate: expand placeholders, #2386
- generic support for hardlinks (files, devices, FIFOs), #2324
- extract: also create parent dir for device files, if needed, #2358
- extract: if a hardlink master is not in the to-be-extracted subset,
the "x" status was not displayed for it, #2351
- embrace y2038 issue to support 32bit platforms: clamp timestamps to int32,
#2347
- verify_data: fix IntegrityError handling for defect chunks, #2442
- allow excluding parent and including child, #2314
Other changes:
- refactor compression decision stuff
- change global compression default to lz4 as well, to be consistent
with --compression defaults.
- placeholders: deny access to internals and other unspecified stuff
- clearer error message for unrecognized placeholder
- more clear exception if borg check does not help, #2427
- vagrant: upgrade FUSE for macOS to 3.5.8, #2346
- linux binary builds: get rid of glibc 2.13 dependency, #2430
- docs:
- placeholders: document escaping
- serve: env vars in original commands are ignored
- tell what kind of hardlinks we support
- more docs about compression
- LICENSE: use canonical formulation
("copyright holders and contributors" instead of "author")
- document borg init behaviour via append-only borg serve, #2440
- be clear about what buzhash is used for, #2390
- add hint about chunker params, #2421
- clarify borg upgrade docs, #2436
- FAQ to explain warning when running borg check --repair, #2341
- repository file system requirements, #2080
- pre-install considerations
- misc. formatting / crossref fixes
- tests:
- enhance travis setuptools_scm situation
- add extra test for the hashindex
- fix invalid param issue in benchmarks
These belong to 1.1.0b4 release, but did not make it into changelog by then:
- vagrant: increase memory for parallel testing
- lz4 compress: lower max. buffer size, exception handling
- add docstring to do_benchmark_crud
- patterns help: mention path full-match in intro
Version 1.1.0b4 (2017-03-27)
----------------------------
Compatibility notes:
- init: the --encryption argument is mandatory now (there are several choices)
- moved "borg migrate-to-repokey" to "borg key migrate-to-repokey".
- "borg change-passphrase" is deprecated, use "borg key change-passphrase"
instead.
- the --exclude-if-present option now supports tagging a folder with any
filesystem object type (file, folder, etc), instead of expecting only files
as tags, #1999
- the --keep-tag-files option has been deprecated in favor of the new
--keep-exclude-tags, to account for the change mentioned above.
- use lz4 compression by default, #2179
New features:
- JSON API to make developing frontends and automation easier
(see :ref:`json_output`)
- add JSON output to commands: `borg create/list/info --json ...`.
- add --log-json option for structured logging output.
- add JSON progress information, JSON support for confirmations (yes()).
- add two new options --pattern and --patterns-from as discussed in #1406
- new path full match pattern style (pf:) for very fast matching, #2334
- add 'debug dump-manifest' and 'debug dump-archive' commands
- add 'borg benchmark crud' command, #1788
- new 'borg delete --force --force' to delete severely corrupted archives, #1975
- info: show utilization of maximum archive size, #1452
- list: add dsize and dcsize keys, #2164
- paperkey.html: Add interactive html template for printing key backups.
- key export: add qr html export mode
- securely erase config file (which might have old encryption key), #2257
- archived file items: add size to metadata, 'borg extract' and 'borg check' do
check the file size for consistency, FUSE uses precomputed size from Item.
Fixes:
- fix remote speed regression introduced in 1.1.0b3, #2185
- fix regression handling timestamps beyond 2262 (revert bigint removal),
introduced in 1.1.0b3, #2321
- clamp (nano)second values to unproblematic range, #2304
- hashindex: rebuild hashtable if we have too little empty buckets
(performance fix), #2246
- Location regex: fix bad parsing of wrong syntax
- ignore posix_fadvise errors in repository.py, #2095
- borg rpc: use limited msgpack.Unpacker (security precaution), #2139
- Manifest: Make sure manifest timestamp is strictly monotonically increasing.
- create: handle BackupOSError on a per-path level in one spot
- create: clarify -x option / meaning of "same filesystem"
- create: don't create hard link refs to failed files
- archive check: detect and fix missing all-zero replacement chunks, #2180
- files cache: update inode number when --ignore-inode is used, #2226
- fix decompression exceptions crashing ``check --verify-data`` and others
instead of reporting integrity error, #2224 #2221
- extract: warning for unextracted big extended attributes, #2258, #2161
- mount: umount on SIGINT/^C when in foreground
- mount: handle invalid hard link refs
- mount: fix huge RAM consumption when mounting a repository (saves number of
archives * 8 MiB), #2308
- hashindex: detect mingw byte order #2073
- hashindex: fix wrong skip_hint on hashindex_set when encountering tombstones,
the regression was introduced in #1748
- fix ChunkIndex.__contains__ assertion for big-endian archs
- fix borg key/debug/benchmark crashing without subcommand, #2240
- Location: accept //servername/share/path
- correct/refactor calculation of unique/non-unique chunks
- extract: fix missing call to ProgressIndicator.finish
- prune: fix error msg, it is --keep-within, not --within
- fix "auto" compression mode bug (not compressing), #2331
- fix symlink item fs size computation, #2344
Other changes:
- remote repository: improved async exception processing, #2255 #2225
- with --compression auto,C, only use C if lz4 achieves at least 3% compression
- PatternMatcher: only normalize path once, #2338
- hashindex: separate endian-dependent defs from endian detection
- migrate-to-repokey: ask using canonical_path() as we do everywhere else.
- SyncFile: fix use of fd object after close
- make LoggedIO.close_segment reentrant
- creating a new segment: use "xb" mode, #2099
- redo key_creator, key_factory, centralise key knowledge, #2272
- add return code functions, #2199
- list: only load cache if needed
- list: files->items, clarifications
- list: add "name" key for consistency with info cmd
- ArchiveFormatter: add "start" key for compatibility with "info"
- RemoteRepository: account rx/tx bytes
- setup.py build_usage/build_man/build_api fixes
- Manifest.in: simplify, exclude .so, .dll and .orig, #2066
- FUSE: get rid of chunk accounting, st_blocks = ceil(size / blocksize).
- tests:
- help python development by testing 3.6-dev
- test for borg delete --force
- vagrant:
- freebsd: some fixes, #2067
- darwin64: use osxfuse 3.5.4 for tests / to build binaries
- darwin64: improve VM settings
- use python 3.5.3 to build binaries, #2078
- upgrade pyinstaller from 3.1.1+ to 3.2.1
- pyinstaller: use fixed AND freshly compiled bootloader, #2002
- pyinstaller: automatically builds bootloader if missing
- docs:
- create really nice man pages
- faq: mention --remote-ratelimit in bandwidth limit question
- fix caskroom link, #2299
- docs/security: reiterate that RPC in Borg does no networking
- docs/security: counter tracking, #2266
- docs/development: update merge remarks
- address SSH batch mode in docs, #2202 #2270
- add warning about running build_usage on Python >3.4, #2123
- one link per distro in the installation page
- improve --exclude-if-present and --keep-exclude-tags, #2268
- improve automated backup script in doc, #2214
- improve remote-path description
- update docs for create -C default change (lz4)
- document relative path usage, #1868
- document snapshot usage, #2178
- corrected some stuff in internals+security
- internals: move toctree to after the introduction text
- clarify metadata kind, manifest ops
- key enc: correct / clarify some stuff, link to internals/security
- datas: enc: 1.1.x mas different MACs
- datas: enc: correct factual error -- no nonce involved there.
- make internals.rst an index page and edit it a bit
- add "Cryptography in Borg" and "Remote RPC protocol security" sections
- document BORG_HOSTNAME_IS_UNIQUE, #2087
- FAQ by categories as proposed by @anarcat in #1802
- FAQ: update Which file types, attributes, etc. are *not* preserved?
- development: new branching model for git repository
- development: define "ours" merge strategy for auto-generated files
- create: move --exclude note to main doc
- create: move item flags to main doc
- fix examples using borg init without -e/--encryption
- list: don't print key listings in fat (html + man)
- remove Python API docs (were very incomplete, build problems on RTFD)
- added FAQ section about backing up root partition
Version 1.0.10 (2017-02-13)
---------------------------
Bug fixes:
- Manifest timestamps are now monotonically increasing,
this fixes issues when the system clock jumps backwards
or is set inconsistently across computers accessing the same repository, #2115
- Fixed testing regression in 1.0.10rc1 that lead to a hard dependency on
py.test >= 3.0, #2112
New features:
- "key export" can now generate a printable HTML page with both a QR code and
a human-readable "paperkey" representation (and custom text) through the
``--qr-html`` option.
The same functionality is also available through `paperkey.html `_,
which is the same HTML page generated by ``--qr-html``. It works with existing
"key export" files and key files.
Other changes:
- docs:
- language clarification - "borg create --one-file-system" option does not respect
mount points, but considers different file systems instead, #2141
- setup.py: build_api: sort file list for determinism
Version 1.1.0b3 (2017-01-15)
----------------------------
Compatibility notes:
- borg init: removed the default of "--encryption/-e", #1979
This was done so users do a informed decision about -e mode.
Bug fixes:
- borg recreate: don't rechunkify unless explicitly told so
- borg info: fixed bug when called without arguments, #1914
- borg init: fix free space check crashing if disk is full, #1821
- borg debug delete/get obj: fix wrong reference to exception
- fix processing of remote ~/ and ~user/ paths (regressed since 1.1.0b1), #1759
- posix platform module: only build / import on non-win32 platforms, #2041
New features:
- new CRC32 implementations that are much faster than the zlib one used previously, #1970
- add blake2b key modes (use blake2b as MAC). This links against system libb2,
if possible, otherwise uses bundled code
- automatically remove stale locks - set BORG_HOSTNAME_IS_UNIQUE env var
to enable stale lock killing. If set, stale locks in both cache and
repository are deleted. #562 #1253
- borg info : print general repo information, #1680
- borg check --first / --last / --sort / --prefix, #1663
- borg mount --first / --last / --sort / --prefix, #1542
- implement "health" item formatter key, #1749
- BORG_SECURITY_DIR to remember security related infos outside the cache.
Key type, location and manifest timestamp checks now survive cache
deletion. This also means that you can now delete your cache and avoid
previous warnings, since Borg can still tell it's safe.
- implement BORG_NEW_PASSPHRASE, #1768
Other changes:
- borg recreate:
- remove special-cased --dry-run
- update --help
- remove bloat: interruption blah, autocommit blah, resuming blah
- re-use existing checkpoint functionality
- archiver tests: add check_cache tool - lints refcounts
- fixed cache sync performance regression from 1.1.0b1 onwards, #1940
- syncing the cache without chunks.archive.d (see :ref:`disable_archive_chunks`)
now avoids any merges and is thus faster, #1940
- borg check --verify-data: faster due to linear on-disk-order scan
- borg debug-xxx commands removed, we use "debug xxx" subcommands now, #1627
- improve metadata handling speed
- shortcut hashindex_set by having hashindex_lookup hint about address
- improve / add progress displays, #1721
- check for index vs. segment files object count mismatch
- make RPC protocol more extensible: use named parameters.
- RemoteRepository: misc. code cleanups / refactors
- clarify cache/repository README file
- docs:
- quickstart: add a comment about other (remote) filesystems
- quickstart: only give one possible ssh url syntax, all others are
documented in usage chapter.
- mention file://
- document repo URLs / archive location
- clarify borg diff help, #980
- deployment: synthesize alternative --restrict-to-path example
- improve cache / index docs, esp. files cache docs, #1825
- document using "git merge 1.0-maint -s recursive -X rename-threshold=20%"
for avoiding troubles when merging the 1.0-maint branch into master.
- tests:
- FUSE tests: catch ENOTSUP on freebsd
- FUSE tests: test troublesome xattrs last
- fix byte range error in test, #1740
- use monkeypatch to set env vars, but only on pytest based tests.
- point XDG_*_HOME to temp dirs for tests, #1714
- remove all BORG_* env vars from the outer environment
Version 1.0.10rc1 (2017-01-29)
------------------------------
Bug fixes:
- borg serve: fix transmission data loss of pipe writes, #1268
This affects only the cygwin platform (not Linux, BSD, OS X).
- Avoid triggering an ObjectiveFS bug in xattr retrieval, #1992
- When running out of buffer memory when reading xattrs, only skip the
current file, #1993
- Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since
:ref:`the issue ` is not relevant for unencrypted repositories,
it now does nothing and prints an error, #1981.
- Fixed change-passphrase crashing with unencrypted repositories, #1978
- Fixed "borg check repo::archive" indicating success if "archive" does not exist, #1997
- borg check: print non-exit-code warning if --last or --prefix aren't fulfilled
- fix bad parsing of wrong repo location syntax
- create: don't create hard link refs to failed files,
mount: handle invalid hard link refs, #2092
- detect mingw byte order, #2073
- creating a new segment: use "xb" mode, #2099
- mount: umount on SIGINT/^C when in foreground, #2082
Other changes:
- binary: use fixed AND freshly compiled pyinstaller bootloader, #2002
- xattr: ignore empty names returned by llistxattr(2) et al
- Enable the fault handler: install handlers for the SIGSEGV, SIGFPE, SIGABRT,
SIGBUS and SIGILL signals to dump the Python traceback.
- Also print a traceback on SIGUSR2.
- borg change-passphrase: print key location (simplify making a backup of it)
- officially support Python 3.6 (setup.py: add Python 3.6 qualifier)
- tests:
- vagrant / travis / tox: add Python 3.6 based testing
- vagrant: fix openbsd repo, #2042
- vagrant: fix the freebsd64 machine, #2037 #2067
- vagrant: use python 3.5.3 to build binaries, #2078
- vagrant: use osxfuse 3.5.4 for tests / to build binaries
vagrant: improve darwin64 VM settings
- travis: fix osxfuse install (fixes OS X testing on Travis CI)
- travis: require succeeding OS X tests, #2028
- travis: use latest pythons for OS X based testing
- use pytest-xdist to parallelize testing
- fix xattr test race condition, #2047
- setup.cfg: fix pytest deprecation warning, #2050
- docs:
- language clarification - VM backup FAQ
- borg create: document how to backup stdin, #2013
- borg upgrade: fix incorrect title levels
- add CVE numbers for issues fixed in 1.0.9, #2106
- fix typos (taken from Debian package patch)
- remote: include data hexdump in "unexpected RPC data" error message
- remote: log SSH command line at debug level
- API_VERSION: use numberspaces, #2023
- remove .github from pypi package, #2051
- add pip and setuptools to requirements file, #2030
- SyncFile: fix use of fd object after close (cosmetic)
- Manifest.in: simplify, exclude \*.{so,dll,orig}, #2066
- ignore posix_fadvise errors in repository.py, #2095
(works around issues with docker on ARM)
- make LoggedIO.close_segment reentrant, avoid reentrance
Version 1.0.9 (2016-12-20)
--------------------------
Security fixes:
- A flaw in the cryptographic authentication scheme in Borg allowed an attacker
to spoof the manifest. See :ref:`tam_vuln` above for the steps you should
take.
CVE-2016-10099 was assigned to this vulnerability.
- borg check: When rebuilding the manifest (which should only be needed very rarely)
duplicate archive names would be handled on a "first come first serve" basis, allowing
an attacker to apparently replace archives.
CVE-2016-10100 was assigned to this vulnerability.
Bug fixes:
- borg check:
- rebuild manifest if it's corrupted
- skip corrupted chunks during manifest rebuild
- fix TypeError in integrity error handler, #1903, #1894
- fix location parser for archives with @ char (regression introduced in 1.0.8), #1930
- fix wrong duration/timestamps if system clock jumped during a create
- fix progress display not updating if system clock jumps backwards
- fix checkpoint interval being incorrect if system clock jumps
Other changes:
- docs:
- add python3-devel as a dependency for cygwin-based installation
- clarify extract is relative to current directory
- FAQ: fix link to changelog
- markup fixes
- tests:
- test_get\_(cache|keys)_dir: clean env state, #1897
- get back pytest's pretty assertion failures, #1938
- setup.py build_usage:
- fixed build_usage not processing all commands
- fixed build_usage not generating includes for debug commands
Version 1.0.9rc1 (2016-11-27)
-----------------------------
Bug fixes:
- files cache: fix determination of newest mtime in backup set (which is
used in cache cleanup and led to wrong "A" [added] status for unchanged
files in next backup), #1860.
- borg check:
- fix incorrectly reporting attic 0.13 and earlier archives as corrupt
- handle repo w/o objects gracefully and also bail out early if repo is
*completely* empty, #1815.
- fix tox/pybuild in 1.0-maint
- at xattr module import time, loggers are not initialized yet
New features:
- borg umount
exposed already existing umount code via the CLI api, so users can use it,
which is more consistent than using borg to mount and fusermount -u (or
umount) to un-mount, #1855.
- implement borg create --noatime --noctime, fixes #1853
Other changes:
- docs:
- display README correctly on PyPI
- improve cache / index docs, esp. files cache docs, fixes #1825
- different pattern matching for --exclude, #1779
- datetime formatting examples for {now} placeholder, #1822
- clarify passphrase mode attic repo upgrade, #1854
- clarify --umask usage, #1859
- clarify how to choose PR target branch
- clarify prune behavior for different archive contents, #1824
- fix PDF issues, add logo, fix authors, headings, TOC
- move security verification to support section
- fix links in standalone README (:ref: tags)
- add link to security contact in README
- add FAQ about security
- move fork differences to FAQ
- add more details about resource usage
- tests: skip remote tests on cygwin, #1268
- travis:
- allow OS X failures until the brew cask osxfuse issue is fixed
- caskroom osxfuse-beta gone, it's osxfuse now (3.5.3)
- vagrant:
- upgrade OSXfuse / FUSE for macOS to 3.5.3
- remove llfuse from tox.ini at a central place
- do not try to install llfuse on centos6
- fix FUSE test for darwin, #1546
- add windows virtual machine with cygwin
- Vagrantfile cleanup / code deduplication
Version 1.1.0b2 (2016-10-01)
----------------------------
Bug fixes:
- fix incorrect preservation of delete tags, leading to "object count mismatch"
on borg check, #1598. This only occurred with 1.1.0b1 (not with 1.0.x) and is
normally fixed by running another borg create/delete/prune.
- fix broken --progress for double-cell paths (e.g. CJK), #1624
- borg recreate: also catch SIGHUP
- FUSE:
- fix hardlinks in versions view, #1599
- add parameter check to ItemCache.get to make potential failures more clear
New features:
- Archiver, RemoteRepository: add --remote-ratelimit (send data)
- borg help compression, #1582
- borg check: delete chunks with integrity errors, #1575, so they can be
"repaired" immediately and maybe healed later.
- archives filters concept (refactoring/unifying older code)
- covers --first/--last/--prefix/--sort-by options
- currently used for borg list/info/delete
Other changes:
- borg check --verify-data slightly tuned (use get_many())
- change {utcnow} and {now} to ISO-8601 format ("T" date/time separator)
- repo check: log transaction IDs, improve object count mismatch diagnostic
- Vagrantfile: use TW's fresh-bootloader pyinstaller branch
- fix module names in api.rst
- hashindex: bump api_version
Version 1.1.0b1 (2016-08-28)
----------------------------
New features:
- new commands:
- borg recreate: re-create existing archives, #787 #686 #630 #70, also see
#757, #770.
- selectively remove files/dirs from old archives
- re-compress data
- re-chunkify data, e.g. to have upgraded Attic / Borg 0.xx archives
deduplicate with Borg 1.x archives or to experiment with chunker-params.
- borg diff: show differences between archives
- borg with-lock: execute a command with the repository locked, #990
- borg create:
- Flexible compression with pattern matching on path/filename,
and LZ4 heuristic for deciding compressibility, #810, #1007
- visit files in inode order (better speed, esp. for large directories and rotating disks)
- in-file checkpoints, #1217
- increased default checkpoint interval to 30 minutes (was 5 minutes), #896
- added uuid archive format tag, #1151
- save mountpoint directories with --one-file-system, makes system restore easier, #1033
- Linux: added support for some BSD flags, #1050
- add 'x' status for excluded paths, #814
- also means files excluded via UF_NODUMP, #1080
- borg check:
- will not produce the "Checking segments" output unless new --progress option is passed, #824.
- --verify-data to verify data cryptographically on the client, #975
- borg list, #751, #1179
- removed {formatkeys}, see "borg list --help"
- --list-format is deprecated, use --format instead
- --format now also applies to listing archives, not only archive contents, #1179
- now supports the usual [PATH [PATHS…]] syntax and excludes
- new keys: csize, num_chunks, unique_chunks, NUL
- supports guaranteed_available hashlib hashes
(to avoid varying functionality depending on environment),
which includes the SHA1 and SHA2 family as well as MD5
- borg prune:
- to better visualize the "thinning out", we now list all archives in
reverse time order. rephrase and reorder help text.
- implement --keep-last N via --keep-secondly N, also --keep-minutely.
assuming that there is not more than 1 backup archive made in 1s,
--keep-last N and --keep-secondly N are equivalent, #537
- cleanup checkpoints except the latest, #1008
- borg extract:
- added --progress, #1449
- Linux: limited support for BSD flags, #1050
- borg info:
- output is now more similar to borg create --stats, #977
- borg mount:
- provide "borgfs" wrapper for borg mount, enables usage via fstab, #743
- "versions" mount option - when used with a repository mount, this gives
a merged, versioned view of the files in all archives, #729
- repository:
- added progress information to commit/compaction phase (often takes some time when deleting/pruning), #1519
- automatic recovery for some forms of repository inconsistency, #858
- check free space before going forward with a commit, #1336
- improved write performance (esp. for rotating media), #985
- new IO code for Linux
- raised default segment size to approx 512 MiB
- improved compaction performance, #1041
- reduced client CPU load and improved performance for remote repositories, #940
- options that imply output (--show-rc, --show-version, --list, --stats,
--progress) don't need -v/--info to have that output displayed, #865
- add archive comments (via borg (re)create --comment), #842
- borg list/prune/delete: also output archive id, #731
- --show-version: shows/logs the borg version, #725
- added --debug-topic for granular debug logging, #1447
- use atomic file writing/updating for configuration and key files, #1377
- BORG_KEY_FILE environment variable, #1001
- self-testing module, #970
Bug fixes:
- list: fixed default output being produced if --format is given with empty parameter, #1489
- create: fixed overflowing progress line with CJK and similar characters, #1051
- prune: fixed crash if --prefix resulted in no matches, #1029
- init: clean up partial repo if passphrase input is aborted, #850
- info: quote cmdline arguments that have spaces in them
- fix hardlinks failing in some cases for extracting subtrees, #761
Other changes:
- replace stdlib hmac with OpenSSL, zero-copy decrypt (10-15% increase in
performance of hash-lists and extract).
- improved chunker performance, #1021
- open repository segment files in exclusive mode (fail-safe), #1134
- improved error logging, #1440
- Source:
- pass meta-data around, #765
- move some constants to new constants module
- better readability and fewer errors with namedtuples, #823
- moved source tree into src/ subdirectory, #1016
- made borg.platform a package, #1113
- removed dead crypto code, #1032
- improved and ported parts of the test suite to py.test, #912
- created data classes instead of passing dictionaries around, #981, #1158, #1161
- cleaned up imports, #1112
- Docs:
- better help texts and sphinx reproduction of usage help:
- Group options
- Nicer list of options in Sphinx
- Deduplicate 'Common options' (including --help)
- chunker: added some insights by "Voltara", #903
- clarify what "deduplicated size" means
- fix / update / add package list entries
- added a SaltStack usage example, #956
- expanded FAQ
- new contributors in AUTHORS!
- Tests:
- vagrant: add ubuntu/xenial 64bit - this box has still some issues
- ChunkBuffer: add test for leaving partial chunk in buffer, fixes #945
Version 1.0.8 (2016-10-29)
--------------------------
Bug fixes:
- RemoteRepository: Fix busy wait in call_many, #940
New features:
- implement borgmajor/borgminor/borgpatch placeholders, #1694
{borgversion} was already there (full version string). With the new
placeholders you can now also get e.g. 1 or 1.0 or 1.0.8.
Other changes:
- avoid previous_location mismatch, #1741
due to the changed canonicalization for relative paths in PR #1711 / #1655
(implement /./ relpath hack), there would be a changed repo location warning
and the user would be asked if this is ok. this would break automation and
require manual intervention, which is unwanted.
thus, we automatically fix the previous_location config entry, if it only
changed in the expected way, but still means the same location.
- docs:
- deployment.rst: do not use bare variables in ansible snippet
- add clarification about append-only mode, #1689
- setup.py: add comment about requiring llfuse, #1726
- update usage.rst / api.rst
- repo url / archive location docs + typo fix
- quickstart: add a comment about other (remote) filesystems
- vagrant / tests:
- no chown when rsyncing (fixes boxes w/o vagrant group)
- fix FUSE permission issues on linux/freebsd, #1544
- skip FUSE test for borg binary + fakeroot
- ignore security.selinux xattrs, fixes tests on centos, #1735
Version 1.0.8rc1 (2016-10-17)
-----------------------------
Bug fixes:
- fix signal handling (SIGINT, SIGTERM, SIGHUP), #1620 #1593
Fixes e.g. leftover lock files for quickly repeated signals (e.g. Ctrl-C
Ctrl-C) or lost connections or systemd sending SIGHUP.
- progress display: adapt formatting to narrow screens, do not crash, #1628
- borg create --read-special - fix crash on broken symlink, #1584.
also correctly processes broken symlinks. before this regressed to a crash
(5b45385) a broken symlink would've been skipped.
- process_symlink: fix missing backup_io()
Fixes a chmod/chown/chgrp/unlink/rename/... crash race between getting
dirents and dispatching to process_symlink.
- yes(): abort on wrong answers, saying so, #1622
- fixed exception borg serve raised when connection was closed before reposiory
was openend. add an error message for this.
- fix read-from-closed-FD issue, #1551
(this seems not to get triggered in 1.0.x, but was discovered in master)
- hashindex: fix iterators (always raise StopIteration when exhausted)
(this seems not to get triggered in 1.0.x, but was discovered in master)
- enable relative paths in ssh:// repo URLs, via /./relpath hack, #1655
- allow repo paths with colons, #1705
- update changed repo location immediately after acceptance, #1524
- fix debug get-obj / delete-obj crash if object not found and remote repo,
#1684
- pyinstaller: use a spec file to build borg.exe binary, exclude osxfuse dylib
on Mac OS X (avoids mismatch lib <-> driver), #1619
New features:
- add "borg key export" / "borg key import" commands, #1555, so users are able
to backup / restore their encryption keys more easily.
Supported formats are the keyfile format used by borg internally and a
special "paper" format with by line checksums for printed backups. For the
paper format, the import is an interactive process which checks each line as
soon as it is input.
- add "borg debug-refcount-obj" to determine a repo objects' referrer counts,
#1352
Other changes:
- add "borg debug ..." subcommands
(borg debug-* still works, but will be removed in borg 1.1)
- setup.py: Add subcommand support to build_usage.
- remote: change exception message for unexpected RPC data format to indicate
dataflow direction.
- improved messages / error reporting:
- IntegrityError: add placeholder for message, so that the message we give
appears not only in the traceback, but also in the (short) error message,
#1572
- borg.key: include chunk id in exception msgs, #1571
- better messages for cache newer than repo, #1700
- vagrant (testing/build VMs):
- upgrade OSXfuse / FUSE for macOS to 3.5.2
- update Debian Wheezy boxes, #1686
- openbsd / netbsd: use own boxes, fixes misc rsync installation and
FUSE/llfuse related testing issues, #1695 #1696 #1670 #1671 #1728
- docs:
- add docs for "key export" and "key import" commands, #1641
- fix inconsistency in FAQ (pv-wrapper).
- fix second block in "Easy to use" section not showing on GitHub, #1576
- add bestpractices badge
- link reference docs and faq about BORG_FILES_CACHE_TTL, #1561
- improve borg info --help, explain size infos, #1532
- add release signing key / security contact to README, #1560
- add contribution guidelines for developers
- development.rst: add sphinx_rtd_theme to the sphinx install command
- adjust border color in borg.css
- add debug-info usage help file
- internals.rst: fix typos
- setup.py: fix build_usage to always process all commands
- added docs explaining multiple --restrict-to-path flags, #1602
- add more specific warning about write-access debug commands, #1587
- clarify FAQ regarding backup of virtual machines, #1672
- tests:
- work around FUSE xattr test issue with recent fakeroot
- simplify repo/hashindex tests
- travis: test FUSE-enabled borg, use trusty to have a recent FUSE
- re-enable FUSE tests for RemoteArchiver (no deadlocks any more)
- clean env for pytest based tests, #1714
- fuse_mount contextmanager: accept any options
Version 1.0.7 (2016-08-19)
--------------------------
Security fixes:
- borg serve: fix security issue with remote repository access, #1428
If you used e.g. --restrict-to-path /path/client1/ (with or without trailing
slash does not make a difference), it acted like a path prefix match using
/path/client1 (note the missing trailing slash) - the code then also allowed
working in e.g. /path/client13 or /path/client1000.
As this could accidentally lead to major security/privacy issues depending on
the paths you use, the behaviour was changed to be a strict directory match.
That means --restrict-to-path /path/client1 (with or without trailing slash
does not make a difference) now uses /path/client1/ internally (note the
trailing slash here!) for matching and allows precisely that path AND any
path below it. So, /path/client1 is allowed, /path/client1/repo1 is allowed,
but not /path/client13 or /path/client1000.
If you willingly used the undocumented (dangerous) previous behaviour, you
may need to rearrange your --restrict-to-path paths now. We are sorry if
that causes work for you, but we did not want a potentially dangerous
behaviour in the software (not even using a for-backwards-compat option).
Bug fixes:
- fixed repeated LockTimeout exceptions when borg serve tried to write into
a already write-locked repo (e.g. by a borg mount), #502 part b)
This was solved by the fix for #1220 in 1.0.7rc1 already.
- fix cosmetics + file leftover for "not a valid borg repository", #1490
- Cache: release lock if cache is invalid, #1501
- borg extract --strip-components: fix leak of preloaded chunk contents
- Repository, when a InvalidRepository exception happens:
- fix spurious, empty lock.roster
- fix repo not closed cleanly
New features:
- implement borg debug-info, fixes #1122
(just calls already existing code via cli, same output as below tracebacks)
Other changes:
- skip the O_NOATIME test on GNU Hurd, fixes #1315
(this is a very minor issue and the GNU Hurd project knows the bug)
- document using a clean repo to test / build the release
Version 1.0.7rc2 (2016-08-13)
-----------------------------
Bug fixes:
- do not write objects to repository that are bigger than the allowed size,
borg will reject reading them, #1451.
Important: if you created archives with many millions of files or
directories, please verify if you can open them successfully,
e.g. try a "borg list REPO::ARCHIVE".
- lz4 compression: dynamically enlarge the (de)compression buffer, the static
buffer was not big enough for archives with extremely many items, #1453
- larger item metadata stream chunks, raise archive item limit by 8x, #1452
- fix untracked segments made by moved DELETEs, #1442
Impact: Previously (metadata) segments could become untracked when deleting data,
these would never be cleaned up.
- extended attributes (xattrs) related fixes:
- fixed a race condition in xattrs querying that led to the entire file not
being backed up (while logging the error, exit code = 1), #1469
- fixed a race condition in xattrs querying that led to a crash, #1462
- raise OSError including the error message derived from errno, deal with
path being a integer FD
Other changes:
- print active env var override by default, #1467
- xattr module: refactor code, deduplicate, clean up
- repository: split object size check into too small and too big
- add a transaction_id assertion, so borg init on a broken (inconsistent)
filesystem does not look like a coding error in borg, but points to the
real problem.
- explain confusing TypeError caused by compat support for old servers, #1456
- add forgotten usage help file from build_usage
- refactor/unify buffer code into helpers.Buffer class, add tests
- docs:
- document archive limitation, #1452
- improve prune examples
Version 1.0.7rc1 (2016-08-05)
-----------------------------
Bug fixes:
- fix repo lock deadlocks (related to lock upgrade), #1220
- catch unpacker exceptions, resync, #1351
- fix borg break-lock ignoring BORG_REPO env var, #1324
- files cache performance fixes (fixes unnecessary re-reading/chunking/
hashing of unmodified files for some use cases):
- fix unintended file cache eviction, #1430
- implement BORG_FILES_CACHE_TTL, update FAQ, raise default TTL from 10
to 20, #1338
- FUSE:
- cache partially read data chunks (performance), #965, #966
- always create a root dir, #1125
- use an OrderedDict for helptext, making the build reproducible, #1346
- RemoteRepository init: always call close on exceptions, #1370 (cosmetic)
- ignore stdout/stderr broken pipe errors (cosmetic), #1116
New features:
- better borg versions management support (useful esp. for borg servers
wanting to offer multiple borg versions and for clients wanting to choose
a specific server borg version), #1392:
- add BORG_VERSION environment variable before executing "borg serve" via ssh
- add new placeholder {borgversion}
- substitute placeholders in --remote-path
- borg init --append-only option (makes using the more secure append-only mode
more convenient. when used remotely, this requires 1.0.7+ also on the borg
server), #1291.
Other changes:
- Vagrantfile:
- darwin64: upgrade to FUSE for macOS 3.4.1 (aka osxfuse), #1378
- xenial64: use user "ubuntu", not "vagrant" (as usual), #1331
- tests:
- fix FUSE tests on OS X, #1433
- docs:
- FAQ: add backup using stable filesystem names recommendation
- FAQ about glibc compatibility added, #491, glibc-check improved
- FAQ: 'A' unchanged file; remove ambiguous entry age sentence.
- OS X: install pkg-config to build with FUSE support, fixes #1400
- add notes about shell/sudo pitfalls with env. vars, #1380
- added platform feature matrix
- implement borg debug-dump-repo-objs
Version 1.0.6 (2016-07-12)
--------------------------
Bug fixes:
- Linux: handle multiple LD_PRELOAD entries correctly, #1314, #1111
- Fix crash with unclear message if the libc is not found, #1314, #1111
Other changes:
- tests:
- Fixed O_NOATIME tests for Solaris and GNU Hurd, #1315
- Fixed sparse file tests for (file) systems not supporting it, #1310
- docs:
- Fixed syntax highlighting, #1313
- misc docs: added data processing overview picture
Version 1.0.6rc1 (2016-07-10)
-----------------------------
New features:
- borg check --repair: heal damaged files if missing chunks re-appear (e.g. if
the previously missing chunk was added again in a later backup archive),
#148. (*) Also improved logging.
Bug fixes:
- sync_dir: silence fsync() failing with EINVAL, #1287
Some network filesystems (like smbfs) don't support this and we use this in
repository code.
- borg mount (FUSE):
- fix directories being shadowed when contained paths were also specified,
#1295
- raise I/O Error (EIO) on damaged files (unless -o allow_damaged_files is
used), #1302. (*)
- borg extract: warn if a damaged file is extracted, #1299. (*)
- Added some missing return code checks (ChunkIndex._add, hashindex_resize).
- borg check: fix/optimize initial hash table size, avoids resize of the table.
Other changes:
- tests:
- add more FUSE tests, #1284
- deduplicate FUSE (u)mount code
- fix borg binary test issues, #862
- docs:
- changelog: added release dates to older borg releases
- fix some sphinx (docs generator) warnings, #881
Notes:
(*) Some features depend on information (chunks_healthy list) added to item
metadata when a file with missing chunks was "repaired" using all-zero
replacement chunks. The chunks_healthy list is generated since borg 1.0.4,
thus borg can't recognize such "repaired" (but content-damaged) files if the
repair was done with an older borg version.
Version 1.0.5 (2016-07-07)
--------------------------
Bug fixes:
- borg mount: fix FUSE crash in xattr code on Linux introduced in 1.0.4, #1282
Other changes:
- backport some FAQ entries from master branch
- add release helper scripts
- Vagrantfile:
- centos6: no FUSE, don't build binary
- add xz for redhat-like dists
Version 1.0.4 (2016-07-07)
--------------------------
New features:
- borg serve --append-only, #1168
This was included because it was a simple change (append-only functionality
was already present via repository config file) and makes better security now
practically usable.
- BORG_REMOTE_PATH environment variable, #1258
This was included because it was a simple change (--remote-path cli option
was already present) and makes borg much easier to use if you need it.
- Repository: cleanup incomplete transaction on "no space left" condition.
In many cases, this can avoid a 100% full repo filesystem (which is very
problematic as borg always needs free space - even to delete archives).
Bug fixes:
- Fix wrong handling and reporting of OSErrors in borg create, #1138.
This was a serious issue: in the context of "borg create", errors like
repository I/O errors (e.g. disk I/O errors, ssh repo connection errors)
were handled badly and did not lead to a crash (which would be good for this
case, because the repo transaction would be incomplete and trigger a
transaction rollback to clean up).
Now, error handling for source files is cleanly separated from every other
error handling, so only problematic input files are logged and skipped.
- Implement fail-safe error handling for borg extract.
Note that this isn't nearly as critical as the borg create error handling
bug, since nothing is written to the repo. So this was "merely" misleading
error reporting.
- Add missing error handler in directory attr restore loop.
- repo: make sure write data hits disk before the commit tag (#1236) and also
sync the containing directory.
- FUSE: getxattr fail must use errno.ENOATTR, #1126
(fixes Mac OS X Finder malfunction: "zero bytes" file length, access denied)
- borg check --repair: do not lose information about the good/original chunks.
If we do not lose the original chunk IDs list when "repairing" a file
(replacing missing chunks with all-zero chunks), we have a chance to "heal"
the file back into its original state later, in case the chunks re-appear
(e.g. in a fresh backup). Healing is not implemented yet, see #148.
- fixes for --read-special mode:
- ignore known files cache, #1241
- fake regular file mode, #1214
- improve symlinks handling, #1215
- remove passphrase from subprocess environment, #1105
- Ignore empty index file (will trigger index rebuild), #1195
- add missing placeholder support for --prefix, #1027
- improve exception handling for placeholder replacement
- catch and format exceptions in arg parsing
- helpers: fix "undefined name 'e'" in exception handler
- better error handling for missing repo manifest, #1043
- borg delete:
- make it possible to delete a repo without manifest
- borg delete --forced allows to delete corrupted archives, #1139
- borg check:
- make borg check work for empty repo
- fix resync and msgpacked item qualifier, #1135
- rebuild_manifest: fix crash if 'name' or 'time' key were missing.
- better validation of item metadata dicts, #1130
- better validation of archive metadata dicts
- close the repo on exit - even if rollback did not work, #1197.
This is rather cosmetic, it avoids repo closing in the destructor.
- tests:
- fix sparse file test, #1170
- flake8: ignore new F405, #1185
- catch "invalid argument" on cygwin, #257
- fix sparseness assertion in test prep, #1264
Other changes:
- make borg build/work on OpenSSL 1.0 and 1.1, #1187
- docs / help:
- fix / clarify prune help, #1143
- fix "patterns" help formatting
- add missing docs / help about placeholders
- resources: rename atticmatic to borgmatic
- document sshd settings, #545
- more details about checkpoints, add split trick, #1171
- support docs: add freenode web chat link, #1175
- add prune visualization / example, #723
- add note that Fnmatch is default, #1247
- make clear that lzma levels > 6 are a waste of cpu cycles
- add a "do not edit" note to auto-generated files, #1250
- update cygwin installation docs
- repository interoperability with borg master (1.1dev) branch:
- borg check: read item metadata keys from manifest, #1147
- read v2 hints files, #1235
- fix hints file "unknown version" error handling bug
- tests: add tests for format_line
- llfuse: update version requirement for freebsd
- Vagrantfile:
- use openbsd 5.9, #716
- do not install llfuse on netbsd (broken)
- update OSXfuse to version 3.3.3
- use Python 3.5.2 to build the binaries
- glibc compatibility checker: scripts/glibc_check.py
- add .eggs to .gitignore
Version 1.0.3 (2016-05-20)
--------------------------
Bug fixes:
- prune: avoid that checkpoints are kept and completed archives are deleted in
a prune run), #997
- prune: fix commandline argument validation - some valid command lines were
considered invalid (annoying, but harmless), #942
- fix capabilities extraction on Linux (set xattrs last, after chown()), #1069
- repository: fix commit tags being seen in data
- when probing key files, do binary reads. avoids crash when non-borg binary
files are located in borg's key files directory.
- handle SIGTERM and make a clean exit - avoids orphan lock files.
- repository cache: don't cache large objects (avoid using lots of temp. disk
space), #1063
Other changes:
- Vagrantfile: OS X: update osxfuse / install lzma package, #933
- setup.py: add check for platform_darwin.c
- setup.py: on freebsd, use a llfuse release that builds ok
- docs / help:
- update readthedocs URLs, #991
- add missing docs for "borg break-lock", #992
- borg create help: add some words to about the archive name
- borg create help: document format tags, #894
Version 1.0.2 (2016-04-16)
--------------------------
Bug fixes:
- fix malfunction and potential corruption on (nowadays rather rare) big-endian
architectures or bi-endian archs in (rare) BE mode. #886, #889
cache resync / index merge was malfunctioning due to this, potentially
leading to data loss. borg info had cosmetic issues (displayed wrong values).
note: all (widespread) little-endian archs (like x86/x64) or bi-endian archs
in (widespread) LE mode (like ARMEL, MIPSEL, ...) were NOT affected.
- add overflow and range checks for 1st (special) uint32 of the hashindex
values, switch from int32 to uint32.
- fix so that refcount will never overflow, but just stick to max. value after
a overflow would have occurred.
- borg delete: fix --cache-only for broken caches, #874
Makes --cache-only idempotent: it won't fail if the cache is already deleted.
- fixed borg create --one-file-system erroneously traversing into other
filesystems (if starting fs device number was 0), #873
- workround a bug in Linux fadvise FADV_DONTNEED, #907
Other changes:
- better test coverage for hashindex, incl. overflow testing, checking correct
computations so endianness issues would be discovered.
- reproducible doc for ProgressIndicator*, make the build reproducible.
- use latest llfuse for vagrant machines
- docs:
- use /path/to/repo in examples, fixes #901
- fix confusing usage of "repo" as archive name (use "arch")
Version 1.0.1 (2016-04-08)
--------------------------
New features:
Usually there are no new features in a bugfix release, but these were added
due to their high impact on security/safety/speed or because they are fixes
also:
- append-only mode for repositories, #809, #36 (see docs)
- borg create: add --ignore-inode option to make borg detect unmodified files
even if your filesystem does not have stable inode numbers (like sshfs and
possibly CIFS).
- add options --warning, --error, --critical for missing log levels, #826.
it's not recommended to suppress warnings or errors, but the user may decide
this on his own.
note: --warning is not given to borg serve so a <= 1.0.0 borg will still
work as server (it is not needed as it is the default).
do not use --error or --critical when using a <= 1.0.0 borg server.
Bug fixes:
- fix silently skipping EIO, #748
- add context manager for Repository (avoid orphan repository locks), #285
- do not sleep for >60s while waiting for lock, #773
- unpack file stats before passing to FUSE
- fix build on illumos
- don't try to backup doors or event ports (Solaris and derivates)
- remove useless/misleading libc version display, #738
- test suite: reset exit code of persistent archiver, #844
- RemoteRepository: clean up pipe if remote open() fails
- Remote: don't print tracebacks for Error exceptions handled downstream, #792
- if BORG_PASSPHRASE is present but wrong, don't prompt for password, but fail
instead, #791
- ArchiveChecker: move "orphaned objects check skipped" to INFO log level, #826
- fix capitalization, add ellipses, change log level to debug for 2 messages,
#798
Other changes:
- update llfuse requirement, llfuse 1.0 works
- update OS / dist packages on build machines, #717
- prefer showing --info over -v in usage help, #859
- docs:
- fix cygwin requirements (gcc-g++)
- document how to debug / file filesystem issues, #664
- fix reproducible build of api docs
- RTD theme: CSS !important overwrite, #727
- Document logo font. Recreate logo png. Remove GIMP logo file.
Version 1.0.0 (2016-03-05)
--------------------------
The major release number change (0.x -> 1.x) indicates bigger incompatible
changes, please read the compatibility notes, adapt / test your scripts and
check your backup logs.
Compatibility notes:
- drop support for python 3.2 and 3.3, require 3.4 or 3.5, #221 #65 #490
note: we provide binaries that include python 3.5.1 and everything else
needed. they are an option in case you are stuck with < 3.4 otherwise.
- change encryption to be on by default (using "repokey" mode)
- moved keyfile keys from ~/.borg/keys to ~/.config/borg/keys,
you can either move them manually or run "borg upgrade "
- remove support for --encryption=passphrase,
use borg migrate-to-repokey to switch to repokey mode, #97
- remove deprecated --compression ,
use --compression zlib, instead
in case of 0, you could also use --compression none
- remove deprecated --hourly/daily/weekly/monthly/yearly
use --keep-hourly/daily/weekly/monthly/yearly instead
- remove deprecated --do-not-cross-mountpoints,
use --one-file-system instead
- disambiguate -p option, #563:
- -p now is same as --progress
- -P now is same as --prefix
- remove deprecated "borg verify",
use "borg extract --dry-run" instead
- cleanup environment variable semantics, #355
the environment variables used to be "yes sayers" when set, this was
conceptually generalized to "automatic answerers" and they just give their
value as answer (as if you typed in that value when being asked).
See the "usage" / "Environment Variables" section of the docs for details.
- change the builtin default for --chunker-params, create 2MiB chunks, #343
--chunker-params new default: 19,23,21,4095 - old default: 10,23,16,4095
one of the biggest issues with borg < 1.0 (and also attic) was that it had a
default target chunk size of 64kiB, thus it created a lot of chunks and thus
also a huge chunk management overhead (high RAM and disk usage).
please note that the new default won't change the chunks that you already
have in your repository. the new big chunks do not deduplicate with the old
small chunks, so expect your repo to grow at least by the size of every
changed file and in the worst case (e.g. if your files cache was lost / is
not used) by the size of every file (minus any compression you might use).
in case you want to immediately see a much lower resource usage (RAM / disk)
for chunks management, it might be better to start with a new repo than
continuing in the existing repo (with an existing repo, you'ld have to wait
until all archives with small chunks got pruned to see a lower resource
usage).
if you used the old --chunker-params default value (or if you did not use
--chunker-params option at all) and you'ld like to continue using small
chunks (and you accept the huge resource usage that comes with that), just
explicitly use borg create --chunker-params=10,23,16,4095.
- archive timestamps: the 'time' timestamp now refers to archive creation
start time (was: end time), the new 'time_end' timestamp refers to archive
creation end time. This might affect prune if your backups take rather long.
if you give a timestamp via cli this is stored into 'time', therefore it now
needs to mean archive creation start time.
New features:
- implement password roundtrip, #695
Bug fixes:
- remote end does not need cache nor keys directories, do not create them, #701
- added retry counter for passwords, #703
Other changes:
- fix compiler warnings, #697
- docs:
- update README.rst to new changelog location in docs/changes.rst
- add Teemu to AUTHORS
- changes.rst: fix old chunker params, #698
- FAQ: how to limit bandwidth
Version 1.0.0rc2 (2016-02-28)
-----------------------------
New features:
- format options for location: user, pid, fqdn, hostname, now, utcnow, user
- borg list --list-format
- borg prune -v --list enables the keep/prune list output, #658
Bug fixes:
- fix _open_rb noatime handling, #657
- add a simple archivename validator, #680
- borg create --stats: show timestamps in localtime, use same labels/formatting
as borg info, #651
- llfuse compatibility fixes (now compatible with: 0.40, 0.41, 0.42)
Other changes:
- it is now possible to use "pip install borgbackup[fuse]" to automatically
install the llfuse dependency using the correct version requirement
for it. you still need to care about having installed the FUSE / build
related OS package first, though, so that building llfuse can succeed.
- Vagrant: drop Ubuntu Precise (12.04) - does not have Python >= 3.4
- Vagrant: use pyinstaller v3.1.1 to build binaries
- docs:
- borg upgrade: add to docs that only LOCAL repos are supported
- borg upgrade also handles borg 0.xx -> 1.0
- use pip extras or requirements file to install llfuse
- fix order in release process
- updated usage docs and other minor / cosmetic fixes
- verified borg examples in docs, #644
- freebsd dependency installation and FUSE configuration, #649
- add example how to restore a raw device, #671
- add a hint about the dev headers needed when installing from source
- add examples for delete (and handle delete after list, before prune), #656
- update example for borg create -v --stats (use iso datetime format), #663
- added example to BORG_RSH docs
- "connection closed by remote": add FAQ entry and point to issue #636
Version 1.0.0rc1 (2016-02-07)
-----------------------------
New features:
- borg migrate-to-repokey ("passphrase" -> "repokey" encryption key mode)
- implement --short for borg list REPO, #611
- implement --list for borg extract (consistency with borg create)
- borg serve: overwrite client's --restrict-to-path with ssh forced command's
option value (but keep everything else from the client commandline), #544
- use $XDG_CONFIG_HOME/keys for keyfile keys (~/.config/borg/keys), #515
- "borg upgrade" moves the keyfile keys to the new location
- display both archive creation start and end time in "borg info", #627
Bug fixes:
- normalize trailing slashes for the repository path, #606
- Cache: fix exception handling in __init__, release lock, #610
Other changes:
- suppress unneeded exception context (PEP 409), simpler tracebacks
- removed special code needed to deal with imperfections / incompatibilities /
missing stuff in py 3.2/3.3, simplify code that can be done simpler in 3.4
- removed some version requirements that were kept on old versions because
newer did not support py 3.2 any more
- use some py 3.4+ stdlib code instead of own/openssl/pypi code:
- use os.urandom instead of own cython openssl RAND_bytes wrapper, #493
- use hashlib.pbkdf2_hmac from py stdlib instead of own openssl wrapper
- use hmac.compare_digest instead of == operator (constant time comparison)
- use stat.filemode instead of homegrown code
- use "mock" library from stdlib, #145
- remove borg.support (with non-broken argparse copy), it is ok in 3.4+, #358
- Vagrant: copy CHANGES.rst as symlink, #592
- cosmetic code cleanups, add flake8 to tox/travis, #4
- docs / help:
- make "borg -h" output prettier, #591
- slightly rephrase prune help
- add missing example for --list option of borg create
- quote exclude line that includes an asterisk to prevent shell expansion
- fix dead link to license
- delete Ubuntu Vivid, it is not supported anymore (EOL)
- OS X binary does not work for older OS X releases, #629
- borg serve's special support for forced/original ssh commands, #544
- misc. updates and fixes
Version 0.30.0 (2016-01-23)
---------------------------
Compatibility notes:
- you may need to use -v (or --info) more often to actually see output emitted
at INFO log level (because it is suppressed at the default WARNING log level).
See the "general" section in the usage docs.
- for borg create, you need --list (additionally to -v) to see the long file
list (was needed so you can have e.g. --stats alone without the long list)
- see below about BORG_DELETE_I_KNOW_WHAT_I_AM_DOING (was:
BORG_CHECK_I_KNOW_WHAT_I_AM_DOING)
Bug fixes:
- fix crash when using borg create --dry-run --keep-tag-files, #570
- make sure teardown with cleanup happens for Cache and RepositoryCache,
avoiding leftover locks and TEMP dir contents, #285 (partially), #548
- fix locking KeyError, partial fix for #502
- log stats consistently, #526
- add abbreviated weekday to timestamp format, fixes #496
- strip whitespace when loading exclusions from file
- unset LD_LIBRARY_PATH before invoking ssh, fixes strange OpenSSL library
version warning when using the borg binary, #514
- add some error handling/fallback for C library loading, #494
- added BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for check in "borg delete", #503
- remove unused "repair" rpc method name
New features:
- borg create: implement exclusions using regular expression patterns.
- borg create: implement inclusions using patterns.
- borg extract: support patterns, #361
- support different styles for patterns:
- fnmatch (`fm:` prefix, default when omitted), like borg <= 0.29.
- shell (`sh:` prefix) with `*` not matching directory separators and
`**/` matching 0..n directories
- path prefix (`pp:` prefix, for unifying borg create pp1 pp2 into the
patterns system), semantics like in borg <= 0.29
- regular expression (`re:`), new!
- --progress option for borg upgrade (#291) and borg delete
- update progress indication more often (e.g. for borg create within big
files or for borg check repo), #500
- finer chunker granularity for items metadata stream, #547, #487
- borg create --list now used (additionally to -v) to enable the verbose
file list output
- display borg version below tracebacks, #532
Other changes:
- hashtable size (and thus: RAM and disk consumption) follows a growth policy:
grows fast while small, grows slower when getting bigger, #527
- Vagrantfile: use pyinstaller 3.1 to build binaries, freebsd sqlite3 fix,
fixes #569
- no separate binaries for centos6 any more because the generic linux binaries
also work on centos6 (or in general: on systems with a slightly older glibc
than debian7
- dev environment: require virtualenv<14.0 so we get a py32 compatible pip
- docs:
- add space-saving chunks.archive.d trick to FAQ
- important: clarify -v and log levels in usage -> general, please read!
- sphinx configuration: create a simple man page from usage docs
- add a repo server setup example
- disable unneeded SSH features in authorized_keys examples for security.
- borg prune only knows "--keep-within" and not "--within"
- add gource video to resources docs, #507
- add netbsd install instructions
- authors: make it more clear what refers to borg and what to attic
- document standalone binary requirements, #499
- rephrase the mailing list section
- development docs: run build_api and build_usage before tagging release
- internals docs: hash table max. load factor is 0.75 now
- markup, typo, grammar, phrasing, clarifications and other fixes.
- add gcc gcc-c++ to redhat/fedora/corora install docs, fixes #583
Version 0.29.0 (2015-12-13)
---------------------------
Compatibility notes:
- when upgrading to 0.29.0 you need to upgrade client as well as server
installations due to the locking and commandline interface changes otherwise
you'll get an error msg about a RPC protocol mismatch or a wrong commandline
option.
if you run a server that needs to support both old and new clients, it is
suggested that you have a "borg-0.28.2" and a "borg-0.29.0" command.
clients then can choose via e.g. "borg --remote-path=borg-0.29.0 ...".
- the default waiting time for a lock changed from infinity to 1 second for a
better interactive user experience. if the repo you want to access is
currently locked, borg will now terminate after 1s with an error message.
if you have scripts that shall wait for the lock for a longer time, use
--lock-wait N (with N being the maximum wait time in seconds).
Bug fixes:
- hash table tuning (better chosen hashtable load factor 0.75 and prime initial
size of 1031 gave ~1000x speedup in some scenarios)
- avoid creation of an orphan lock for one case, #285
- --keep-tag-files: fix file mode and multiple tag files in one directory, #432
- fixes for "borg upgrade" (attic repo converter), #466
- remove --progress isatty magic (and also --no-progress option) again, #476
- borg init: display proper repo URL
- fix format of umask in help pages, #463
New features:
- implement --lock-wait, support timeout for UpgradableLock, #210
- implement borg break-lock command, #157
- include system info below traceback, #324
- sane remote logging, remote stderr, #461:
- remote log output: intercept it and log it via local logging system,
with "Remote: " prefixed to message. log remote tracebacks.
- remote stderr: output it to local stderr with "Remote: " prefixed.
- add --debug and --info (same as --verbose) to set the log level of the
builtin logging configuration (which otherwise defaults to warning), #426
note: there are few messages emitted at DEBUG level currently.
- optionally configure logging via env var BORG_LOGGING_CONF
- add --filter option for status characters: e.g. to show only the added
or modified files (and also errors), use "borg create -v --filter=AME ...".
- more progress indicators, #394
- use ISO-8601 date and time format, #375
- "borg check --prefix" to restrict archive checking to that name prefix, #206
Other changes:
- hashindex_add C implementation (speed up cache re-sync for new archives)
- increase FUSE read_size to 1024 (speed up metadata operations)
- check/delete/prune --save-space: free unused segments quickly, #239
- increase rpc protocol version to 2 (see also Compatibility notes), #458
- silence borg by default (via default log level WARNING)
- get rid of C compiler warnings, #391
- upgrade OS X FUSE to 3.0.9 on the OS X binary build system
- use python 3.5.1 to build binaries
- docs:
- new mailing list borgbackup@python.org, #468
- readthedocs: color and logo improvements
- load coverage icons over SSL (avoids mixed content)
- more precise binary installation steps
- update release procedure docs about OS X FUSE
- FAQ entry about unexpected 'A' status for unchanged file(s), #403
- add docs about 'E' file status
- add "borg upgrade" docs, #464
- add developer docs about output and logging
- clarify encryption, add note about client-side encryption
- add resources section, with videos, talks, presentations, #149
- Borg moved to Arch Linux [community]
- fix wrong installation instructions for archlinux
Version 0.28.2 (2015-11-15)
---------------------------
New features:
- borg create --exclude-if-present TAGFILE - exclude directories that have the
given file from the backup. You can additionally give --keep-tag-files to
preserve just the directory roots and the tag-files (but not backup other
directory contents), #395, attic #128, attic #142
Other changes:
- do not create docs sources at build time (just have them in the repo),
completely remove have_cython() hack, do not use the "mock" library at build
time, #384
- avoid hidden import, make it easier for PyInstaller, easier fix for #218
- docs:
- add description of item flags / status output, fixes #402
- explain how to regenerate usage and API files (build_api or
build_usage) and when to commit usage files directly into git, #384
- minor install docs improvements
Version 0.28.1 (2015-11-08)
---------------------------
Bug fixes:
- do not try to build api / usage docs for production install,
fixes unexpected "mock" build dependency, #384
Other changes:
- avoid using msgpack.packb at import time
- fix formatting issue in changes.rst
- fix build on readthedocs
Version 0.28.0 (2015-11-08)
---------------------------
Compatibility notes:
- changed return codes (exit codes), see docs. in short:
old: 0 = ok, 1 = error. now: 0 = ok, 1 = warning, 2 = error
New features:
- refactor return codes (exit codes), fixes #61
- add --show-rc option enable "terminating with X status, rc N" output, fixes 58, #351
- borg create backups atime and ctime additionally to mtime, fixes #317
- extract: support atime additionally to mtime
- FUSE: support ctime and atime additionally to mtime
- support borg --version
- emit a warning if we have a slow msgpack installed
- borg list --prefix=thishostname- REPO, fixes #205
- Debug commands (do not use except if you know what you do: debug-get-obj,
debug-put-obj, debug-delete-obj, debug-dump-archive-items.
Bug fixes:
- setup.py: fix bug related to BORG_LZ4_PREFIX processing
- fix "check" for repos that have incomplete chunks, fixes #364
- borg mount: fix unlocking of repository at umount time, fixes #331
- fix reading files without touching their atime, #334
- non-ascii ACL fixes for Linux, FreeBSD and OS X, #277
- fix acl_use_local_uid_gid() and add a test for it, attic #359
- borg upgrade: do not upgrade repositories in place by default, #299
- fix cascading failure with the index conversion code, #269
- borg check: implement 'cmdline' archive metadata value decoding, #311
- fix RobustUnpacker, it missed some metadata keys (new atime and ctime keys
were missing, but also bsdflags). add check for unknown metadata keys.
- create from stdin: also save atime, ctime (cosmetic)
- use default_notty=False for confirmations, fixes #345
- vagrant: fix msgpack installation on centos, fixes #342
- deal with unicode errors for symlinks in same way as for regular files and
have a helpful warning message about how to fix wrong locale setup, fixes #382
- add ACL keys the RobustUnpacker must know about
Other changes:
- improve file size displays, more flexible size formatters
- explicitly commit to the units standard, #289
- archiver: add E status (means that an error occurred when processing this
(single) item
- do binary releases via "github releases", closes #214
- create: use -x and --one-file-system (was: --do-not-cross-mountpoints), #296
- a lot of changes related to using "logging" module and screen output, #233
- show progress display if on a tty, output more progress information, #303
- factor out status output so it is consistent, fix surrogates removal,
maybe fixes #309
- move away from RawConfigParser to ConfigParser
- archive checker: better error logging, give chunk_id and sequence numbers
(can be used together with borg debug-dump-archive-items).
- do not mention the deprecated passphrase mode
- emit a deprecation warning for --compression N (giving a just a number)
- misc .coverragerc fixes (and coverage measurement improvements), fixes #319
- refactor confirmation code, reduce code duplication, add tests
- prettier error messages, fixes #307, #57
- tests:
- add a test to find disk-full issues, #327
- travis: also run tests on Python 3.5
- travis: use tox -r so it rebuilds the tox environments
- test the generated pyinstaller-based binary by archiver unit tests, #215
- vagrant: tests: announce whether fakeroot is used or not
- vagrant: add vagrant user to fuse group for debianoid systems also
- vagrant: llfuse install on darwin needs pkgconfig installed
- vagrant: use pyinstaller from develop branch, fixes #336
- benchmarks: test create, extract, list, delete, info, check, help, fixes #146
- benchmarks: test with both the binary and the python code
- archiver tests: test with both the binary and the python code, fixes #215
- make basic test more robust
- docs:
- moved docs to borgbackup.readthedocs.org, #155
- a lot of fixes and improvements, use mobile-friendly RTD standard theme
- use zlib,6 compression in some examples, fixes #275
- add missing rename usage to docs, closes #279
- include the help offered by borg help in the usage docs, fixes #293
- include a list of major changes compared to attic into README, fixes #224
- add OS X install instructions, #197
- more details about the release process, #260
- fix linux glibc requirement (binaries built on debian7 now)
- build: move usage and API generation to setup.py
- update docs about return codes, #61
- remove api docs (too much breakage on rtd)
- borgbackup install + basics presentation (asciinema)
- describe the current style guide in documentation
- add section about debug commands
- warn about not running out of space
- add example for rename
- improve chunker params docs, fixes #362
- minor development docs update
Version 0.27.0 (2015-10-07)
---------------------------
New features:
- "borg upgrade" command - attic -> borg one time converter / migration, #21
- temporary hack to avoid using lots of disk space for chunks.archive.d, #235:
To use it: rm -rf chunks.archive.d ; touch chunks.archive.d
- respect XDG_CACHE_HOME, attic #181
- add support for arbitrary SSH commands, attic #99
- borg delete --cache-only REPO (only delete cache, not REPO), attic #123
Bug fixes:
- use Debian 7 (wheezy) to build pyinstaller borgbackup binaries, fixes slow
down observed when running the Centos6-built binary on Ubuntu, #222
- do not crash on empty lock.roster, fixes #232
- fix multiple issues with the cache config version check, #234
- fix segment entry header size check, attic #352
plus other error handling improvements / code deduplication there.
- always give segment and offset in repo IntegrityErrors
Other changes:
- stop producing binary wheels, remove docs about it, #147
- docs:
- add warning about prune
- generate usage include files only as needed
- development docs: add Vagrant section
- update / improve / reformat FAQ
- hint to single-file pyinstaller binaries from README
Version 0.26.1 (2015-09-28)
---------------------------
This is a minor update, just docs and new pyinstaller binaries.
- docs update about python and binary requirements
- better docs for --read-special, fix #220
- re-built the binaries, fix #218 and #213 (glibc version issue)
- update web site about single-file pyinstaller binaries
Note: if you did a python-based installation, there is no need to upgrade.
Version 0.26.0 (2015-09-19)
---------------------------
New features:
- Faster cache sync (do all in one pass, remove tar/compression stuff), #163
- BORG_REPO env var to specify the default repo, #168
- read special files as if they were regular files, #79
- implement borg create --dry-run, attic issue #267
- Normalize paths before pattern matching on OS X, #143
- support OpenBSD and NetBSD (except xattrs/ACLs)
- support / run tests on Python 3.5
Bug fixes:
- borg mount repo: use absolute path, attic #200, attic #137
- chunker: use off_t to get 64bit on 32bit platform, #178
- initialize chunker fd to -1, so it's not equal to STDIN_FILENO (0)
- fix reaction to "no" answer at delete repo prompt, #182
- setup.py: detect lz4.h header file location
- to support python < 3.2.4, add less buggy argparse lib from 3.2.6 (#194)
- fix for obtaining ``char *`` from temporary Python value (old code causes
a compile error on Mint 17.2)
- llfuse 0.41 install troubles on some platforms, require < 0.41
(UnicodeDecodeError exception due to non-ascii llfuse setup.py)
- cython code: add some int types to get rid of unspecific python add /
subtract operations (avoid ``undefined symbol FPE_``... error on some platforms)
- fix verbose mode display of stdin backup
- extract: warn if a include pattern never matched, fixes #209,
implement counters for Include/ExcludePatterns
- archive names with slashes are invalid, attic issue #180
- chunker: add a check whether the POSIX_FADV_DONTNEED constant is defined -
fixes building on OpenBSD.
Other changes:
- detect inconsistency / corruption / hash collision, #170
- replace versioneer with setuptools_scm, #106
- docs:
- pkg-config is needed for llfuse installation
- be more clear about pruning, attic issue #132
- unit tests:
- xattr: ignore security.selinux attribute showing up
- ext3 seems to need a bit more space for a sparse file
- do not test lzma level 9 compression (avoid MemoryError)
- work around strange mtime granularity issue on netbsd, fixes #204
- ignore st_rdev if file is not a block/char device, fixes #203
- stay away from the setgid and sticky mode bits
- use Vagrant to do easy cross-platform testing (#196), currently:
- Debian 7 "wheezy" 32bit, Debian 8 "jessie" 64bit
- Ubuntu 12.04 32bit, Ubuntu 14.04 64bit
- Centos 7 64bit
- FreeBSD 10.2 64bit
- OpenBSD 5.7 64bit
- NetBSD 6.1.5 64bit
- Darwin (OS X Yosemite)
Version 0.25.0 (2015-08-29)
---------------------------
Compatibility notes:
- lz4 compression library (liblz4) is a new requirement (#156)
- the new compression code is very compatible: as long as you stay with zlib
compression, older borg releases will still be able to read data from a
repo/archive made with the new code (note: this is not the case for the
default "none" compression, use "zlib,0" if you want a "no compression" mode
that can be read by older borg). Also the new code is able to read repos and
archives made with older borg versions (for all zlib levels 0..9).
Deprecations:
- --compression N (with N being a number, as in 0.24) is deprecated.
We keep the --compression 0..9 for now to not break scripts, but it is
deprecated and will be removed later, so better fix your scripts now:
--compression 0 (as in 0.24) is the same as --compression zlib,0 (now).
BUT: if you do not want compression, you rather want --compression none
(which is the default).
--compression 1 (in 0.24) is the same as --compression zlib,1 (now)
--compression 9 (in 0.24) is the same as --compression zlib,9 (now)
New features:
- create --compression none (default, means: do not compress, just pass through
data "as is". this is more efficient than zlib level 0 as used in borg 0.24)
- create --compression lz4 (super-fast, but not very high compression)
- create --compression zlib,N (slower, higher compression, default for N is 6)
- create --compression lzma,N (slowest, highest compression, default N is 6)
- honor the nodump flag (UF_NODUMP) and do not backup such items
- list --short just outputs a simple list of the files/directories in an archive
Bug fixes:
- fixed --chunker-params parameter order confusion / malfunction, fixes #154
- close fds of segments we delete (during compaction)
- close files which fell out the lrucache
- fadvise DONTNEED now is only called for the byte range actually read, not for
the whole file, fixes #158.
- fix issue with negative "all archives" size, fixes #165
- restore_xattrs: ignore if setxattr fails with EACCES, fixes #162
Other changes:
- remove fakeroot requirement for tests, tests run faster without fakeroot
(test setup does not fail any more without fakeroot, so you can run with or
without fakeroot), fixes #151 and #91.
- more tests for archiver
- recover_segment(): don't assume we have an fd for segment
- lrucache refactoring / cleanup, add dispose function, py.test tests
- generalize hashindex code for any key length (less hardcoding)
- lock roster: catch file not found in remove() method and ignore it
- travis CI: use requirements file
- improved docs:
- replace hack for llfuse with proper solution (install libfuse-dev)
- update docs about compression
- update development docs about fakeroot
- internals: add some words about lock files / locking system
- support: mention BountySource and for what it can be used
- theme: use a lighter green
- add pypi, wheel, dist package based install docs
- split install docs into system-specific preparations and generic instructions
Version 0.24.0 (2015-08-09)
---------------------------
Incompatible changes (compared to 0.23):
- borg now always issues --umask NNN option when invoking another borg via ssh
on the repository server. By that, it's making sure it uses the same umask
for remote repos as for local ones. Because of this, you must upgrade both
server and client(s) to 0.24.
- the default umask is 077 now (if you do not specify via --umask) which might
be a different one as you used previously. The default umask avoids that
you accidentally give access permissions for group and/or others to files
created by borg (e.g. the repository).
Deprecations:
- "--encryption passphrase" mode is deprecated, see #85 and #97.
See the new "--encryption repokey" mode for a replacement.
New features:
- borg create --chunker-params ... to configure the chunker, fixes #16
(attic #302, attic #300, and somehow also #41).
This can be used to reduce memory usage caused by chunk management overhead,
so borg does not create a huge chunks index/repo index and eats all your RAM
if you back up lots of data in huge files (like VM disk images).
See docs/misc/create_chunker-params.txt for more information.
- borg info now reports chunk counts in the chunk index.
- borg create --compression 0..9 to select zlib compression level, fixes #66
(attic #295).
- borg init --encryption repokey (to store the encryption key into the repo),
fixes #85
- improve at-end error logging, always log exceptions and set exit_code=1
- LoggedIO: better error checks / exceptions / exception handling
- implement --remote-path to allow non-default-path borg locations, #125
- implement --umask M and use 077 as default umask for better security, #117
- borg check: give a named single archive to it, fixes #139
- cache sync: show progress indication
- cache sync: reimplement the chunk index merging in C
Bug fixes:
- fix segfault that happened for unreadable files (chunker: n needs to be a
signed size_t), #116
- fix the repair mode, #144
- repo delete: add destroy to allowed rpc methods, fixes issue #114
- more compatible repository locking code (based on mkdir), maybe fixes #92
(attic #317, attic #201).
- better Exception msg if no Borg is installed on the remote repo server, #56
- create a RepositoryCache implementation that can cope with >2GiB,
fixes attic #326.
- fix Traceback when running check --repair, attic #232
- clarify help text, fixes #73.
- add help string for --no-files-cache, fixes #140
Other changes:
- improved docs:
- added docs/misc directory for misc. writeups that won't be included
"as is" into the html docs.
- document environment variables and return codes (attic #324, attic #52)
- web site: add related projects, fix web site url, IRC #borgbackup
- Fedora/Fedora-based install instructions added to docs
- Cygwin-based install instructions added to docs
- updated AUTHORS
- add FAQ entries about redundancy / integrity
- clarify that borg extract uses the cwd as extraction target
- update internals doc about chunker params, memory usage and compression
- added docs about development
- add some words about resource usage in general
- document how to backup a raw disk
- add note about how to run borg from virtual env
- add solutions for (ll)fuse installation problems
- document what borg check does, fixes #138
- reorganize borgbackup.github.io sidebar, prev/next at top
- deduplicate and refactor the docs / README.rst
- use borg-tmp as prefix for temporary files / directories
- short prune options without "keep-" are deprecated, do not suggest them
- improved tox configuration
- remove usage of unittest.mock, always use mock from pypi
- use entrypoints instead of scripts, for better use of the wheel format and
modern installs
- add requirements.d/development.txt and modify tox.ini
- use travis-ci for testing based on Linux and (new) OS X
- use coverage.py, pytest-cov and codecov.io for test coverage support
I forgot to list some stuff already implemented in 0.23.0, here they are:
New features:
- efficient archive list from manifest, meaning a big speedup for slow
repo connections and "list ", "delete ", "prune" (attic #242,
attic #167)
- big speedup for chunks cache sync (esp. for slow repo connections), fixes #18
- hashindex: improve error messages
Other changes:
- explicitly specify binary mode to open binary files
- some easy micro optimizations
Version 0.23.0 (2015-06-11)
---------------------------
Incompatible changes (compared to attic, fork related):
- changed sw name and cli command to "borg", updated docs
- package name (and name in urls) uses "borgbackup" to have fewer collisions
- changed repo / cache internal magic strings from ATTIC* to BORG*,
changed cache location to .cache/borg/ - this means that it currently won't
accept attic repos (see issue #21 about improving that)
Bug fixes:
- avoid defect python-msgpack releases, fixes attic #171, fixes attic #185
- fix traceback when trying to do unsupported passphrase change, fixes attic #189
- datetime does not like the year 10.000, fixes attic #139
- fix "info" all archives stats, fixes attic #183
- fix parsing with missing microseconds, fixes attic #282
- fix misleading hint the fuse ImportError handler gave, fixes attic #237
- check unpacked data from RPC for tuple type and correct length, fixes attic #127
- fix Repository._active_txn state when lock upgrade fails
- give specific path to xattr.is_enabled(), disable symlink setattr call that
always fails
- fix test setup for 32bit platforms, partial fix for attic #196
- upgraded versioneer, PEP440 compliance, fixes attic #257
New features:
- less memory usage: add global option --no-cache-files
- check --last N (only check the last N archives)
- check: sort archives in reverse time order
- rename repo::oldname newname (rename repository)
- create -v output more informative
- create --progress (backup progress indicator)
- create --timestamp (utc string or reference file/dir)
- create: if "-" is given as path, read binary from stdin
- extract: if --stdout is given, write all extracted binary data to stdout
- extract --sparse (simple sparse file support)
- extra debug information for 'fread failed'
- delete (deletes whole repo + local cache)
- FUSE: reflect deduplication in allocated blocks
- only allow whitelisted RPC calls in server mode
- normalize source/exclude paths before matching
- use posix_fadvise to not spoil the OS cache, fixes attic #252
- toplevel error handler: show tracebacks for better error analysis
- sigusr1 / sigint handler to print current file infos - attic PR #286
- RPCError: include the exception args we get from remote
Other changes:
- source: misc. cleanups, pep8, style
- docs and faq improvements, fixes, updates
- cleanup crypto.pyx, make it easier to adapt to other AES modes
- do os.fsync like recommended in the python docs
- source: Let chunker optionally work with os-level file descriptor.
- source: Linux: remove duplicate os.fsencode calls
- source: refactor _open_rb code a bit, so it is more consistent / regular
- source: refactor indicator (status) and item processing
- source: use py.test for better testing, flake8 for code style checks
- source: fix tox >=2.0 compatibility (test runner)
- pypi package: add python version classifiers, add FreeBSD to platforms
Attic Changelog
---------------
Here you can see the full list of changes between each Attic release until Borg
forked from Attic:
Version 0.17
~~~~~~~~~~~~
(bugfix release, released on X)
- Fix hashindex ARM memory alignment issue (#309)
- Improve hashindex error messages (#298)
Version 0.16
~~~~~~~~~~~~
(bugfix release, released on May 16, 2015)
- Fix typo preventing the security confirmation prompt from working (#303)
- Improve handling of systems with improperly configured file system encoding (#289)
- Fix "All archives" output for attic info. (#183)
- More user friendly error message when repository key file is not found (#236)
- Fix parsing of iso 8601 timestamps with zero microseconds (#282)
Version 0.15
~~~~~~~~~~~~
(bugfix release, released on Apr 15, 2015)
- xattr: Be less strict about unknown/unsupported platforms (#239)
- Reduce repository listing memory usage (#163).
- Fix BrokenPipeError for remote repositories (#233)
- Fix incorrect behavior with two character directory names (#265, #268)
- Require approval before accessing relocated/moved repository (#271)
- Require approval before accessing previously unknown unencrypted repositories (#271)
- Fix issue with hash index files larger than 2GB.
- Fix Python 3.2 compatibility issue with noatime open() (#164)
- Include missing pyx files in dist files (#168)
Version 0.14
~~~~~~~~~~~~
(feature release, released on Dec 17, 2014)
- Added support for stripping leading path segments (#95)
"attic extract --strip-segments X"
- Add workaround for old Linux systems without acl_extended_file_no_follow (#96)
- Add MacPorts' path to the default openssl search path (#101)
- HashIndex improvements, eliminates unnecessary IO on low memory systems.
- Fix "Number of files" output for attic info. (#124)
- limit create file permissions so files aren't read while restoring
- Fix issue with empty xattr values (#106)
Version 0.13
~~~~~~~~~~~~
(feature release, released on Jun 29, 2014)
- Fix sporadic "Resource temporarily unavailable" when using remote repositories
- Reduce file cache memory usage (#90)
- Faster AES encryption (utilizing AES-NI when available)
- Experimental Linux, OS X and FreeBSD ACL support (#66)
- Added support for backup and restore of BSDFlags (OSX, FreeBSD) (#56)
- Fix bug where xattrs on symlinks were not correctly restored
- Added cachedir support. CACHEDIR.TAG compatible cache directories
can now be excluded using ``--exclude-caches`` (#74)
- Fix crash on extreme mtime timestamps (year 2400+) (#81)
- Fix Python 3.2 specific lockf issue (EDEADLK)
Version 0.12
~~~~~~~~~~~~
(feature release, released on April 7, 2014)
- Python 3.4 support (#62)
- Various documentation improvements a new style
- ``attic mount`` now supports mounting an entire repository not only
individual archives (#59)
- Added option to restrict remote repository access to specific path(s):
``attic serve --restrict-to-path X`` (#51)
- Include "all archives" size information in "--stats" output. (#54)
- Added ``--stats`` option to ``attic delete`` and ``attic prune``
- Fixed bug where ``attic prune`` used UTC instead of the local time zone
when determining which archives to keep.
- Switch to SI units (Power of 1000 instead 1024) when printing file sizes
Version 0.11
~~~~~~~~~~~~
(feature release, released on March 7, 2014)
- New "check" command for repository consistency checking (#24)
- Documentation improvements
- Fix exception during "attic create" with repeated files (#39)
- New "--exclude-from" option for attic create/extract/verify.
- Improved archive metadata deduplication.
- "attic verify" has been deprecated. Use "attic extract --dry-run" instead.
- "attic prune --hourly|daily|..." has been deprecated.
Use "attic prune --keep-hourly|daily|..." instead.
- Ignore xattr errors during "extract" if not supported by the filesystem. (#46)
Version 0.10
~~~~~~~~~~~~
(bugfix release, released on Jan 30, 2014)
- Fix deadlock when extracting 0 sized files from remote repositories
- "--exclude" wildcard patterns are now properly applied to the full path
not just the file name part (#5).
- Make source code endianness agnostic (#1)
Version 0.9
~~~~~~~~~~~
(feature release, released on Jan 23, 2014)
- Remote repository speed and reliability improvements.
- Fix sorting of segment names to ignore NFS left over files. (#17)
- Fix incorrect display of time (#13)
- Improved error handling / reporting. (#12)
- Use fcntl() instead of flock() when locking repository/cache. (#15)
- Let ssh figure out port/user if not specified so we don't override .ssh/config (#9)
- Improved libcrypto path detection (#23).
Version 0.8.1
~~~~~~~~~~~~~
(bugfix release, released on Oct 4, 2013)
- Fix segmentation fault issue.
Version 0.8
~~~~~~~~~~~
(feature release, released on Oct 3, 2013)
- Fix xattr issue when backing up sshfs filesystems (#4)
- Fix issue with excessive index file size (#6)
- Support access of read only repositories.
- New syntax to enable repository encryption:
attic init --encryption="none|passphrase|keyfile".
- Detect and abort if repository is older than the cache.
Version 0.7
~~~~~~~~~~~
(feature release, released on Aug 5, 2013)
- Ported to FreeBSD
- Improved documentation
- Experimental: Archives mountable as FUSE filesystems.
- The "user." prefix is no longer stripped from xattrs on Linux
Version 0.6.1
~~~~~~~~~~~~~
(bugfix release, released on July 19, 2013)
- Fixed an issue where mtime was not always correctly restored.
Version 0.6
~~~~~~~~~~~
First public release on July 9, 2013
borgbackup-1.1.15/AUTHORS 0000644 0001750 0001750 00000003634 13771325506 014763 0 ustar user user 0000000 0000000 E-mail addresses listed here are not intended for support, please see
the `support section`_ instead.
.. support section: https://borgbackup.readthedocs.io/en/stable/support.html
Borg authors ("The Borg Collective")
------------------------------------
- Thomas Waldmann
- Radek Podgorny
- Yuri D'Elia
- Michael Hanselmann
- Teemu Toivanen
- Marian Beermann
- Martin Hostettler
- Daniel Reichelt
- Lauri Niskanen
- Abdel-Rahman A. (Abogical)
- Gu1nness
Retired
```````
- Antoine Beaupré
Borg is a fork of Attic.
Attic authors
-------------
Attic is written and maintained by Jonas Borgström and various contributors:
Attic Development Lead
``````````````````````
- Jonas Borgström
Attic Patches and Suggestions
`````````````````````````````
- Brian Johnson
- Cyril Roussillon
- Dan Christensen
- Jeremy Maitin-Shepard
- Johann Klähn
- Petros Moisiadis
- Thomas Waldmann
BLAKE2
------
Borg includes BLAKE2: Copyright 2012, Samuel Neves , licensed under the terms
of the CC0, the OpenSSL Licence, or the Apache Public License 2.0.
Slicing CRC32
-------------
Borg includes a fast slice-by-8 implementation of CRC32, Copyright 2011-2015 Stephan Brumme,
licensed under the terms of a zlib license. See http://create.stephan-brumme.com/crc32/
Folding CRC32
-------------
Borg includes an extremely fast folding implementation of CRC32, Copyright 2013 Intel Corporation,
licensed under the terms of the zlib license.
msgpack
-------
Borg includes Python msgpack, Copyright 2008-2011 INADA Naoki
licensed under the terms of the Apache License 2.0.
xxHash
------
XXH64, a fast non-cryptographic hash algorithm. Copyright 2012-2016 Yann Collet,
licensed under a BSD 2-clause license.
borgbackup-1.1.15/conftest.py 0000644 0001750 0001750 00000005266 13771325506 016115 0 ustar user user 0000000 0000000 import os
import pytest
# IMPORTANT keep this above all other borg imports to avoid inconsistent values
# for `from borg.constants import PBKDF2_ITERATIONS` (or star import) usages before
# this is executed
from borg import constants
# no fixture-based monkey-patching since star-imports are used for the constants module
constants.PBKDF2_ITERATIONS = 1
# needed to get pretty assertion failures in unit tests:
if hasattr(pytest, 'register_assert_rewrite'):
pytest.register_assert_rewrite('borg.testsuite')
import borg.cache
from borg.logger import setup_logging
# Ensure that the loggers exist for all tests
setup_logging()
from borg.testsuite import has_lchflags, has_llfuse
from borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supported
from borg.testsuite.platform import fakeroot_detected, are_acls_working
from borg import xattr
@pytest.fixture(autouse=True)
def clean_env(tmpdir_factory, monkeypatch):
# avoid that we access / modify the user's normal .config / .cache directory:
monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir_factory.mktemp('xdg-config-home')))
monkeypatch.setenv('XDG_CACHE_HOME', str(tmpdir_factory.mktemp('xdg-cache-home')))
# also avoid to use anything from the outside environment:
keys = [key for key in os.environ if key.startswith('BORG_')]
for key in keys:
monkeypatch.delenv(key, raising=False)
def pytest_report_header(config, startdir):
tests = {
"BSD flags": has_lchflags,
"fuse": has_llfuse,
"root": not fakeroot_detected(),
"symlinks": are_symlinks_supported(),
"hardlinks": are_hardlinks_supported(),
"atime/mtime": is_utime_fully_supported(),
"modes": "BORG_TESTS_IGNORE_MODES" not in os.environ
}
enabled = []
disabled = []
for test in tests:
if tests[test]:
enabled.append(test)
else:
disabled.append(test)
output = "Tests enabled: " + ", ".join(enabled) + "\n"
output += "Tests disabled: " + ", ".join(disabled)
return output
class DefaultPatches:
def __init__(self, request):
self.org_cache_wipe_cache = borg.cache.LocalCache.wipe_cache
def wipe_should_not_be_called(*a, **kw):
raise AssertionError("Cache wipe was triggered, if this is part of the test add @pytest.mark.allow_cache_wipe")
if 'allow_cache_wipe' not in request.keywords:
borg.cache.LocalCache.wipe_cache = wipe_should_not_be_called
request.addfinalizer(self.undo)
def undo(self):
borg.cache.LocalCache.wipe_cache = self.org_cache_wipe_cache
@pytest.fixture(autouse=True)
def default_patches(request):
return DefaultPatches(request)
borgbackup-1.1.15/scripts/ 0000755 0001750 0001750 00000000000 13771325773 015402 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/borg.exe.spec 0000644 0001750 0001750 00000003766 13771325506 017775 0 ustar user user 0000000 0000000 # -*- mode: python -*-
# this pyinstaller spec file is used to build borg binaries on posix platforms
import os, sys
# Note: SPEC contains the spec file argument given to pyinstaller
here = os.path.dirname(os.path.abspath(SPEC))
basepath = os.path.abspath(os.path.join(here, '..'))
block_cipher = None
a = Analysis([os.path.join(basepath, 'src/borg/__main__.py'), ],
pathex=[basepath, ],
binaries=[],
datas=[
('../src/borg/paperkey.html', 'borg'),
],
hiddenimports=['borg.platform.posix'],
hookspath=[],
runtime_hooks=[],
excludes=[
'_ssl', 'ssl',
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
if sys.platform == 'darwin':
# do not bundle the osxfuse libraries, so we do not get a version
# mismatch to the installed kernel driver of osxfuse.
a.binaries = [b for b in a.binaries if 'libosxfuse' not in b[0]]
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='borg.exe',
debug=False,
strip=False,
upx=True,
console=True )
# Build a directory-based binary in addition to a packed
# single file. This allows one to easily look at all included
# files (e.g. without having to strace or halt the built binary
# and introspect /tmp). Also avoids unpacking all libs when
# running the app, which is better for app signing on various OS.
slim_exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='borg.exe',
debug=False,
strip=False,
upx=False,
console=True)
coll = COLLECT(slim_exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='borg-dir')
borgbackup-1.1.15/scripts/sign-binaries 0000755 0001750 0001750 00000000514 13771325506 020054 0 ustar user user 0000000 0000000 #!/bin/bash
D=$1
if [ "$D" = "" ]; then
echo "Usage: sign-binaries 201912312359"
exit
fi
if [ "$QUBES_GPG_DOMAIN" = "" ]; then
GPG=gpg
else
GPG=qubes-gpg-client-wrapper
fi
for file in dist/borg-*; do
$GPG --local-user "Thomas Waldmann" --armor --detach-sign --output $file.asc $file
done
touch -t $D dist/*
borgbackup-1.1.15/scripts/hash_sizes.py 0000644 0001750 0001750 00000005437 13771325506 020117 0 ustar user user 0000000 0000000 """
Compute hashtable sizes with nices properties
- prime sizes (for small to medium sizes)
- 2 prime-factor sizes (for big sizes)
- fast growth for small sizes
- slow growth for big sizes
Note:
this is just a tool for developers.
within borgbackup, it is just used to generate hash_sizes definition for _hashindex.c.
"""
from collections import namedtuple
K, M, G = 2**10, 2**20, 2**30
# hash table size (in number of buckets)
start, end_p1, end_p2 = 1 * K, 127 * M, 2 * G - 10 * M # stay well below 2^31 - 1
Policy = namedtuple("Policy", "upto grow")
policies = [
# which growth factor to use when growing a hashtable of size < upto
# grow fast (*2.0) at the start so we do not have to resize too often (expensive).
# grow slow (*1.1) for huge hash tables (do not jump too much in memory usage)
Policy(256*K, 2.0),
Policy(2*M, 1.7),
Policy(16*M, 1.4),
Policy(128*M, 1.2),
Policy(2*G-1, 1.1),
]
# slightly modified version of:
# http://www.macdevcenter.com/pub/a/python/excerpt/pythonckbk_chap1/index1.html?page=2
def eratosthenes():
"""Yields the sequence of prime numbers via the Sieve of Eratosthenes."""
D = {} # map each composite integer to its first-found prime factor
q = 2 # q gets 2, 3, 4, 5, ... ad infinitum
while True:
p = D.pop(q, None)
if p is None:
# q not a key in D, so q is prime, therefore, yield it
yield q
# mark q squared as not-prime (with q as first-found prime factor)
D[q * q] = q
else:
# let x <- smallest (N*p)+q which wasn't yet known to be composite
# we just learned x is composite, with p first-found prime factor,
# since p is the first-found prime factor of q -- find and mark it
x = p + q
while x in D:
x += p
D[x] = p
q += 1
def two_prime_factors(pfix=65537):
"""Yields numbers with 2 prime factors pfix and p."""
for p in eratosthenes():
yield pfix * p
def get_grow_factor(size):
for p in policies:
if size < p.upto:
return p.grow
def find_bigger_prime(gen, i):
while True:
p = next(gen)
if p >= i:
return p
def main():
sizes = []
i = start
gen = eratosthenes()
while i < end_p1:
grow_factor = get_grow_factor(i)
p = find_bigger_prime(gen, i)
sizes.append(p)
i = int(i * grow_factor)
gen = two_prime_factors() # for lower ram consumption
while i < end_p2:
grow_factor = get_grow_factor(i)
p = find_bigger_prime(gen, i)
sizes.append(p)
i = int(i * grow_factor)
print("""\
static int hash_sizes[] = {
%s
};
""" % ', '.join(str(size) for size in sizes))
if __name__ == '__main__':
main()
borgbackup-1.1.15/scripts/sdist-sign 0000755 0001750 0001750 00000000467 13771325506 017415 0 ustar user user 0000000 0000000 #!/bin/bash
R=$1
if [ "$R" = "" ]; then
echo "Usage: sdist-sign 1.2.3"
exit
fi
if [ "$QUBES_GPG_DOMAIN" = "" ]; then
GPG=gpg
else
GPG=qubes-gpg-client-wrapper
fi
python setup.py sdist
D=dist/borgbackup-$R.tar.gz
$GPG --detach-sign --local-user "Thomas Waldmann" --armor --output $D.asc $D
borgbackup-1.1.15/scripts/shell_completions/ 0000755 0001750 0001750 00000000000 13771325773 021125 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/shell_completions/zsh/ 0000755 0001750 0001750 00000000000 13771325773 021731 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/shell_completions/zsh/_borg 0000644 0001750 0001750 00000153144 13771325506 022746 0 ustar user user 0000000 0000000 #compdef borg borgfs -P -value-,BORG_*,-default-
# Zsh completion for Borg Backup 1.1.15.
#
# Recommended _borg specific settings:
#
# zstyle -e ':completion:*:*:borg-*:argument-rest:*' tag-order \
# '[[ $words[CURRENT] == -* ]] && reply=( "! archives archive-files" "-" )'
# zstyle ':completion:*:*:(borg|-value-,BORG_)*' sort false
# zstyle ':completion:*:*:borg-config:argument-2:keys' list-grouped false
# zstyle ':completion:*:*:borg-*:*' gain-privileges true
# zstyle ':completion:*' fake-parameters 'BORG_REPO:scalar'
#
# Custom styles:
#
# archive-description-format
# Default: `{archive:<36} {time} [{id}]`.
# archive-sort
# In which order archive names should be listed.
# Possible values are: `inverse`, `timestamp`, `name`, `id`.
# file-description-format
# Default: `{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}`.
# path-style-selector
# Style selector used to select a path (when Borg would use either `pp` or `pf`).
# Default: `fm`.
# repository-suffix
# This boolean style controls whether to add the `::` auto-removable suffix to a repository.
# Default: `true`.
(( $+functions[_borg_commands] )) ||
_borg_commands() {
local -a commands_=(
'benchmark:benchmark command'
'break-lock:break repository and cache locks'
'change-passphrase:change repository passphrase'
'check:verify repository'
'config:get and set configuration values'
'create:create backup'
'debug:debugging command (not intended for normal use)'
'delete:delete archive'
'diff:find differences in archive contents'
'export-tar:create tarball from archive'
'extract:extract archive contents'
'help:extra help'
'info:show repository or archive information'
'init:initialize empty repository'
'key:manage repository key'
'list:list archive or repository contents'
'mount:mount repository'
'prune:prune archives'
'recreate:re-create archives'
'rename:rename archive'
'serve:start repository server process'
'umount:umount repository'
'upgrade:upgrade repository format'
'with-lock:run user command with lock held'
)
_describe -t commands 'borg commands' commands_
}
(( $+functions[_borg-benchmark] )) ||
_borg-benchmark() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
$common_options \
':type:(crud)' \
': :_borg_repository' \
':PATH:_files'
}
(( $+functions[_borg-break-lock] )) ||
_borg-break-lock() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
$common_options \
':: :_borg_repository'
}
(( $+functions[_borg-change-passphrase] )) ||
_borg-change-passphrase() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
$common_options \
':: :_borg_repository'
}
(( $+functions[_borg-check] )) ||
_borg-check() {
local -a common_options common_archive_filters_options
__borg_setup_common_options
__borg_setup_common_archive_filters_options
_arguments -s -w -S : \
'--repository-only[only perform repository checks]' \
'--archives-only[only perform archives checks]' \
'(--repository-only)--verify-data[perform cryptographic archive data integrity verification]' \
'--repair[attempt to repair any inconsistencies found]' \
'--save-space[work slower, but using less space]' \
$common_archive_filters_options \
$common_options \
'::REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive'
}
(( $+functions[_borg-config] )) ||
_borg-config() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
'(-c --cache)'{-c,--cache}'[get and set values from the repo cache]' \
'(-d --delete)'{-d,--delete}'[delete the key from the config]' \
'(-l --list)'{-l,--list}'[list the configuration of the repo]' \
$common_options \
': :_borg_repository' \
': : _borg_config $line[1]' \
'::VALUE'
}
(( $+functions[_borg-create] )) ||
_borg-create() {
local -a common_options common_create_options
__borg_setup_common_options
__borg_setup_common_create_options
_arguments -s -w -S : \
'*'{-e,--exclude}'=[exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files -f -e "$line[1]" fm "${(@)line[2,-1]}"' \
'*--pattern=[experimental: include/exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files -p -f -e "$line[1]" sh "${(@)line[2,-1]}"' \
$common_create_options \
'(-s --stats)--json[Output stats as JSON. Implies --stats.]' \
'--no-cache-sync[experimental: do not synchronize the cache. Implies not using the files cache.]' \
'--no-files-cache[do not load/update the file metadata cache used to detect unchanged files]' \
'--stdin-name=[use NAME in archive for stdin data (default: "stdin")]:NAME' \
'--stdin-user=[set user USER in archive for stdin data (default: root)]:USER:_users' \
'--stdin-group=[set group GROUP in archive for stdin data (default: root)]:GROUP:_groups' \
'--stdin-mode=[set mode to M in archive for stdin data (default: 0660)]: : _borg_guard_numeric_mode "M"' \
'--exclude-nodump[exclude files flagged NODUMP]' \
'(-x --one-file-system)'{-x,--one-file-system}'[stay in the same file system]' \
'--numeric-owner[only store numeric user and group identifiers]' \
'--noatime[do not store atime into archive]' \
'--noctime[do not store ctime into archive]' \
'--nobirthtime[do not store birthtime (creation date) into archive]' \
'--nobsdflags[do not read and store bsdflags (e.g. NODUMP, IMMUTABLE) into archive]' \
'--ignore-inode[ignore inode data in the file metadata cache used to detect unchanged files]' \
'--files-cache=[operate files cache in MODE. default: ctime,size,inode]:MODE:(ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime disabled)' \
'--read-special[open and read block and char device files as well as FIFOs as if they were regular files]' \
$common_options \
':ARCHIVE: _borg_repository_or_archive -a -p' \
'*:PATH:_files'
}
(( $+functions[_borg-debug] )) ||
_borg-debug() {
local -a state line common_options
local curcontext="$curcontext" state_descr
declare -A opt_args
local -i ret=1
__borg_setup_common_options
_arguments -s -w -C : \
$common_options \
': :->command' \
'*:: :->option-or-argument' && ret=0
case $state in
(command)
local -a debug_commands=(
'info:show system infos for debugging / bug reports'
'dump-archive-items:dump archive items (metadata)'
'dump-archive:dump decoded archive metadata'
'dump-manifest:dump decoded repository metadata'
'dump-repo-objs:dump repo objects'
'search-repo-objs:search repo objects'
'get-obj:get object from repository'
'put-obj:put object to repository'
'delete-obj:delete object from repository'
'refcount-obj:show refcount for object from repository'
'convert-profile:convert Borg profile to Python profile'
)
_describe -t commands 'command' debug_commands && ret=0
;;
(option-or-argument)
curcontext="${curcontext%:*}-$line[1]:"
case $line[1] in
(info)
_arguments -s -w -S : \
$common_options && ret=0
;;
(dump-archive-items)
_arguments -s -w -S : \
$common_options \
':ARCHIVE: _borg_repository_or_archive -a' && ret=0
;;
(dump-archive)
_arguments -s -w -S : \
$common_options \
':ARCHIVE: _borg_repository_or_archive -a' \
':PATH:_files' && ret=0
;;
(dump-manifest)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' \
':PATH:_files' && ret=0
;;
(dump-repo-objs)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' && ret=0
;;
(search-repo-objs)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' \
':WANTED (hex or string):' && ret=0
;;
(get-obj)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' \
':ID (hex object):' \
':PATH:_files' && ret=0
;;
(put-obj)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' \
'*:PATH:_files' && ret=0
;;
(delete-obj)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' \
'*:ID (hex object):' && ret=0
;;
(refcount-obj)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' \
'*:ID (hex object):' && ret=0
;;
(convert-profile)
_arguments -s -w -S : \
$common_options \
':INPUT:_files' \
':OUTPUT:_files' && ret=0
;;
(*)
if ! _call_function ret _borg_debug_$line[1]; then
_default && ret=0
fi
;;
esac
;;
esac
return ret
}
(( $+functions[_borg-delete] )) ||
_borg-delete() {
local -a common_options common_archive_filters_options common_dry_run_stats_options
__borg_setup_common_options
__borg_setup_common_archive_filters_options
__borg_setup_common_dry_run_stats_options
_arguments -s -w -S : \
$common_dry_run_stats_options \
'--cache-only[delete only the local cache for the given repository]' \
'*--force[force deletion of corrupted archives, use "--force --force" in case "--force" does not work]' \
'--save-space[work slower, but using less space]' \
$common_archive_filters_options \
$common_options \
':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \
'*:ARCHIVE: _borg_archive "${line[1]%%::*}"'
}
(( $+functions[_borg-diff] )) ||
_borg-diff() {
local -a common_options common_exclude_options
__borg_setup_common_options
__borg_setup_common_exclude_options
_arguments -s -w -S : \
'--numeric-owner[only obey numeric user and group identifiers]' \
'--same-chunker-params[override check of chunker parameters]' \
'--sort[sort the output lines by file path]' \
$common_exclude_options \
$common_options \
':ARCHIVE1: _borg_repository_or_archive -a' \
':ARCHIVE2: _borg_archive "${line[1]%%::*}"' \
'*: : _borg_style_selector_or_archive_files -e "$line[1]" pp'
}
(( $+functions[_borg-export-tar] )) ||
_borg-export-tar() {
local -a common_options common_exclude_extract_options
__borg_setup_common_options
__borg_setup_common_exclude_extract_options
_arguments -s -w -S : \
'--tar-filter[filter program to pipe data through]: :_cmdstring' \
'--list[output verbose list of items (files, dirs, ...)]' \
$common_exclude_extract_options \
$common_options \
':ARCHIVE: _borg_repository_or_archive -a' \
':FILE:_files' \
'*: : _borg_style_selector_or_archive_files -e "$line[1]" pp'
}
(( $+functions[_borg-extract] )) ||
_borg-extract() {
local -a common_options common_exclude_extract_options
__borg_setup_common_options
__borg_setup_common_exclude_extract_options
_arguments -s -w -S : \
'--list[output verbose list of items (files, dirs, ...)]' \
'(-n --dry-run)'{-n,--dry-run}'[do not actually change any files]' \
'--numeric-owner[only obey numeric user and group identifiers]' \
'--nobsdflags[do not extract/set bsdflags (e.g. NODUMP, IMMUTABLE)]' \
'--stdout[write all extracted data to stdout]' \
'--sparse[create holes in output sparse file from all-zero chunks]' \
$common_exclude_extract_options \
$common_options \
':ARCHIVE: _borg_repository_or_archive -a' \
'*: : _borg_style_selector_or_archive_files -e "$line[1]" pp'
}
(( $+functions[_borg-help] )) ||
_borg-help() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
'--epilog-only' \
'--usage-only' \
$common_options \
':: : _alternative "topics:TOPIC:(patterns placeholders compression)" ": :_borg_commands"'
}
(( $+functions[_borg-info] )) ||
_borg-info() {
local -a common_options common_archive_filters_options
__borg_setup_common_options
__borg_setup_common_archive_filters_options
_arguments -s -w -S : \
'--json[format output as JSON]' \
$common_archive_filters_options \
$common_options \
'::REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive'
}
(( $+functions[_borg-init] )) ||
_borg-init() {
local -i ret=1
local -a common_options common_init_options
__borg_setup_common_options
__borg_setup_common_init_options
# special handling for the required optional argument
if (( ! ${words[(I)(-e|--encryption)(|=*)]} )); then
local desc='select encryption key mode'
local -a long=( "--encryption:$desc" ) short=( "-e:$desc" ) remove_chars=( -r '= \t\n\-' )
_describe -t required-options 'required option' long -S '=' $remove_chars -- short $remove_chars && ret=0
fi
_arguments -s -w -S : \
'(-e --encryption)'{-e,--encryption}'=[select encryption key mode (required)]:MODE:(none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2)' \
$common_init_options \
'--make-parent-dirs[create parent directories]' \
'::REPOSITORY:_directories' && ret=0
return ret
}
(( $+functions[_borg-key] )) ||
_borg-key() {
local -a state line common_options
local curcontext="$curcontext" state_descr
declare -A opt_args
local -i ret=1
__borg_setup_common_options
_arguments -s -w -C : \
$common_options \
': :->command' \
'*:: :->option-or-argument' && ret=0
case $state in
(command)
local -a key_commands=(
'change-passphrase:Change repository key file passphrase'
'export:Export the repository key for backup'
'import:Import the repository key from backup'
'migrate-to-repokey:Migrate passphrase -> repokey'
)
_describe -t commands 'command' key_commands && ret=0
;;
(option-or-argument)
curcontext="${curcontext%:*}-$line[1]:"
case $line[1] in
(change-passphrase)
_arguments -s -w -S : \
$common_options \
': :_borg_repository' && ret=0
;;
(export)
_arguments -s -w -S : \
'--paper[create an export suitable for printing and later type-in]' \
'--qr-html[create an html file suitable for printing and later type-in or qr scan]' \
$common_options \
': :_borg_repository' \
'::PATH:_files' && ret=0
;;
(import)
_arguments -s -w -S : \
'--paper[interactively import from a backup done with --paper]' \
$common_options \
': :_borg_repository' \
'::PATH:_files' && ret=0
;;
(migrate-to-repokey)
_arguments -s -w -S : \
$common_options \
':: :_borg_repository' && ret=0
;;
(*)
if ! _call_function ret _borg_key_$line[1]; then
_default && ret=0
fi
;;
esac
;;
esac
return ret
}
(( $+functions[_borg-list] )) ||
_borg-list() {
local -a common_options common_exclude_options common_archive_filters_options
__borg_setup_common_options
__borg_setup_common_exclude_options
__borg_setup_common_archive_filters_options
_arguments -s -w -S : \
'--short[only print file/directory names, nothing else]' \
{--format,--list-format}'=[specify format for file listing]:FORMAT: _borg_format_keys $line[1]' \
'--json[Only valid for listing repository contents. Format output as JSON.]' \
'--json-lines[Only valid for listing archive contents. Format output as JSON Lines.]' \
$common_archive_filters_options \
$common_exclude_options \
$common_options \
':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \
'*: : _borg_style_selector_or_archive_files -e "$line[1]" pp'
}
(( $+functions[_borg-mount] )) ||
_borg-mount() {
local -a common_options common_exclude_extract_options common_archive_filters_options
__borg_setup_common_options
__borg_setup_common_exclude_extract_options
__borg_setup_common_archive_filters_options
_arguments -s -w -S : \
$* \
'(-f --foreground)'{-f,--foreground}'[stay in foreground, do not daemonize]' \
'-o[mount options]: :_fuse_values "mount options"
"versions[merged, versioned view of the files in the archives]"
"allow_damaged_files[read damaged files]"
"ignore_permissions[not enforce \"default_permissions\"]"' \
$common_archive_filters_options \
$common_exclude_extract_options \
$common_options \
':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \
':MOUNTPOINT:_directories' \
'*: : _borg_style_selector_or_archive_files "$line[1]" pp'
}
(( $+functions[_borg-prune] )) ||
_borg-prune() {
local -a common_options common_prefix_and_glob_archives_filter_options common_dry_run_stats_options
__borg_setup_common_options
__borg_setup_common_prefix_and_glob_archives_filter_options
__borg_setup_common_dry_run_stats_options
_arguments -s -w -S : \
$common_dry_run_stats_options \
'*--force[force pruning of corrupted archives, use "--force --force" in case "--force" does not work]' \
'--list[output verbose list of archives it keeps/prunes]' \
'--keep-within[keep all archives within this time interval]: : _borg_guard_unsigned_number "INTERVAL"' \
'(--keep-last --keep-secondly)'{--keep-last,--keep-secondly}'[number of secondly archives to keep]: : _borg_guard_unsigned_number "N"' \
'--keep-minutely[number of minutely archives to keep]: : _borg_guard_unsigned_number "N"' \
'(-H --keep-hourly)'{-H,--keep-hourly}'[number of hourly archives to keep]: : _borg_guard_unsigned_number "N"' \
'(-d --keep-daily)'{-d,--keep-daily}'[number of daily archives to keep]: : _borg_guard_unsigned_number "N"' \
'(-w --keep-weekly)'{-w,--keep-weekly}'[number of weekly archives to keep]: : _borg_guard_unsigned_number "N"' \
'(-m --keep-monthly)'{-m,--keep-monthly}'[number of monthly archives to keep]: : _borg_guard_unsigned_number "N"' \
'(-y --keep-yearly)'{-y,--keep-yearly}'[number of yearly archives to keep]: : _borg_guard_unsigned_number "N"' \
'--save-space[work slower, but using less space]' \
$common_prefix_and_glob_archives_filter_options \
$common_options \
':: :_borg_repository'
}
(( $+functions[_borg-recreate] )) ||
_borg-recreate() {
local -a common_options common_create_options
__borg_setup_common_options
__borg_setup_common_create_options
local -a mods=(
'if-different:recompress if current compression is with a different compression algorithm (the level is not considered)'
'always:recompress even if current compression is with the same compression algorithm (use this to change the compression level)'
'never:do not recompress (use this option to explicitly prevent recompression)'
)
mods=( ${${(q)mods//\\/\\\\}//:/\\:} )
_arguments -s -w -S : \
$common_create_options \
'--target=[create a new archive with the name ARCHIVE]:ARCHIVE: _borg_placeholder_or_archive "${line[1]%%\:\:*}"' \
'--recompress=[recompress data chunks according to "MODE" and "--compression"]:MODE:'"(($mods))" \
$common_options \
':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \
'*: : _borg_style_selector_or_archive_files -e "$line[1]" pp'
}
(( $+functions[_borg-rename] )) ||
_borg-rename() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
$common_options \
':ARCHIVE: _borg_repository_or_archive -a' \
':NEWNAME'
}
(( $+functions[_borg-serve] )) ||
_borg-serve() {
local -a common_options common_init_options
__borg_setup_common_options
__borg_setup_common_init_options
_arguments -s -w -S : \
$common_init_options \
'*--restrict-to-path=[restrict repository access to PATH]:PATH:_files' \
'*--restrict-to-repository=[restrict repository access]: :_borg_repository'
}
(( $+functions[_borg-umount] )) ||
_borg-umount() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
$common_options \
':MOUNTPOINT:_umountable'
}
(( $+functions[_borg-upgrade] )) ||
_borg-upgrade() {
local -a common_options
__borg_setup_common_options
_arguments -s -w -S : \
'(-n --dry-run)'{-n,--dry-run}'[do not change repository]' \
'--inplace[rewrite repository in place, with no chance of going back to older versions of the repository]' \
'--force[force upgrade]' \
'--tam[enable manifest authentication (in key and cache)]' \
'--disable-tam[disable manifest authentication (in key and cache)]' \
$common_options \
':: :_borg_repository'
}
(( $+functions[_borg-with-lock] )) ||
_borg-with-lock() {
local -a state line common_options
local curcontext="$curcontext" state_descr
declare -A opt_args
local -i ret=1
__borg_setup_common_options
_arguments -s -w -C -S : \
$common_options \
'(-): :_borg_repository' \
'(-):COMMAND: _command_names -e' \
'(-)*:ARGS:->normal' && ret=0
case $state in
(normal)
shift 2 words
(( CURRENT -= 2 ))
_normal && ret=0
;;
esac
return ret
}
(( $+functions[__borg_setup_common_options] )) ||
__borg_setup_common_options() {
typeset -ga common_options=(
'(- :)'{-h,--help}'[show this help message and exit]'
'--critical[work on log level CRITICAL]'
'--error[work on log level ERROR]'
'--warning[work on log level WARNING (default)]'
'(--info -v --verbose)'{--info,-v,--verbose}'[work on log level INFO]'
'--debug[work on log level DEBUG]'
'--debug-topic=[enable TOPIC debugging (can be specified multiple times)]:TOPIC'
'(-p --progress)'{-p,--progress}'[show progress information]'
'--log-json[Output one JSON object per log line instead of formatted text.]'
'--lock-wait=[wait at most SECONDS for acquiring a repository/cache lock (default: 1)]: : _borg_guard_unsigned_number "SECONDS"'
'--bypass-lock[bypass locking mechanism]'
'(- :)--show-version[show/log the borg version]'
'--show-rc[show/log the return code (rc)]'
'--umask=[set umask to M (local and remote, default: 0077)]: : _borg_guard_numeric_mode "M"'
'--remote-path=[set remote path to executable (default: "borg")]: :_cmdstring'
'--remote-ratelimit=[set remote network upload rate limit in kiByte/s (default: 0=unlimited)]: : _borg_guard_unsigned_number "RATE"'
'--consider-part-files[treat part files like normal files (e.g. to list/extract them)]'
'--debug-profile=[write execution profile in Borg format into FILE]:FILE:_files'
'--rsh=[use COMMAND instead of ssh]: :_cmdstring'
)
}
(( $+functions[__borg_setup_common_exclude_options] )) ||
__borg_setup_common_exclude_options() {
typeset -ga common_exclude_options=(
'*'{-e,--exclude}'=[exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files "$line[1]" fm'
'*--exclude-from=[read exclude patterns from EXCLUDEFILE, one per line]:EXCLUDEFILE:_files'
'*--pattern=[experimental: include/exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files -p "$line[1]" sh'
'*--patterns-from=[experimental: read include/exclude patterns from PATTERNFILE, one per line]:PATTERNFILE:_files'
)
}
(( $+functions[__borg_setup_common_exclude_extract_options] )) ||
__borg_setup_common_exclude_extract_options() {
local -a common_exclude_options
__borg_setup_common_exclude_options
typeset -ga common_exclude_extract_options=(
$common_exclude_options
'--strip-components=[Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.]: : _borg_guard_unsigned_number "NUMBER"'
)
}
(( $+functions[__borg_setup_common_prefix_and_glob_archives_filter_options] )) ||
__borg_setup_common_prefix_and_glob_archives_filter_options() {
typeset -ga common_prefix_and_glob_archives_filter_options=(
'(-P --prefix -a --glob-archives)'{-P,--prefix}'=[only consider archive names starting with this prefix]:PREFIX: _borg_archive -n "${line[1]%%\:\:*}"'
'(-P --prefix)*'{-a,--glob-archives}'=[only consider archive names matching the glob]:GLOB: _borg_archive -n "${line[1]%%\:\:*}"'
)
}
(( $+functions[__borg_setup_common_archive_filters_options] )) ||
__borg_setup_common_archive_filters_options() {
local -a common_prefix_and_glob_archives_filter_options
__borg_setup_common_prefix_and_glob_archives_filter_options
typeset -ga common_archive_filters_options=(
$common_prefix_and_glob_archives_filter_options
'--sort-by=[Comma-separated list of sorting keys, default: timestamp]:KEYS:(timestamp name id)'
'(--last)--first=[consider first N archives after other filters were applied]:N: _borg_archive -n "${line[1]%%\:\:*}"'
'(--first)--last=[consider last N archives after other filters were applied]:N: _borg_archive -n "${line[1]%%\:\:*}"'
)
}
(( $+functions[__borg_setup_common_dry_run_stats_options] )) ||
__borg_setup_common_dry_run_stats_options() {
typeset -ga common_dry_run_stats_options=(
'(-n --dry-run -s --stats)'{-n,--dry-run}'[do not change anything]'
'(-n --dry-run -s --stats)'{-s,--stats}'[print statistics at end]'
# NOTE: actual messages for subcommands differ in details
)
}
(( $+functions[__borg_setup_common_create_options] )) ||
__borg_setup_common_create_options() {
local -a common_dry_run_stats_options common_exclude_options
__borg_setup_common_dry_run_stats_options
__borg_setup_common_exclude_options
typeset -ga common_create_options=(
$common_dry_run_stats_options
'--list[output verbose list of items (files, dirs, ...)]'
'--filter=[only display items with the given status characters]: :_borg_statuschars'
$common_exclude_options
'--exclude-caches[exclude directories that contain a CACHEDIR.TAG file]'
'*--exclude-if-present=[exclude directories that are tagged by containing a filesystem object with the given NAME]:NAME:_files'
'--keep-'{exclude-tags,tag-files}'[if tag objects are specified with --exclude-if-present, don'\''t omit the tag objects themselves]'
'--comment=[add a comment text to the archive]:COMMENT:_borg_placeholders'
'--timestamp=[manually specify the archive creation date/time]:TIMESTAMP:_borg_timestamp'
'(-c --checkpoint-interval)'{-c,--checkpoint-interval}'=[write checkpoint every SECONDS seconds (default: 1800)]: : _borg_guard_unsigned_number "SECONDS"'
'--chunker-params=[specify the chunker parameters]: :_borg_chunker_params'
'(-C --compression)'{-C,--compression}'=[select compression algorithm]: :_borg_compression'
)
}
(( $+functions[__borg_setup_common_init_options] )) ||
__borg_setup_common_init_options() {
local -a common_options
__borg_setup_common_options
typeset -ga common_init_options=(
$common_options
'--append-only[only allow appending to repository segment files]'
'--storage-quota=[override storage quota of the repository]: :_borg_quota_suffixes'
)
}
(( $+functions[_borgfs] )) ||
_borgfs() {
_borg-mount '(- :)'{-V,--version}'[show version number and exit]'
}
(( $+functions[_borg_parameters] )) ||
_borg_parameters() {
local name=$1
shift
local -i ret=1
local -a expl
case $name in
(REPO)
local BORG_REPO
unset BORG_REPO
_borg_repository && ret=0
;;
((|NEW_)PASSPHRASE)
_message -e 'passphrase' && ret=0
;;
(DISPLAY_PASSPHRASE)
_message -e 'answer to the "display the passphrase for verification" question' && ret=0
;;
(HOST_ID)
_message -e 'unique ID' && ret=0
;;
(FILES_CACHE_SUFFIX)
_message -e 'suffix' && ret=0
;;
(FILES_CACHE_TTL)
_borg_guard_unsigned_number 'time to live (default: 20)' && ret=0
;;
(MOUNT_DATA_CACHE_ENTRIES)
_borg_guard_unsigned_number 'number of cached data chunks' && ret=0
;;
(PASSCOMMAND|RSH|REMOTE_PATH)
_cmdstring && ret=0
;;
(HOSTNAME_IS_UNIQUE|SHOW_SYSINFO|(UNKNOWN_UNENCRYPTED|RELOCATED)_REPO_ACCESS_IS_OK)
_description values expl 'value'
compadd "$expl[@]" yes no && ret=0
;;
((CHECK|DELETE)_I_KNOW_WHAT_I_AM_DOING)
_description values expl 'value'
compadd "$expl[@]" YES NO && ret=0
;;
(WORKAROUNDS)
_wanted workarounds expl 'workaround' _sequence -n 1 compadd - basesyncfile && ret=0
;;
(KEYS_DIR)
_directories && ret=0
;;
(*)
_default && ret=0
;;
esac
return ret
}
(( $+functions[_borg_repository] )) ||
_borg_repository() {
local -a alts opts qopts
zparseopts -E -a opts S:
qopts=( ${(q)opts} )
[[ -n $BORG_REPO ]] && alts+=( "default-repository: : __borg_default_repository $qopts" )
alts+=( "cached-repositories:cached repositories:_borg_cached_repositories $qopts" )
alts+=( 'directories: :_directories -r ":/ \t\n\-"' )
alts+=( 'remote-repositories: : _borg_remote_repositories' )
_alternative $alts
}
(( $+functions[__borg_default_repository] )) ||
__borg_default_repository() {
local -a opts suf
zparseopts -E -a opts S:
(( $opts[(I)-S] )) && suf=( -S '' )
local -a default_repository=( "\:\::$BORG_REPO" )
_describe -t default-repository 'default repository' default_repository "$suf[@]"
}
(( $+functions[_borg_cached_repositories] )) ||
_borg_cached_repositories() {
local -a cached_repos
local sed_script='/^previous_location = / {
s///
# no port was given
/ssh:\/\/[^/:]+:[0-9]+/! {
# lstrip the `ssh://` prefix and add a colon before the first slash
s!ssh://([^:/]+)/(.*)!\1:/\2!
}
p
}'
local cachedir=${BORG_CACHE_DIR:-${XDG_CACHE_HOME:-${BORG_BASE_DIR:-$HOME}/.cache}/borg}
cached_repos=( ${(f)"$(_call_program -p cached-repositories sed -n -E ${(q)sed_script} \
"${(q)cachedir}/*/config(#qN.om)" 2>/dev/null)"} )
if [[ $compstate[quote] != (\'|\") ]]; then
# hide ~BORG_REPO and other scalars
local BORG_REPO
unset BORG_REPO sed_script cachedir
cached_repos=( "${(@D)cached_repos}" )
fi
compadd -Q "$@" -r ': \t\n\-' -a cached_repos
}
(( $+functions[_borg_remote_repositories] )) ||
_borg_remote_repositories() {
local -a match mbegin mend expl alts
if compset -P '(#b)ssh://[^/]##@[^/]##:([0-9]##)/'; then
_remote_files -/ -- ssh -p $match[1]
return
fi
local -i have_scheme=0
compset -P 'ssh://' && have_scheme=1
if compset -P '*:'; then
(( have_scheme )) && alts+=( 'ports: : _borg_guard_unsigned_number "port"' )
alts+=( 'remote-files:remote file: _remote_files -/ -- ssh' )
_alternative $alts
elif compset -P 1 '(#b)(*)@'; then
local user=$match[1]
_wanted -C user-at hosts expl "host for $user" \
_combination -s '[:@]' accounts users-hosts users="$user" hosts -S ':' -
elif compset -S '@*'; then
_wanted users expl "user" \
_combination -s '[:@]' accounts users-hosts users -q -
else
alts=(
'users:user:_users -S "@"'
'hosts:host:_hosts -S ":"'
)
(( ! have_scheme )) && alts+=( 'prefixes:ssh:compadd -S "" ssh://' )
_alternative $alts
fi
}
# _borg_repository_or_archive [-a] [-p]
#
# -a archive is mandatory. The suffix `::` will be added to the repository if possible.
# -p complete placeholders
(( $+functions[_borg_repository_or_archive] )) ||
_borg_repository_or_archive() {
local -A opts
zparseopts -A opts -D -E a p
if compset -P 1 '*::'; then
local qrepo=$IPREFIX[1,-3]
local -i def_repo=0
[[ -z $qrepo && -n $BORG_REPO ]] && qrepo=${(q)BORG_REPO} && def_repo=1
if [[ -n $qrepo ]]; then
if (( ! def_repo )); then
case $compstate[quote] in
(\') qrepo=${(qq)qrepo} ;;
(\") qrepo=${(qqq)${(e)qrepo}} ;;
# NOTE: currently `(e)` don't have any effect, but maybe one day zsh will stop to change the quoting method
# of double quoted parameters
esac
fi
if (( $+opts[-p] )); then
_borg_placeholder_or_archive $qrepo
else
_borg_archive $qrepo
fi
else
_message "not a borg repository: ${(Q)qrepo}"
return 1
fi
else
local -a suf
if ! compset -S '::*'; then
if (( $+opts[-a] )) || zstyle -T ":completion:${curcontext}:repositories" repository-suffix; then
suf=( -S '::' )
fi
local oqrepo="$PREFIX$SUFFIX"
local qrepo=$oqrepo
[[ $compstate[quote] != (\'|\") ]] && qrepo=${(Q)qrepo}
if __borg_is_borg_repo $qrepo; then
qrepo=${oqrepo%%/}
[[ -z $SUFFIX ]] && PREFIX=${PREFIX%%/} || SUFFIX=${SUFFIX%%/}
compadd -S '::' -r ':/ \t\n\-' -Q -- $qrepo
return
fi
fi
_borg_repository "$suf[@]"
fi
}
# _borg_archive [-F] [-n] [qrepo]
#
# -F don't apply archive filter options on the command line
# -n reverse order, disable matchers and don't do menu completion/selection
(( $+functions[_borg_archive] )) ||
_borg_archive() {
local -A opts
zparseopts -A opts -D -E F n
local qrepo=$1
if [[ -z $qrepo ]]; then
if [[ -n $BORG_REPO ]]; then
qrepo=${(q)BORG_REPO}
else
_message 'no repository specified'
return 1
fi
fi
local -i ret=1
_tags archives
while _tags; do
if _requested archives; then
local -a expl disp archive_filters
local -i reversed_order=1
if (( ! $+opts[-F] )); then
local -a archive_filter_options=( -P --prefix -a --glob-archives --first --last --sort-by ) tmp
local k
for k in $archive_filter_options; do
if [[ -n $opt_args[$k] ]]; then
IFS=: read -A tmp <<<$opt_args[$k]
archive_filters+=( $k=${^tmp:#} )
fi
done
fi
if (( $+opts[-n] )); then
__borg_skip_pattern_matching || return 1
disp+=( -U )
compstate[insert]=''
compstate[list]='list force'
reversed_order=0
fi
local -a asort
zstyle -a ":completion:${curcontext}:archives" archive-sort asort
if (( $asort[(I)inverse] )); then
(( reversed_order = ! reversed_order ))
fi
local -a sort_by=( --sort-by=${(M)^asort:#(timestamp|name|id)} )
# NOTE: in case of option repetition, the later one takes precedence
if (( ! $+__borg_archives_need_update )); then
comppostfuncs+=( __borg_unset_archives_need_update )
typeset -gHi __borg_archives_need_update=1
if (( ! $#archive_filters && ! $+opts[-n] )); then
local erepo
[[ -n $1 ]] && __borg_expand_path ${(Q)qrepo} erepo
local -a newest_file=( $erepo/(hints|index|integrity).<1->(#qN.om[1]) )
if [[ -n $newest_file ]]; then
if zmodload -F zsh/stat b:zstat 2>/dev/null; then
local -a stats
zstat -A stats +mtime $newest_file
local -i mtime=$stats[1]
if [[ $__borg_prev_repo == $erepo
&& __borg_prev_mtime -ge mtime
&& $__borg_prev_order == $reversed_order
&& $__borg_prev_sort_by == $sort_by ]]
then
__borg_archives_need_update=0
else
typeset -gH __borg_prev_repo=$erepo
typeset -gHi __borg_prev_mtime=mtime __borg_prev_order=reversed_order
typeset -gHa __borg_prev_sort_by=( $sort_by )
fi
fi
fi
else
unset __borg_prev_{repo,mtime,order,sort_by}
comppostfuncs+=( __borg_unset_archives )
fi
fi
if zstyle -t ":completion:${curcontext}:archives" verbose; then
if (( __borg_archives_need_update || ! $+__borg_archive_names || ! $+__borg_archive_descriptions )); then
__borg_archives_need_update=0
typeset -gHa __borg_archive_names=() __borg_archive_descriptions=()
local fmt descfmt name desc
zstyle -s ":completion:${curcontext}:archives" archive-description-format descfmt ||
descfmt='{archive:<36} {time} [{id}]'
fmt="{barchive}{NUL}$descfmt{NUL}"
_call_program -p archive-descriptions \
${(q)__borg_command:-borg} list --format=${(q)fmt} ${(q)sort_by} $archive_filters $qrepo 2>/dev/null |
while IFS= read -r -d $'\0' name && IFS= read -r -d $'\0' descr; do
__borg_archive_names[1,0]=( $name )
__borg_archive_descriptions[1,0]=( "$descr" )
done
(( $pipestatus[1] )) && {
_message "couldn't list repository: ${(Q)qrepo}"
unset __borg_prev_{repo,mtime,order,sort_by}
return 1
}
(( ! reversed_order )) &&
__borg_archive_names=( "${(@aO)__borg_archive_names}" ) &&
__borg_archive_descriptions=( "${(@aO)__borg_archive_descriptions}" )
fi
disp+=( -ld __borg_archive_descriptions )
elif (( __borg_archives_need_update || ! $+__borg_archive_names )); then
__borg_archives_need_update=0
typeset -gHa __borg_archive_names=()
local fmt='{barchive}{NUL}'
__borg_archive_names=( ${(@0aO)"$(_call_program -p archives \
${(q)__borg_command:-borg} list --format=${(q)fmt} ${(q)sort_by} $archive_filters $qrepo 2>/dev/null)"} )
(( $pipestatus[1] )) && {
_message "couldn't list repository: ${(Q)qrepo}"
unset __borg_prev_{repo,mtime,order,sort_by}
return 1
}
(( ! reversed_order )) &&
__borg_archive_names=( "${(@aO)__borg_archive_names}" )
fi
_all_labels archives expl 'ARCHIVE' compadd "$disp[@]" -a __borg_archive_names && ret=0
fi
(( ret )) || return 0
done
return 1
}
(( $+functions[__borg_unset_archives] )) ||
__borg_unset_archives() {
unset __borg_archive_names __borg_archive_descriptions
}
(( $+functions[__borg_unset_archives_need_update] )) ||
__borg_unset_archives_need_update() {
unset __borg_archives_need_update
}
(( $+functions[__borg_is_borg_repo] )) ||
__borg_is_borg_repo() {
local repo=$1
__borg_expand_path $repo repo
if [[ -d $repo && -d $repo/data ]]; then
local -a files=( $repo/(hints|index|integrity).<1->(#qN.) )
(( $#files >= 3 )) && return 0
fi
return 1
}
(( $+functions[__borg_expand_path] )) ||
__borg_expand_path() {
local _path=$1
local -a match mbegin mend
if [[ $_path == (#b)(\~[^/]#)(|/*) ]]; then
local etilde
etilde=$~match[1] 2>/dev/null
_path="$etilde$match[2]"
fi
_path=${(e)_path//\\\\/\\\\\\\\}
eval typeset -g ${2:-REPLY}=\$_path
}
(( $+functions[_borg_placeholder_or_archive] )) ||
_borg_placeholder_or_archive() {
local qrepo=$1
shift
_alternative \
'placeholders: :_borg_placeholders' \
"archives: : _borg_archive ${(q)qrepo}"
}
(( $+functions[_borg_placeholders] )) ||
_borg_placeholders() {
local -a placeholders=(
'hostname:The (short) hostname of the machine.'
'fqdn:The full name of the machine.'
'reverse-fqdn:The full name of the machine in reverse domain name notation.'
'now:The current local date and time, by default in ISO-8601 format. You can also supply your own format string, e.g. {now:%Y-%m-%d_%H:%M:%S}'
'utcnow:The current UTC date and time, by default in ISO-8601 format. You can also supply your own format string, e.g. {utcnow:%Y-%m-%d_%H:%M:%S}'
'user:The user name (or UID, if no name is available) of the user running borg.'
'pid:The current process ID.'
'borgversion:The version of borg, e.g.: 1.0.8rc1'
'borgmajor:The version of borg, only the major version, e.g.: 1'
'borgminor:The version of borg, only major and minor version, e.g.: 1.0'
'borgpatch:The version of borg, only major, minor and patch version, e.g.: 1.0.8'
)
__borg_complete_keys _describe -t placeholders 'placeholder' placeholders '"$copts[@]"'
}
(( $+functions[_borg_format_keys] )) ||
_borg_format_keys() {
local repo_or_arch=${(Q)1}
local -a keys=( NEWLINE NL NUL SPACE TAB CR LF )
local -a repository_keys=( archive name barchive comment bcomment id start time end hostname username )
local -a archive_keys=( type mode uid gid user group path bpath source linktarget flags size csize dsize dcsize
num_chunks unique_chunks mtime ctime atime isomtime isoctime isoatime blake2b blake2s md5 sha1 sha224 sha256 sha384
sha3_224 sha3_256 sha3_384 sha3_512 sha512 shake_128 shake_256 archiveid archivename extra health )
local akeys rkeys
akeys='archive-keys:archive keys:compadd -a archive_keys'
rkeys='repository-keys:repository keys:compadd -a repository_keys'
local -a alts=( 'keys:keys:compadd -a keys' )
if [[ $repo_or_arch == *::?* ]]; then
alts+=( $akeys )
elif [[ -n $repo_or_arch ]]; then
alts+=( $rkeys )
else
alts+=( $rkeys $akeys )
fi
__borg_complete_keys _alternative -O copts ${(q)alts}
}
(( $+functions[__borg_complete_keys] )) ||
__borg_complete_keys() {
compset -P '*[^A-Za-z]##'
compset -S '[^A-Za-z]##*'
[[ -n $ISUFFIX ]] && compstate[to_end]=''
# NOTE: `[[ -n $ISUFFIX ]]` is a workarond for a bug that causes cursor movement to the right further than it should
# NOTE: the _oldlist completer doesn't respect compstate[to_end]=''
local ipref suf
if [[ $IPREFIX[-1] != '{' ]]; then
ipref='{'
[[ $compstate[quote] != (\'|\") ]] && ipref='\{'
fi
if [[ $ISUFFIX[1] != (|\\)\} ]]; then
suf='}'
[[ $compstate[quote] != (\'|\") ]] && suf='\}'
fi
local -a copts=( -i "$ipref" -S "$suf" )
eval "$@"
}
# _borg_style_selector_or_archive_files [-e] [-p] archive default_style_selector
#
# -e apply exclusion options on the command line
# -p complete `--pattern`
# -f complete files rather than borg paths
(( $+functions[_borg_style_selector_or_archive_files] )) ||
_borg_style_selector_or_archive_files() {
local -A opts
zparseopts -A opts -D -E e p f
local arch=$1 default_style_selector=$2
shift 2
local -a match mbegin mend expl tags=( style-selectors archive-files ) ss_suf=( -S ':' -r ':' )
(( $+opts[-f] )) && tags=( style-selectors files )
local -i ret=1
if (( $+opts[-p] )); then
if ! compset -P '(#b)([RP\+\-\!])'; then
local -a pattern_rules=(
'P:pattern style'
'R:root path'
'+:include'
'-:exclude'
'!:exclude non-recurse'
)
_describe -t pattern-rules 'pattern rule' pattern_rules -S ''
return
else
if [[ $compstate[quote] == (\'|\") ]]; then
compset -P ' #'
else
compset -P '(\\ )#'
fi
if [[ $match[1] == 'R' ]]; then
default_style_selector='pp'
elif [[ $match[1] == 'P' ]]; then
tags=( style-selectors )
ss_suf=()
fi
fi
fi
_tags $tags
while _tags; do
if _requested style-selectors; then
_all_labels style-selectors expl 'style selector' \
__borg_style_selectors $default_style_selector "$ss_suf[@]" - && ret=0
fi
if _requested archive-files; then
_all_labels archive-files expl 'PATTERN' \
__borg_archive_files ${(k)opts} "$arch" $default_style_selector - && ret=0
fi
if _requested files; then
local -a borg_paths=( ${(Q)${(e)${~@}}} )
_all_labels files expl 'PATH' \
__borg_pattern_files ${(k)opts} borg_paths - && ret=0
fi
(( ret )) || return 0
done
return 1
}
(( $+functions[__borg_style_selectors] )) ||
__borg_style_selectors() {
local default_style_selector=$1 path_style_selector
shift
zstyle -s ":completion:${curcontext}:archive-files" path-style-selector path_style_selector ||
path_style_selector='fm'
local -a disp
local -A style_selectors
__borg_setup_style_selectors
if zstyle -T ":completion:${curcontext}:style-selectors" verbose; then
local -a style_selector_descriptions extra
local k v sep
for k v in ${(kv)style_selectors}; do
extra=()
[[ $k == $default_style_selector ]] && extra+=( 'default' )
[[ $k == $path_style_selector ]] && __borg_choose_path_or_pattern "" "$default_style_selector" &&
extra+=( 'path' )
(( $#extra )) && v+=" (${(j:, :)extra})"
style_selector_descriptions+=( "${${k//\\/\\\\}//:/\\:}:$v" )
done
zstyle -s ":completion:${curcontext}:style-selectors" list-separator sep || sep=--
zformat -a style_selector_descriptions " $sep " $style_selector_descriptions
disp=( -ld style_selector_descriptions )
fi
compadd "$disp[@]" "$@" -k style_selectors
}
(( $+functions[__borg_archive_files] )) ||
__borg_archive_files() {
local -A opts
zparseopts -A opts -D e p
local arch=$1 default_style_selector=$2
shift 2
if [[ -z $arch || $arch != *::?* ]]; then
_message 'no archive specified'
return 1
fi
local -a qargs tmp disp pref match mbegin mend archive_files descs
local -A style_selectors
local k cword fmt descfmt style_selector path_style_selector name descr
# take into account exclude options on the command line
if (( $+opts[-e] )); then
local -a exclude_options=( -e --exclude --exclude-from --pattern --pattern-from )
local -a excludes
for k in $exclude_options; do
if [[ -n $opt_args[$k] ]]; then
IFS=: read -A tmp <<<$opt_args[$k]
excludes+=( $k="${^tmp[@]}" )
fi
done
[[ -n $excludes ]] && qargs+=( "$excludes[@]" )
fi
(( $_matcher_num > 1 )) && return 1
__borg_skip_pattern_matching || return 1
cword="$PREFIX$SUFFIX"
[[ $compstate[quote] != (\'|\") ]] && cword=${(Q)cword}
[[ -z $cword ]] && return 1
if zstyle -t ":completion:${curcontext}:archive-files" verbose; then
zstyle -s ":completion:${curcontext}:archive-files" file-description-format descfmt ||
descfmt='{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}'
fmt="{bpath}{NUL}$descfmt{NUL}"
else
fmt='{bpath}{NUL}'
fi
qargs+=( --format=${(q)fmt} )
qargs+=( $arch )
__borg_setup_style_selectors
[[ $cword == (#b)(${~${(j:|:)${(kb)style_selectors}}}):* ]] && style_selector=$match[1]
local -i path_expected=0
__borg_choose_path_or_pattern "$style_selector" $default_style_selector $cword && path_expected=1
if [[ -n $cword ]]; then
if (( path_expected )); then
[[ -n $style_selector ]] && compset -P "$style_selector:" && pref=( -P "$style_selector:" )
cword="$PREFIX$SUFFIX"
[[ $compstate[quote] != (\'|\") ]] && cword=${(Q)cword}
zstyle -s ":completion:${curcontext}:archive-files" path-style-selector path_style_selector ||
path_style_selector='fm'
cword="$path_style_selector:$cword"
else
[[ -z $style_selector ]] && cword="$default_style_selector:$cword"
fi
qargs+=( ${(q)cword} )
fi
if zstyle -t ":completion:${curcontext}:archive-files" verbose; then
_call_program -p archive-file-descriptions ${(q)__borg_command:-borg} list $qargs 2>/dev/null |
while IFS= read -r -d $'\0' name && IFS= read -r -d $'\0' descr; do
archive_files+=( $name )
descs+=( $descr )
done
(( $pipestatus[1] )) && { _message "couldn't list archive: ${(Q)arch}"; return 1 }
disp=( -ld descs )
else
archive_files=( ${(0)"$(_call_program -p archive-files ${(q)__borg_command:-borg} list $qargs 2>/dev/null)"} )
(( $pipestatus[1] )) && { _message "couldn't list archive: ${(Q)arch}"; return 1 }
fi
if (( $#archive_files )); then
if (( path_expected )); then
compstate[insert]='automenu'
else
compstate[insert]=''
compstate[list]='list force'
fi
fi
compadd "$pref[@]" -U "$disp[@]" "$@" -a archive_files
}
(( $+functions[__borg_choose_path_or_pattern] )) ||
__borg_choose_path_or_pattern() {
local ss=$1 defss=$2 cword=$3
shift 2
[[ $ss == (pp|pf) || ( -z $ss && $defss == (pp|pf) ) ]]
}
# transform borg exclude patterns into zsh ignore patterns and then complete files
(( $+functions[__borg_pattern_files] )) ||
__borg_pattern_files() {
local -A opts
zparseopts -A opts -D -E e p f
local paths_varname=$1
shift
local -a args
local -A style_selectors
__borg_setup_style_selectors
local pr_pat='[RP\+\-\!]' ss_pat="(${(j:|:)${(@kb)style_selectors}}):"
local prs_pat="$pr_pat #"
if (( $+opts[-e] )); then
local -a borg_excludes exclude_options=( -e --exclude --pattern ) tmp
local k cword
local -i i
for k in $exclude_options; do
if [[ -n $opt_args[$k] ]]; then
IFS=: read -A tmp <<<$opt_args[$k]
tmp=( ${(Q)tmp} )
# lstrip style selectors and pattern rules
[[ $+opts[-p] -gt 0 || $k == --pattern ]] && tmp=( ${tmp#$~prs_pat} )
tmp=( ${tmp#$~ss_pat} )
# don't take into account the word under the cursor
cword="$PREFIX$SUFFIX"
[[ $compstate[quote] != (\'|\") ]] && cword=${(Q)cword}
[[ $+opts[-p] -gt 0 || $k == --pattern ]] && cword=${cword#$~prs_pat}
cword=${cword#$~ss_pat}
i=$tmp[(I)$cword]
(( i )) && tmp=( "${(@)tmp[1,i-1]}" "${(@)tmp[i+1,-1]}" )
borg_excludes+=( "$tmp[@]" )
fi
done
[[ -n $borg_excludes ]] && args+=( -F borg_excludes )
fi
[[ -n ${(P)paths_varname} ]] && args+=( -W $paths_varname )
args+=( "$@" )
# lstrip style selectors and pattern rules
if (( $+opts[-p] )); then
if [[ $compstate[quote] != (\'|\") ]]; then
compset -P $pr_pat
compset -P '(\\ )#'
else
compset -P $prs_pat
fi
fi
compset -P $ss_pat
compstate[insert]=''
compstate[list]='list force'
_path_files "$args[@]"
}
(( $+functions[__borg_setup_style_selectors] )) ||
__borg_setup_style_selectors() {
typeset -gA style_selectors=(
fm 'Fnmatch'
sh 'Shell-style patterns'
re 'Regular expressions'
pp 'Path prefix'
pf 'Path full-match'
)
}
(( $+functions[__borg_skip_pattern_matching] )) ||
__borg_skip_pattern_matching() {
# unset glob_complete
[[ $compstate[pattern_match] == '*' ]] && compstate[pattern_match]=''
# skip the _match completer
[[ -n $compstate[pattern_match] ]] && return 1
return 0
}
(( $+functions[_borg_config] )) ||
_borg_config() {
local qrepo=$1
shift
if (( ! $+__borg_config_sect )); then
comppostfuncs+=( __borg_unset_config )
typeset -gH __borg_config_sect=
typeset -gHa __borg_config_keys=()
local sect line
local -a match mbegin mend
_call_program -p keys ${(q)__borg_command:-borg} config --list $qrepo 2>/dev/null | {
IFS= read -r sect
sect=${${sect#\[}%\]}
__borg_config_sect=$sect
while IFS= read -r line && [[ $line == (#b)(*)\ =\ (*) ]]; do
__borg_config_keys+=( "${${match[1]//\\/\\\\}//:/\\:}:(current: $match[2])" )
done
}
fi
local -a alts=( 'keys:key: _describe -t keys "key" __borg_config_keys' )
compset -P "${__borg_config_sect}." || alts+=( 'sections:section:compadd -S "." $__borg_config_sect' )
_alternative $alts
}
(( $+functions[__borg_unset_config] )) ||
__borg_unset_config() {
unset __borg_config_sect __borg_config_keys
}
# A simple prefix-oriented completion function for compressors. Can be improved by supporting the suffix.
(( $+functions[_borg_compression] )) ||
_borg_compression() {
local -a nolvl=(
'none:do not compress'
'lz4:very high speed, very low compression'
)
local -a havelvl=(
'zstd:("zstandart")'
'zlib:("gz") medium speed, medium compression'
'lzma:("xz") low speed, high compression'
)
local -a auto=(
'auto:compress compressible, otherwise "none"'
)
local -a match mbegin mend
# NOTE: Zsh's `-prefix` condition is confused by the leading parenthesis in the pattern.
# Fortunately, we simply need to show a message.
if compset -P '(#b)(|auto,)(zstd|zlib|lzma),'; then
local -i from to def
case $match[2] in
(zstd) from=1 to=22 def=3 ;;
(zlib|lzma) from=0 to=9 def=6 ;;
esac
_message -e "compression level (from $from to $to, default: $def)"
elif compset -P 'auto,'; then
_describe -t compression 'compression' nolvl -- havelvl -qS,
else
_describe -t compression 'compression' nolvl -- havelvl -qS, -- auto -S,
fi
}
(( $+functions[_borg_chunker_params] )) ||
_borg_chunker_params() {
if compset -P '*,*,*,'; then
_message -e 'HASH_WINDOW_SIZE'
elif compset -P '*,*,'; then
_message -e 'HASH_MASK_BITS (target chunk size ~= 2^HASH_MASK_BITS B)'
elif compset -P '*,'; then
_message -e 'CHUNK_MAX_EXP (maximum chunk size = 2^CHUNK_MAX_EXP B)'
else
_message -e 'CHUNK_MIN_EXP (minimum chunk size = 2^CHUNK_MIN_EXP B)'
local -a params=(
'default:19,23,21,4095'
'19,23,21,4095:small amount of chunks (default)'
'10,23,16,4095:big amount of chunks'
)
_describe -t chunker-params 'typical chunker params' params
fi
}
(( $+functions[_borg_statuschars] )) ||
_borg_statuschars() {
_values -s '' 'STATUSCHARS' \
'A[regular file, added]' \
'M[regular file, modified]' \
'U[regular file, unchanged]' \
'E[regular file, an error happened while accessing/reading this file]' \
'd[directory]' \
'b[block device]' \
'c[char device]' \
'h[regular file, hardlink (to already seen inodes)]' \
's[symlink]' \
'f[fifo]' \
'i[backup data was read from standard input (stdin)]' \
'-[dry run, item was not backed up]' \
'x[excluded, item was not backed up]' \
'?[missing status code]'
}
(( $+functions[_borg_quota_suffixes] )) ||
_borg_quota_suffixes() {
if compset -P '[0-9]##'; then
local -a suffixes=(
'K:10 ** 3 bytes'
'M:10 ** 6 bytes'
'G:10 ** 9 bytes'
'T:10 ** 12 bytes'
'P:10 ** 15 bytes'
)
# NOTE: tag `suffixes` is already in use (file extensions)
_describe -t multiplier 'suffix' suffixes
else
_message -e 'QUOTA'
fi
}
(( $+functions[_borg_timestamp] )) ||
_borg_timestamp() {
_alternative \
"dates:TIMESTAMP: _dates -f '%FT%T'" \
'files:reference:_files'
}
(( $+functions[_borg_guard_unsigned_number] )) ||
_borg_guard_unsigned_number() {
local -A opts
zparseopts -K -D -A opts M+: J+: V+: 1 2 o+: n F: x+: X+:
_guard '[0-9]#' ${1:-number}
}
(( $+functions[_borg_guard_numeric_mode] )) ||
_borg_guard_numeric_mode() {
local -A opts
zparseopts -K -D -A opts M+: J+: V+: 1 2 o+: n F: x+: X+:
_guard '[0-7](#c0,4)' ${1:-mode}
}
_borg() {
local -a match mbegin mend line state
local curcontext="$curcontext" state_descr
typeset -A opt_args
local -i ret=1
if [[ $service == 'borg' ]]; then
local __borg_command=$words[1]
local -a common_options
__borg_setup_common_options
_arguments -s -w -C : \
'(- :)'{-V,--version}'[show version number and exit]' \
$common_options \
'(-): :->command' \
'(-)*:: :->option-or-argument' && return
case $state in
(command)
_borg_commands && ret=0
;;
(option-or-argument)
curcontext="${curcontext%:*:*}:borg-$words[1]:"
if ! _call_function ret _borg-$words[1]; then
_default && ret=0
fi
;;
esac
elif [[ $service == (#b)-value-,BORG_(*),-default- ]]; then
_borg_parameters $match[1] && ret=0
elif ! _call_function ret _$service; then
_default && ret=0
fi
return ret
}
_borg "$@"
borgbackup-1.1.15/scripts/shell_completions/fish/ 0000755 0001750 0001750 00000000000 13771325773 022056 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/shell_completions/fish/borg.fish 0000644 0001750 0001750 00000077645 13771325506 023677 0 ustar user user 0000000 0000000 # Completions for borg
# https://www.borgbackup.org/
# Note:
# Listing archives works on password protected repositories only if $BORG_PASSPHRASE is set.
# Install:
# Copy this file to /usr/share/fish/vendor_completions.d/
# Commands
complete -c borg -f -n __fish_is_first_token -a 'init' -d 'Initialize an empty repository'
complete -c borg -f -n __fish_is_first_token -a 'create' -d 'Create new archive'
complete -c borg -f -n __fish_is_first_token -a 'extract' -d 'Extract archive contents'
complete -c borg -f -n __fish_is_first_token -a 'check' -d 'Check repository consistency'
complete -c borg -f -n __fish_is_first_token -a 'rename' -d 'Rename an existing archive'
complete -c borg -f -n __fish_is_first_token -a 'list' -d 'List archive or repository contents'
complete -c borg -f -n __fish_is_first_token -a 'diff' -d 'Find differences between archives'
complete -c borg -f -n __fish_is_first_token -a 'delete' -d 'Delete a repository or archive'
complete -c borg -f -n __fish_is_first_token -a 'prune' -d 'Prune repository archives'
complete -c borg -f -n __fish_is_first_token -a 'info' -d 'Show archive details'
complete -c borg -f -n __fish_is_first_token -a 'mount' -d 'Mount archive or a repository'
complete -c borg -f -n __fish_is_first_token -a 'umount' -d 'Un-mount the mounted archive'
function __fish_borg_seen_key
if __fish_seen_subcommand_from key
and not __fish_seen_subcommand_from import export change-passphrase
return 0
end
return 1
end
complete -c borg -f -n __fish_is_first_token -a 'key' -d 'Manage a repository key'
complete -c borg -f -n __fish_borg_seen_key -a 'import' -d 'Import a repository key'
complete -c borg -f -n __fish_borg_seen_key -a 'export' -d 'Export a repository key'
complete -c borg -f -n __fish_borg_seen_key -a 'change-passphrase' -d 'Change key file passphrase'
complete -c borg -f -n __fish_is_first_token -a 'serve' -d 'Start in server mode'
complete -c borg -f -n __fish_is_first_token -a 'upgrade' -d 'Upgrade a repository'
complete -c borg -f -n __fish_is_first_token -a 'recreate' -d 'Recreate contents of existing archives'
complete -c borg -f -n __fish_is_first_token -a 'export-tar' -d 'Create tarball from an archive'
complete -c borg -f -n __fish_is_first_token -a 'with-lock' -d 'Run a command while repository lock held'
complete -c borg -f -n __fish_is_first_token -a 'break-lock' -d 'Break the repository lock'
complete -c borg -f -n __fish_is_first_token -a 'config' -d 'Get/set options in repo/cache config'
function __fish_borg_seen_benchmark
if __fish_seen_subcommand_from benchmark
and not __fish_seen_subcommand_from crud
return 0
end
return 1
end
complete -c borg -f -n __fish_is_first_token -a 'benchmark' -d 'Benchmark borg operations'
complete -c borg -f -n __fish_borg_seen_benchmark -a 'crud' -d 'Benchmark borg CRUD operations'
function __fish_borg_seen_help
if __fish_seen_subcommand_from help
and not __fish_seen_subcommand_from patterns placeholders compression
return 0
end
return 1
end
complete -c borg -f -n __fish_is_first_token -a 'help' -d 'Miscellaneous Help'
complete -c borg -f -n __fish_borg_seen_help -a 'patterns' -d 'Help for patterns'
complete -c borg -f -n __fish_borg_seen_help -a 'placeholders' -d 'Help for placeholders'
complete -c borg -f -n __fish_borg_seen_help -a 'compression' -d 'Help for compression'
# Common options
complete -c borg -f -s h -l 'help' -d 'Show help information'
complete -c borg -f -l 'version' -d 'Show version information'
complete -c borg -f -l 'critical' -d 'Log level CRITICAL'
complete -c borg -f -l 'error' -d 'Log level ERROR'
complete -c borg -f -l 'warning' -d 'Log level WARNING (default)'
complete -c borg -f -l 'info' -d 'Log level INFO'
complete -c borg -f -s v -l 'verbose' -d 'Log level INFO'
complete -c borg -f -l 'debug' -d 'Log level DEBUG'
complete -c borg -f -l 'debug-topic' -d 'Enable TOPIC debugging'
complete -c borg -f -s p -l 'progress' -d 'Show progress information'
complete -c borg -f -l 'log-json' -d 'Output one JSON object per log line'
complete -c borg -f -l 'lock-wait' -d 'Wait for lock max N seconds [1]'
complete -c borg -f -l 'show-version' -d 'Log version information'
complete -c borg -f -l 'show-rc' -d 'Log the return code'
complete -c borg -f -l 'umask' -d 'Set umask to M [0077]'
complete -c borg -l 'remote-path' -d 'Use PATH as remote borg executable'
complete -c borg -f -l 'remote-ratelimit' -d 'Set remote network upload RATE limit'
complete -c borg -f -l 'consider-part-files' -d 'Treat part files like normal files'
complete -c borg -l 'debug-profile' -d 'Write execution profile into FILE'
complete -c borg -l 'rsh' -d 'Use COMMAND instead of ssh'
# borg init options
set -l encryption_modes "none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2"
complete -c borg -f -s e -l 'encryption' -d 'Encryption key MODE' -a "$encryption_modes" -n "__fish_seen_subcommand_from init"
complete -c borg -f -l 'append-only' -d 'Create an append-only mode repository' -n "__fish_seen_subcommand_from init"
complete -c borg -f -l 'storage-quota' -d 'Set storage QUOTA of the repository' -n "__fish_seen_subcommand_from init"
complete -c borg -f -l 'make-parent-dirs' -d 'Create parent directories' -n "__fish_seen_subcommand_from init"
# borg create options
complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from create"
complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'json' -d 'Print verbose stats as json' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'no-cache-sync' -d 'Do not synchronize the cache' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'stdin-name' -d 'Use NAME in archive for stdin data' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'stdin-user' -d 'Set user USER in archive for stdin data [root]' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'stdin-group' -d 'Set group GROUP in archive for stdin data [root]' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'stdin-mode' -d 'Set mode to M in archive for stdin data [0660]' -n "__fish_seen_subcommand_from create"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from create"
complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'exclude-nodump' -d 'Exclude files flagged NODUMP' -n "__fish_seen_subcommand_from create"
# Filesytem options
complete -c borg -f -s x -l 'one-file-system' -d 'Stay in the same file system' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'numeric-owner' -d 'Only store numeric user:group identifiers' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'noatime' -d 'Do not store atime' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'noctime' -d 'Do not store ctime' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'nobirthtime' -d 'Do not store creation date' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'nobsdflags' -d 'Do not store bsdflags' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'ignore-inode' -d 'Ignore inode data in file metadata cache' -n "__fish_seen_subcommand_from create"
set -l files_cache_mode "ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime disabled"
complete -c borg -f -l 'files-cache' -d 'Operate files cache in MODE' -a "$files_cache_mode" -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'read-special' -d 'Open device files like regular files' -n "__fish_seen_subcommand_from create"
# Archive options
complete -c borg -f -l 'comment' -d 'Add COMMENT to the archive' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'timestamp' -d 'Set creation TIME (yyyy-mm-ddThh:mm:ss)' -n "__fish_seen_subcommand_from create"
complete -c borg -l 'timestamp' -d 'Set creation time by reference FILE' -n "__fish_seen_subcommand_from create"
complete -c borg -f -s c -l 'checkpoint-interval' -d 'Write checkpoint every N seconds [1800]' -n "__fish_seen_subcommand_from create"
complete -c borg -f -l 'chunker-params' -d 'Chunker PARAMETERS [19,23,21,4095]' -n "__fish_seen_subcommand_from create"
set -l compression_methods "none auto lz4 zstd,1 zstd,2 zstd,3 zstd,4 zstd,5 zstd,6 zstd,7 zstd,8 zstd,9 zstd,10 zstd,11 zstd,12 zstd,13 zstd,14 zstd,15 zstd,16 zstd,17 zstd,18 zstd,19 zstd,20 zstd,21 zstd,22 zlib,1 zlib,2 zlib,3 zlib,4 zlib,5 zlib,6 zlib,7 zlib,8 zlib,9 lzma,0 lzma,1 lzma,2 lzma,3 lzma,4 lzma,5 lzma,6 lzma,7 lzma,8 lzma,9"
complete -c borg -f -s C -l 'compression' -d 'Select compression ALGORITHM,LEVEL [lz4]' -a "$compression_methods" -n "__fish_seen_subcommand_from create"
# borg extract options
complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from extract"
complete -c borg -f -s n -l 'dry-run' -d 'Do not actually extract any files' -n "__fish_seen_subcommand_from extract"
complete -c borg -f -l 'numeric-owner' -d 'Only obey numeric user:group identifiers' -n "__fish_seen_subcommand_from extract"
complete -c borg -f -l 'nobsdflags' -d 'Do not extract/set bsdflags' -n "__fish_seen_subcommand_from extract"
complete -c borg -f -l 'stdout' -d 'Write all extracted data to stdout' -n "__fish_seen_subcommand_from extract"
complete -c borg -f -l 'sparse' -d 'Create holes in output sparse file' -n "__fish_seen_subcommand_from extract"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from extract"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from extract"
complete -c borg -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from extract"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from extract"
complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from extract"
# borg check options
complete -c borg -f -l 'repository-only' -d 'Only perform repository checks' -n "__fish_seen_subcommand_from check"
complete -c borg -f -l 'archives-only' -d 'Only perform archives checks' -n "__fish_seen_subcommand_from check"
complete -c borg -f -l 'verify-data' -d 'Cryptographic integrity verification' -n "__fish_seen_subcommand_from check"
complete -c borg -f -l 'repair' -d 'Attempt to repair found inconsistencies' -n "__fish_seen_subcommand_from check"
complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from check"
# Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from check"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from check"
set -l sort_keys "timestamp name id"
complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from check"
complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from check"
complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from check"
# borg rename
# no specific options
# borg list options
complete -c borg -f -l 'short' -d 'Only print file/directory names' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'list-format' -d 'Specify FORMAT for file listing' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'format' -d 'Specify FORMAT for file listing' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'json' -d 'List contents in json format' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'json-lines' -d 'List contents in json lines format' -n "__fish_seen_subcommand_from list"
# Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from list"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from list"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from list"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from list"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from list"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from list"
# borg diff options
complete -c borg -f -l 'numeric-owner' -d 'Only consider numeric user:group' -n "__fish_seen_subcommand_from diff"
complete -c borg -f -l 'same-chunker-params' -d 'Override check of chunker parameters' -n "__fish_seen_subcommand_from diff"
complete -c borg -f -l 'sort' -d 'Sort the output lines by file path' -n "__fish_seen_subcommand_from diff"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from diff"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from diff"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from diff"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from diff"
# borg delete options
complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'cache-only' -d "Delete only the local cache" -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'force' -d 'Force deletion of corrupted archives' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from delete"
# Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from delete"
complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from delete"
# borg prune options
complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'force' -d 'Force pruning of corrupted archives' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'keep-within' -d 'Keep archives within time INTERVAL' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'keep-last' -d 'NUMBER of secondly archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'keep-secondly' -d 'NUMBER of secondly archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'keep-minutely' -d 'NUMBER of minutely archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s H -l 'keep-hourly' -d 'NUMBER of hourly archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s d -l 'keep-daily' -d 'NUMBER of daily archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s w -l 'keep-weekly' -d 'NUMBER of weekly archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s m -l 'keep-monthly' -d 'NUMBER of monthly archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s y -l 'keep-yearly' -d 'NUMBER of yearly archives to keep' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from prune"
# Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from prune"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from prune"
# borg info options
complete -c borg -f -l 'json' -d 'Format output in json format' -n "__fish_seen_subcommand_from info"
# Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from info"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from info"
complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from info"
complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from info"
complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from info"
# borg mount options
complete -c borg -f -s f -l 'foreground' -d 'Stay in foreground, do not daemonize' -n "__fish_seen_subcommand_from mount"
# FIXME This list is probably not full, but I tried to pick only those that are relevant to borg mount -o:
set -l fuse_options "ac_attr_timeout= allow_damaged_files allow_other allow_root attr_timeout= auto auto_cache auto_unmount default_permissions entry_timeout= gid= group_id= kernel_cache max_read= negative_timeout= noauto noforget remember= remount rootmode= uid= umask= user user_id= versions"
complete -c borg -f -s o -d 'Fuse mount OPTION' -a "$fuse_options" -n "__fish_seen_subcommand_from mount"
# Archive filters
complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from mount"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from mount"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from mount"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from mount"
complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from mount"
# borg umount
# no specific options
# borg key change-passphrase
# no specific options
# borg key export
complete -c borg -f -l 'paper' -d 'Create an export for printing' -n "__fish_seen_subcommand_from export"
complete -c borg -f -l 'qr-html' -d 'Create an html file for printing and qr' -n "__fish_seen_subcommand_from export"
# borg key import
complete -c borg -f -l 'paper' -d 'Import from a backup done with --paper' -n "__fish_seen_subcommand_from import"
# borg upgrade
complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from upgrade"
complete -c borg -f -l 'inplace' -d 'Rewrite repository in place' -n "__fish_seen_subcommand_from upgrade"
complete -c borg -f -l 'force' -d 'Force upgrade' -n "__fish_seen_subcommand_from upgrade"
complete -c borg -f -l 'tam' -d 'Enable manifest authentication' -n "__fish_seen_subcommand_from upgrade"
complete -c borg -f -l 'disable-tam' -d 'Disable manifest authentication' -n "__fish_seen_subcommand_from upgrade"
# borg recreate
complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from recreate"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from recreate"
complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from recreate"
# Archive options
complete -c borg -f -l 'target' -d "Create a new ARCHIVE" -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -s c -l 'checkpoint-interval' -d 'Write checkpoint every N seconds [1800]' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'comment' -d 'Add COMMENT to the archive' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'timestamp' -d 'Set creation TIME (yyyy-mm-ddThh:mm:ss)' -n "__fish_seen_subcommand_from recreate"
complete -c borg -l 'timestamp' -d 'Set creation time using reference FILE' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -s C -l 'compression' -d 'Select compression ALGORITHM,LEVEL [lz4]' -a "$compression_methods" -n "__fish_seen_subcommand_from recreate"
set -l recompress_when "if-different always never"
complete -c borg -f -l 'recompress' -d 'Recompress chunks CONDITION' -a "$recompress_when" -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'chunker-params' -d 'Chunker PARAMETERS [19,23,21,4095]' -n "__fish_seen_subcommand_from recreate"
# borg export-tar options
complete -c borg -l 'tar-filter' -d 'Filter program to pipe data through' -n "__fish_seen_subcommand_from export-tar"
complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from export-tar"
# Exclusion options
complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate"
complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from recreate"
complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from recreate"
# borg serve
complete -c borg -l 'restrict-to-path' -d 'Restrict repository access to PATH' -n "__fish_seen_subcommand_from serve"
complete -c borg -l 'restrict-to-repository' -d 'Restrict repository access at PATH' -n "__fish_seen_subcommand_from serve"
complete -c borg -f -l 'append-only' -d 'Only allow appending to repository' -n "__fish_seen_subcommand_from serve"
complete -c borg -f -l 'storage-quota' -d 'Override storage QUOTA of the repository' -n "__fish_seen_subcommand_from serve"
# borg config
complete -c borg -f -s c -l 'cache' -d 'Get/set/list values in the repo cache' -n "__fish_seen_subcommand_from config"
complete -c borg -f -s d -l 'delete' -d 'Delete the KEY from the config' -n "__fish_seen_subcommand_from config"
complete -c borg -f -l 'list' -d 'List the configuration of the repo' -n "__fish_seen_subcommand_from config"
# borg with-lock
# no specific options
# borg break-lock
# no specific options
# borg benchmark
# no specific options
# borg help
# no specific options
# List repositories::archives
function __fish_borg_is_argument_n --description 'Test if current argument is on Nth place' --argument n
set tokens (commandline --current-process --tokenize --cut-at-cursor)
set -l tokencount 0
for token in $tokens
switch $token
case '-*'
# ignore command line switches
case '*'
set tokencount (math $tokencount+1)
end
end
return (test $tokencount -eq $n)
end
function __fish_borg_is_dir_a_repository
set -l config_content
if test -f $argv[1]/README
and test -f $argv[1]/config
read config_content < $argv[1]/config ^/dev/null
end
return (string match --quiet '[repository]' $config_content)
end
function __fish_borg_list_repos_or_archives
if string match --quiet --regex '.*::' '"'(commandline --current-token)'"'
# If the current token contains "::" then list the archives:
set -l repository_name (string replace --regex '::.*' '' (commandline --current-token))
borg list --format="$repository_name::{archive}{NEWLINE}" "$repository_name" ^/dev/null
else
# Otherwise list the repositories, directories and user@host entries:
set -l directories (commandline --cut-at-cursor --current-token)*/
for directoryname in $directories
if __fish_borg_is_dir_a_repository $directoryname
printf '%s::\t%s\n' (string trim --right --chars='/' $directoryname) "Repository"
else
printf '%s\n' $directoryname
end
end
__fish_complete_user_at_hosts | string replace --regex '$' ':'
end
end
complete -c borg -f -n "__fish_borg_is_argument_n 2" -a '(__fish_borg_list_repos_or_archives)'
# Second archive listing for borg diff
function __fish_borg_is_diff_second_archive
return (string match --quiet --regex ' diff .*::[^ ]+ '(commandline --current-token)'$' (commandline))
end
function __fish_borg_list_diff_archives
set -l repo_matches (string match --regex '([^ ]*)::' (commandline))
borg list --format="{archive}{NEWLINE}" "$repo_matches[2]" ^/dev/null
end
complete -c borg -f -n __fish_borg_is_diff_second_archive -a '(__fish_borg_list_diff_archives)'
borgbackup-1.1.15/scripts/shell_completions/bash/ 0000755 0001750 0001750 00000000000 13771325773 022042 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/shell_completions/bash/borg 0000644 0001750 0001750 00000021235 13771325506 022713 0 ustar user user 0000000 0000000 # Completions for borg
# https://www.borgbackup.org/
# Note:
# Listing archives works on password protected repositories only if $BORG_PASSPHRASE is set.
# Install:
# Copy this file to /usr/share/bash-completion/completions/ or /etc/bash_completion.d/
_borg()
{
compopt -o default
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
local prevprev="${COMP_WORDS[COMP_CWORD-2]}"
local common_opts="-h --help --version --critical --error --warning --info -v --verbose --debug --debug-topic -p --progress --log-json --lock-wait --show-version --show-rc --umask --remote-path --remote-ratelimit --consider-part-files --debug-profile --rsh"
local opts="${common_opts}"
# Commands
if [[ ${COMP_CWORD} == 1 ]] ; then
local borg_commands="init create extract check rename list diff delete prune info mount umount key serve upgrade recreate export-tar with-lock break-lock config benchmark help"
COMPREPLY=( $(compgen -W "${borg_commands}" -- ${cur}) )
compopt +o default
return 0
fi
case "${prev}" in
'key')
COMPREPLY=( $(compgen -W "import export change-passphrase" -- ${cur}) )
return 0
;;
'benchmark')
COMPREPLY=( $(compgen -W "crud" -- ${cur}) )
return 0
;;
'help')
COMPREPLY=( $(compgen -W "patterns placeholders compression" -- ${cur}) )
return 0
;;
'--encryption' | '-e')
local encryption_modes="none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2"
COMPREPLY=( $(compgen -W "${encryption_modes}" -- ${cur}) )
return 0
;;
'--files-cache')
local files_cache_mode="ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime disabled"
COMPREPLY=( $(compgen -W "${files_cache_mode}" -- ${cur}) )
return 0
;;
'--compression' | '-C')
local compression_methods="none auto lz4 zstd,1 zstd,2 zstd,3 zstd,4 zstd,5 zstd,6 zstd,7 zstd,8 zstd,9 zstd,10 zstd,11 zstd,12 zstd,13 zstd,14 zstd,15 zstd,16 zstd,17 zstd,18 zstd,19 zstd,20 zstd,21 zstd,22 zlib,1 zlib,2 zlib,3 zlib,4 zlib,5 zlib,6 zlib,7 zlib,8 zlib,9 lzma,0 lzma,1 lzma,2 lzma,3 lzma,4 lzma,5 lzma,6 lzma,7 lzma,8 lzma,9"
COMPREPLY=( $(compgen -W "${compression_methods}" -- ${cur}) )
return 0
;;
'--sort-by')
local sort_keys="timestamp name id"
COMPREPLY=( $(compgen -W "${sort_keys}" -- ${cur}) )
return 0
;;
'-o')
# FIXME This list is probably not full, but I tried to pick only those that are relevant to borg mount -o:
local fuse_options="ac_attr_timeout= allow_damaged_files allow_other allow_root attr_timeout= auto auto_cache auto_unmount default_permissions entry_timeout= gid= group_id= kernel_cache max_read= negative_timeout= noauto noforget remember= remount rootmode= uid= umask= user user_id= versions"
COMPREPLY=( $(compgen -W "${fuse_options}" -- ${cur}) )
return 0
;;
'--recompress')
local recompress_when="if-different always never"
COMPREPLY=( $(compgen -W "${recompress_when}" -- ${cur}) )
return 0
;;
esac
if [[ ${cur} == -* ]] ; then
case "${COMP_LINE}" in
*' init '*)
local opts="-e --encryption --append-only --storage-quota --make-parent-dirs ${common_opts}"
;;
*' create '*)
local opts="-n --dry-run -s --stats --list --filter --json --no-cache-sync --stdin-name --stdin-user --stdin-group --stdin-mode -e --exclude --exclude-from --pattern --patterns-from --exclude-caches --exclude-if-present --keep-exclude-tags --keep-tag-files --exclude-nodump -x --one-file-system --numeric-owner --noatime --noctime --nobirthtime --nobsdflags --ignore-inode --files-cache --read-special --comment --timestamp -c --checkpoint-interval --chunker-params -C --compression ${common_opts}"
;;
*' extract '*)
local opts="--list -n --dry-run --numeric-owner --nobsdflags --stdout --sparse -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}"
;;
*' check '*)
local opts="--repository-only --archives-only --verify-data --repair --save-space -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}"
;;
# rename
# no specific options
*" list "*)
local opts="--short --list-format --format --json --json-lines -P --prefix -a --glob-archives --sort-by --first --last -e --exclude --exclude-from --pattern --patterns-from ${common_opts}"
;;
*' diff '*)
local opts="--numeric-owner --same-chunker-params --sort -e --exclude --exclude-from --pattern --patterns-from ${common_opts}"
;;
*' delete '*)
local opts="-n --dry-run -s --stats --cache-only --force --save-space -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}"
;;
*' prune '*)
local opts="-n --dry-run --force -s --stats --list --keep-within --keep-last --keep-secondly --keep-minutely -H --keep-hourly -d --keep-daily -w --keep-weekly -m --keep-monthly -y --keep-yearly --save-space -P --prefix -a --glob-archives ${common_opts}"
;;
*' info '*)
local opts="--json -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}"
;;
*' mount '*)
local opts="-f --foreground -o -P --prefix -a --glob-archives --sort-by --first --last -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}"
;;
# umount
# no specific options
# key change-passphrase
# no specific options
*' export '*)
local opts="--paper --qr-html ${common_opts}"
;;
*' import '*)
local opts="--paper ${common_opts}"
;;
*' upgrade '*)
local opts="-n --dry-run --inplace --force --tam --disable-tam ${common_opts}"
;;
*' recreate '*)
local opts="--list --filter -n dry-run -s stats -e exclude --exclude-from --pattern --patterns-from --exclude-caches --exclude-if-present --keep-exclude-tags --keep-tag-files --target -c checkpoint-interval --comment --timestamp --timestamp -C compression --recompress --chunker-params ${common_opts}"
;;
*' export-tar '*)
local opts="--tar-filter --list -e exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}"
;;
*' serve '*)
local opts="--restrict-to-path --restrict-to-repository --append-only --storage-quota ${common_opts}"
;;
*' config '*)
local opts="-c --cache -d --delete --list ${common_opts}"
;;
# with-lock
# no specific options
# break-lock
# no specific options
# benchmark crud
# no specific options
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
# Listing archives.
# Since "::" is treated as separate word in bash,
# it is $cur when the cursor is right behind it
# and $prev if the user has started to type an archive name.
local repository_name="" # If set, we'll list the archives
local typed_word=""
if [[ ${cur} == "::" ]] ; then
repository_name=${prev}
fi
if [[ ${prev} == "::" ]] ; then
repository_name=${prevprev}
typed_word=${cur}
fi
# Second archive listing for borg diff
if [[ ${COMP_LINE} =~ ^.*\ diff\ .*::[^\ ]+\ ${cur}$ ]] ; then
repository_name=`expr match "${COMP_LINE}" "\(.*\)::"`
repository_name=${repository_name##* }
typed_word=${cur}
fi
if [[ ${repository_name} != "" ]] ; then
if [[ ${COMP_LINE} == *" ::"* ]] ; then
# There is a space before the "::"
# which means that no repository name was typed,
# so probably $BORG_REPO is set.
repository_name=""
fi
local archive_list=$(borg list --short "${repository_name}" 2>/dev/null)
COMPREPLY=( $(compgen -W "${archive_list}" -- "${typed_word}" ) )
return 0
fi
return 0
}
complete -F _borg borg
borgbackup-1.1.15/scripts/py36-blake2.py 0000644 0001750 0001750 00000001746 13771325506 017715 0 ustar user user 0000000 0000000
"""
This script checks compatibility of crypto.blake2b_256 against hashlib.blake2b in CPython 3.6.
"""
import hashlib
import sys
def test_b2(b2_input, b2_output):
digest = hashlib.blake2b(b2_input, digest_size=32).digest()
identical = b2_output == digest
print('Input: ', b2_input.hex())
print('Expected: ', b2_output.hex())
print('Calculated:', digest.hex())
print('Identical: ', identical)
print()
if not identical:
sys.exit(1)
test_b2(
bytes.fromhex('037fb9b75b20d623f1d5a568050fccde4a1b7c5f5047432925e941a17c7a2d0d7061796c6f6164'),
bytes.fromhex('a22d4fc81bb61c3846c334a09eaf28d22dd7df08c9a7a41e713ef28d80eebd45')
)
test_b2(
b'abc',
bytes.fromhex('bddd813c634239723171ef3fee98579b94964e3bb1cb3e427262c8c068d52319')
)
test_b2(
bytes.fromhex('e944973af2256d4d670c12dd75304c319f58f4e40df6fb18ef996cb47e063676') + b'1234567890' * 100,
bytes.fromhex('97ede832378531dd0f4c668685d166e797da27b47d8cd441e885b60abd5e0cb2'),
)
borgbackup-1.1.15/scripts/errorlist.py 0000755 0001750 0001750 00000000624 13771325506 020000 0 ustar user user 0000000 0000000 #!/usr/bin/env python3
from textwrap import indent
import borg.archiver
from borg.helpers import Error, ErrorWithTraceback
classes = Error.__subclasses__() + ErrorWithTraceback.__subclasses__()
for cls in sorted(classes, key=lambda cls: (cls.__module__, cls.__qualname__)):
if cls is ErrorWithTraceback:
continue
print(' ', cls.__qualname__)
print(indent(cls.__doc__, ' ' * 8))
borgbackup-1.1.15/scripts/glibc_check.py 0000755 0001750 0001750 00000003231 13771325506 020165 0 ustar user user 0000000 0000000 #!/usr/bin/env python3
"""
Check if all given binaries work with the given glibc version.
glibc_check.py 2.11 bin [bin ...]
rc = 0 means "yes", rc = 1 means "no".
"""
import re
import subprocess
import sys
verbose = True
objdump = "objdump -T %s"
glibc_re = re.compile(r'GLIBC_([0-9]\.[0-9]+)')
def parse_version(v):
major, minor = v.split('.')
return int(major), int(minor)
def format_version(version):
return "%d.%d" % version
def main():
given = parse_version(sys.argv[1])
filenames = sys.argv[2:]
overall_versions = set()
for filename in filenames:
try:
output = subprocess.check_output(objdump % filename, shell=True,
stderr=subprocess.STDOUT)
output = output.decode('utf-8')
versions = set(parse_version(match.group(1))
for match in glibc_re.finditer(output))
requires_glibc = max(versions)
overall_versions.add(requires_glibc)
if verbose:
print("%s %s" % (filename, format_version(requires_glibc)))
except subprocess.CalledProcessError:
if verbose:
print("%s errored." % filename)
wanted = max(overall_versions)
ok = given >= wanted
if verbose:
if ok:
print("The binaries work with the given glibc %s." %
format_version(given))
else:
print("The binaries do not work with the given glibc %s. "
"Minimum is: %s" % (format_version(given), format_version(wanted)))
return ok
if __name__ == '__main__':
ok = main()
sys.exit(0 if ok else 1)
borgbackup-1.1.15/scripts/fuzz-cache-sync/ 0000755 0001750 0001750 00000000000 13771325773 020413 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/fuzz-cache-sync/HOWTO 0000644 0001750 0001750 00000000551 13771325506 021231 0 ustar user user 0000000 0000000 - Install AFL and the requirements for LLVM mode (see docs)
- Compile the fuzzing target, e.g.
AFL_HARDEN=1 afl-clang-fast main.c -o fuzz-target -O3
(other options, like using ASan or MSan are possible as well)
- Add additional test cases to testcase_dir
- Run afl, easiest (but inefficient) way;
afl-fuzz -i testcase_dir -o findings_dir ./fuzz-target
borgbackup-1.1.15/scripts/fuzz-cache-sync/main.c 0000644 0001750 0001750 00000001301 13771325506 021470 0 ustar user user 0000000 0000000
#define BORG_NO_PYTHON
#include "../../src/borg/_hashindex.c"
#include "../../src/borg/cache_sync/cache_sync.c"
#define BUFSZ 32768
int main() {
char buf[BUFSZ];
int len, ret;
CacheSyncCtx *ctx;
HashIndex *idx;
/* capacity, key size, value size */
idx = hashindex_init(0, 32, 12);
ctx = cache_sync_init(idx);
while (1) {
len = read(0, buf, BUFSZ);
if (!len) {
break;
}
ret = cache_sync_feed(ctx, buf, len);
if(!ret && cache_sync_error(ctx)) {
fprintf(stderr, "error: %s\n", cache_sync_error(ctx));
return 1;
}
}
hashindex_free(idx);
cache_sync_free(ctx);
return 0;
}
borgbackup-1.1.15/scripts/fuzz-cache-sync/testcase_dir/ 0000755 0001750 0001750 00000000000 13771325773 023064 5 ustar user user 0000000 0000000 borgbackup-1.1.15/scripts/fuzz-cache-sync/testcase_dir/test_simple 0000644 0001750 0001750 00000000223 13771325506 025326 0 ustar user user 0000000 0000000 ��foo�bar�baz�ңbar�.�user�chunks�chunks��� 00000000000000000000000000000001�� 00000000000000000000000000000002 borgbackup-1.1.15/scripts/upload-pypi 0000755 0001750 0001750 00000000431 13771325506 017563 0 ustar user user 0000000 0000000 #!/bin/bash
R=$1
if [ "$R" = "" ]; then
echo "Usage: upload-pypi 1.2.3 [test]"
exit
fi
if [ "$2" = "test" ]; then
export TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/
else
export TWINE_REPOSITORY_URL=
fi
D=dist/borgbackup-$R.tar.gz
twine upload $D.asc $D
borgbackup-1.1.15/setup_b2.py 0000644 0001750 0001750 00000004657 13771325506 016016 0 ustar user user 0000000 0000000 # Support code for building a C extension with blake2 files
#
# Copyright (c) 2016-present, Gregory Szorc (original code for zstd)
# 2017-present, Thomas Waldmann (mods to make it more generic, code for blake2)
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
# b2 files, structure as seen in BLAKE2 (reference implementation) project repository:
b2_sources = [
'ref/blake2b-ref.c',
]
b2_includes = [
'ref',
]
def b2_system_prefix(prefixes):
for prefix in prefixes:
filename = os.path.join(prefix, 'include', 'blake2.h')
if os.path.exists(filename):
with open(filename, 'rb') as fd:
if b'blake2b_init' in fd.read():
return prefix
def b2_ext_kwargs(bundled_path, system_prefix=None, system=False, **kwargs):
"""amend kwargs with b2 stuff for a distutils.extension.Extension initialization.
bundled_path: relative (to this file) path to the bundled library source code files
system_prefix: where the system-installed library can be found
system: True: use the system-installed shared library, False: use the bundled library code
kwargs: distutils.extension.Extension kwargs that should be amended
returns: amended kwargs
"""
def multi_join(paths, *path_segments):
"""apply os.path.join on a list of paths"""
return [os.path.join(*(path_segments + (path, ))) for path in paths]
use_system = system and system_prefix is not None
sources = kwargs.get('sources', [])
if not use_system:
sources += multi_join(b2_sources, bundled_path)
include_dirs = kwargs.get('include_dirs', [])
if use_system:
include_dirs += multi_join(['include'], system_prefix)
else:
include_dirs += multi_join(b2_includes, bundled_path)
library_dirs = kwargs.get('library_dirs', [])
if use_system:
library_dirs += multi_join(['lib'], system_prefix)
libraries = kwargs.get('libraries', [])
if use_system:
libraries += ['b2', ]
extra_compile_args = kwargs.get('extra_compile_args', [])
if not use_system:
extra_compile_args += [] # not used yet
ret = dict(**kwargs)
ret.update(dict(sources=sources, extra_compile_args=extra_compile_args,
include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries))
return ret
borgbackup-1.1.15/PKG-INFO 0000644 0001750 0001750 00000021747 13771325773 015023 0 ustar user user 0000000 0000000 Metadata-Version: 2.1
Name: borgbackup
Version: 1.1.15
Summary: Deduplicated, encrypted, authenticated and compressed backups
Home-page: https://borgbackup.readthedocs.io/
Author: The Borg Collective (see AUTHORS file)
Author-email: borgbackup@python.org
License: BSD
Description:
What is BorgBackup?
-------------------
BorgBackup (short: Borg) is a deduplicating backup program.
Optionally, it supports compression and authenticated encryption.
The main goal of Borg is to provide an efficient and secure way to backup data.
The data deduplication technique used makes Borg suitable for daily backups
since only changes are stored.
The authenticated encryption technique makes it suitable for backups to not
fully trusted targets.
See the `installation manual`_ or, if you have already
downloaded Borg, ``docs/installation.rst`` to get started with Borg.
There is also an `offline documentation`_ available, in multiple formats.
.. _installation manual: https://borgbackup.readthedocs.org/en/stable/installation.html
.. _offline documentation: https://readthedocs.org/projects/borgbackup/downloads
Main features
~~~~~~~~~~~~~
**Space efficient storage**
Deduplication based on content-defined chunking is used to reduce the number
of bytes stored: each file is split into a number of variable length chunks
and only chunks that have never been seen before are added to the repository.
A chunk is considered duplicate if its id_hash value is identical.
A cryptographically strong hash or MAC function is used as id_hash, e.g.
(hmac-)sha256.
To deduplicate, all the chunks in the same repository are considered, no
matter whether they come from different machines, from previous backups,
from the same backup or even from the same single file.
Compared to other deduplication approaches, this method does NOT depend on:
* file/directory names staying the same: So you can move your stuff around
without killing the deduplication, even between machines sharing a repo.
* complete files or time stamps staying the same: If a big file changes a
little, only a few new chunks need to be stored - this is great for VMs or
raw disks.
* The absolute position of a data chunk inside a file: Stuff may get shifted
and will still be found by the deduplication algorithm.
**Speed**
* performance-critical code (chunking, compression, encryption) is
implemented in C/Cython
* local caching of files/chunks index data
* quick detection of unmodified files
**Data encryption**
All data can be protected using 256-bit AES encryption, data integrity and
authenticity is verified using HMAC-SHA256. Data is encrypted clientside.
**Compression**
All data can be optionally compressed:
* lz4 (super fast, low compression)
* zstd (wide range from high speed and low compression to high compression
and lower speed)
* zlib (medium speed and compression)
* lzma (low speed, high compression)
**Off-site backups**
Borg can store data on any remote host accessible over SSH. If Borg is
installed on the remote host, big performance gains can be achieved
compared to using a network filesystem (sshfs, nfs, ...).
**Backups mountable as filesystems**
Backup archives are mountable as userspace filesystems for easy interactive
backup examination and restores (e.g. by using a regular file manager).
**Easy installation on multiple platforms**
We offer single-file binaries that do not require installing anything -
you can just run them on these platforms:
* Linux
* Mac OS X
* FreeBSD
* OpenBSD and NetBSD (no xattrs/ACLs support or binaries yet)
* Cygwin (experimental, no binaries yet)
* Linux Subsystem of Windows 10 (experimental)
**Free and Open Source Software**
* security and functionality can be audited independently
* licensed under the BSD (3-clause) license, see `License`_ for the
complete license
Easy to use
~~~~~~~~~~~
Initialize a new backup repository (see ``borg init --help`` for encryption options)::
$ borg init -e repokey /path/to/repo
Create a backup archive::
$ borg create /path/to/repo::Saturday1 ~/Documents
Now doing another backup, just to show off the great deduplication::
$ borg create -v --stats /path/to/repo::Saturday2 ~/Documents
-----------------------------------------------------------------------------
Archive name: Saturday2
Archive fingerprint: 622b7c53c...
Time (start): Sat, 2016-02-27 14:48:13
Time (end): Sat, 2016-02-27 14:48:14
Duration: 0.88 seconds
Number of files: 163
-----------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 6.85 MB 6.85 MB 30.79 kB <-- !
All archives: 13.69 MB 13.71 MB 6.88 MB
Unique chunks Total chunks
Chunk index: 167 330
-----------------------------------------------------------------------------
For a graphical frontend refer to our complementary project `BorgWeb `_.
Helping, Donations and Bounties, becoming a Patron
--------------------------------------------------
Your help is always welcome!
Spread the word, give feedback, help with documentation, testing or development.
You can also give monetary support to the project, see there for details:
https://www.borgbackup.org/support/fund.html
Links
-----
* `Main Web Site `_
* `Releases `_,
`PyPI packages `_ and
`ChangeLog `_
* `Offline Documentation `_
* `GitHub `_ and
`Issue Tracker `_.
* `Web-Chat (IRC) `_ and
`Mailing List `_
* `License `_
* `Security contact `_
Compatibility notes
-------------------
EXPECT THAT WE WILL BREAK COMPATIBILITY REPEATEDLY WHEN MAJOR RELEASE NUMBER
CHANGES (like when going from 0.x.y to 1.0.0 or from 1.x.y to 2.0.0).
NOT RELEASED DEVELOPMENT VERSIONS HAVE UNKNOWN COMPATIBILITY PROPERTIES.
THIS IS SOFTWARE IN DEVELOPMENT, DECIDE YOURSELF WHETHER IT FITS YOUR NEEDS.
Security issues should be reported to the `Security contact`_ (or
see ``docs/support.rst`` in the source distribution).
Platform: Linux
Platform: MacOS X
Platform: FreeBSD
Platform: OpenBSD
Platform: NetBSD
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Operating System :: POSIX :: BSD :: OpenBSD
Classifier: Operating System :: POSIX :: BSD :: NetBSD
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: System :: Archiving :: Backup
Provides-Extra: fuse
borgbackup-1.1.15/docs/ 0000755 0001750 0001750 00000000000 13771325773 014643 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/usage/ 0000755 0001750 0001750 00000000000 13771325773 015747 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/usage/diff.rst 0000644 0001750 0001750 00000001470 13771325506 017405 0 ustar user user 0000000 0000000 .. include:: diff.rst.inc
Examples
~~~~~~~~
::
$ borg init -e=none testrepo
$ mkdir testdir
$ cd testdir
$ echo asdf > file1
$ dd if=/dev/urandom bs=1M count=4 > file2
$ touch file3
$ borg create ../testrepo::archive1 .
$ chmod a+x file1
$ echo "something" >> file2
$ borg create ../testrepo::archive2 .
$ rm file3
$ touch file4
$ borg create ../testrepo::archive3 .
$ cd ..
$ borg diff testrepo::archive1 archive2
[-rw-r--r-- -> -rwxr-xr-x] file1
+135 B -252 B file2
$ borg diff testrepo::archive2 archive3
added 0 B file4
removed 0 B file3
$ borg diff testrepo::archive1 archive3
[-rw-r--r-- -> -rwxr-xr-x] file1
+135 B -252 B file2
added 0 B file4
removed 0 B file3
borgbackup-1.1.15/docs/usage/benchmark.rst 0000644 0001750 0001750 00000000044 13771325506 020423 0 ustar user user 0000000 0000000 .. include:: benchmark_crud.rst.inc
borgbackup-1.1.15/docs/usage/recreate.rst.inc 0000644 0001750 0001750 00000074626 13771325506 021054 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_recreate:
borg recreate
-------------
.. code-block:: none
borg [common options] recreate [options] [REPOSITORY_OR_ARCHIVE] [PATH...]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to recreate |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to recreate; patterns are supported |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--filter STATUSCHARS`` | only display items with the given status characters (listed in borg create --help) |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change anything |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics at end |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-exclude-tags``, ``--keep-tag-files`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive options** |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--target TARGET`` | create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive) |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--comment COMMENT`` | add a comment text to the archive |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--recompress MODE`` | recompress data chunks according to ``--compression``. MODE `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered). MODE `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level). MODE `never` (default): do not recompress. |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--chunker-params PARAMS`` | specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the current defaults. default: 19,23,21,4095 |
+-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository or archive to recreate
PATH
paths to recreate; patterns are supported
optional arguments
--list output verbose list of items (files, dirs, ...)
--filter STATUSCHARS only display items with the given status characters (listed in borg create --help)
-n, --dry-run do not change anything
-s, --stats print statistics at end
:ref:`common_options`
|
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
--exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html)
--exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
--keep-exclude-tags, --keep-tag-files if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive
Archive options
--target TARGET create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive)
-c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800)
--comment COMMENT add a comment text to the archive
--timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory.
-C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
--recompress MODE recompress data chunks according to ``--compression``. MODE `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered). MODE `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level). MODE `never` (default): do not recompress.
--chunker-params PARAMS specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the current defaults. default: 19,23,21,4095
Description
~~~~~~~~~~~
Recreate the contents of existing archives.
recreate is a potentially dangerous function and might lead to data loss
(if used wrongly). BE VERY CAREFUL!
``--exclude``, ``--exclude-from``, ``--exclude-if-present``, ``--keep-exclude-tags``
and PATH have the exact same semantics as in "borg create", but they only check
for files in the archives and not in the local file system. If PATHs are specified,
the resulting archives will only contain files from these PATHs.
Note that all paths in an archive are relative, therefore absolute patterns/paths
will *not* match (``--exclude``, ``--exclude-from``, PATHs).
``--recompress`` allows to change the compression of existing data in archives.
Due to how Borg stores compressed size information this might display
incorrect information for archives that were not recreated at the same time.
There is no risk of data loss by this.
``--chunker-params`` will re-chunk all files in the archive, this can be
used to have upgraded Borg 0.xx or Attic archives deduplicate with
Borg 1.x archives.
**USE WITH CAUTION.**
Depending on the PATHs and patterns given, recreate can be used to permanently
delete files from archives.
When in doubt, use ``--dry-run --verbose --list`` to see how patterns/PATHS are
interpreted. See :ref:`list_item_flags` in ``borg create`` for details.
The archive being recreated is only removed after the operation completes. The
archive that is built during the operation exists at the same time at
".recreate". The new archive will have a different archive ID.
With ``--target`` the original archive is not replaced, instead a new archive is created.
When rechunking space usage can be substantial, expect at least the entire
deduplicated size of the archives using the previous chunker params.
When recompressing expect approx. (throughput / checkpoint-interval) in space usage,
assuming all chunks are recompressed.
If you recently ran borg check --repair and it had to fix lost chunks with all-zero
replacement chunks, please first run another backup for the same data and re-run
borg check --repair afterwards to heal any archives that had lost chunks which are
still generated from the input data.
Important: running borg recreate to re-chunk will remove the chunks_healthy
metadata of all items with replacement chunks, so healing will not be possible
any more after re-chunking (it is also unlikely it would ever work: due to the
change of chunking parameters, the missing chunk likely will never be seen again
even if you still have the data that produced it). borgbackup-1.1.15/docs/usage/key_import.rst.inc 0000644 0001750 0001750 00000006006 13771325506 021427 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_key_import:
borg key import
---------------
.. code-block:: none
borg [common options] key import [options] [REPOSITORY] [PATH]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| | ``REPOSITORY`` | |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| | ``PATH`` | path to the backup ('-' to read from stdin) |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| | ``--paper`` | interactively import from a backup done with ``--paper`` |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
PATH
path to the backup ('-' to read from stdin)
optional arguments
--paper interactively import from a backup done with ``--paper``
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command allows to restore a key previously backed up with the
export command.
If the ``--paper`` option is given, the import will be an interactive
process in which each line is checked for plausibility before
proceeding to the next line. For this format PATH must not be given. borgbackup-1.1.15/docs/usage/general.rst 0000644 0001750 0001750 00000003615 13771325506 020115 0 ustar user user 0000000 0000000 General
-------
Borg consists of a number of commands. Each command accepts
a number of arguments and options and interprets various environment variables.
The following sections will describe each command in detail.
Commands, options, parameters, paths and such are ``set in fixed-width``.
Option values are `underlined`. Borg has few options accepting a fixed set
of values (e.g. ``--encryption`` of :ref:`borg_init`).
.. container:: experimental
Experimental features are marked with red stripes on the sides, like this paragraph.
Experimental features are not stable, which means that they may be changed in incompatible
ways or even removed entirely without prior notice in following releases.
.. include:: usage_general.rst.inc
In case you are interested in more details (like formulas), please see
:ref:`internals`. For details on the available JSON output, refer to
:ref:`json_output`.
.. _common_options:
Common options
~~~~~~~~~~~~~~
All Borg commands share these options:
.. include:: common-options.rst.inc
Option ``--bypass-lock`` allows you to access the repository while bypassing
borg's locking mechanism. This is necessary if your repository is on a read-only
storage where you don't have write permissions or capabilities and therefore
cannot create a lock. Examples are repositories stored on a Bluray disc or a
read-only network storage. Avoid this option if you are able to use locks as
that is the safer way; see the warning below.
.. warning::
If you do use ``--bypass-lock``, you are responsible to ensure that no other
borg instances have write access to the repository. Otherwise, you might
experience errors and read broken data if changes to that repository are
being made at the same time.
Examples
~~~~~~~~
::
# Create an archive and log: borg version, files list, return code
$ borg create --show-version --list --show-rc /path/to/repo::my-files files
borgbackup-1.1.15/docs/usage/key.rst 0000644 0001750 0001750 00000002346 13771325506 017270 0 ustar user user 0000000 0000000 .. _borg-change-passphrase:
.. include:: key_change-passphrase.rst.inc
Examples
~~~~~~~~
::
# Create a key file protected repository
$ borg init --encryption=keyfile -v /path/to/repo
Initializing repository at "/path/to/repo"
Enter new passphrase:
Enter same passphrase again:
Remember your passphrase. Your data will be inaccessible without it.
Key in "/root/.config/borg/keys/mnt_backup" created.
Keep this key safe. Your data will be inaccessible without it.
Synchronizing chunks cache...
Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0.
Done.
# Change key file passphrase
$ borg key change-passphrase -v /path/to/repo
Enter passphrase for key /root/.config/borg/keys/mnt_backup:
Enter new passphrase:
Enter same passphrase again:
Remember your passphrase. Your data will be inaccessible without it.
Key updated
Fully automated using environment variables:
::
$ BORG_NEW_PASSPHRASE=old borg init -e=repokey repo
# now "old" is the current passphrase.
$ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change-passphrase repo
# now "new" is the current passphrase.
.. include:: key_export.rst.inc
.. include:: key_import.rst.inc
borgbackup-1.1.15/docs/usage/break-lock.rst.inc 0000644 0001750 0001750 00000003503 13771325506 021256 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_break-lock:
borg break-lock
---------------
.. code-block:: none
borg [common options] break-lock [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+-----------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------+-----------------------------------------+
| | ``REPOSITORY`` | repository for which to break the locks |
+-------------------------------------------------------+----------------+-----------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+-----------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
repository for which to break the locks
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command breaks the repository and cache locks.
Please use carefully and only while no borg process (on any machine) is
trying to access the Cache or the Repository. borgbackup-1.1.15/docs/usage/delete.rst 0000644 0001750 0001750 00000001103 13771325506 017730 0 ustar user user 0000000 0000000 .. include:: delete.rst.inc
Examples
~~~~~~~~
::
# delete a single backup archive:
$ borg delete /path/to/repo::Monday
# delete the whole repository and the related local cache:
$ borg delete /path/to/repo
You requested to completely DELETE the repository *including* all archives it contains:
repo Mon, 2016-02-15 19:26:54
root-2016-02-15 Mon, 2016-02-15 19:36:29
newname Mon, 2016-02-15 19:50:19
Type 'YES' if you understand this and want to continue: YES
borgbackup-1.1.15/docs/usage/create.rst.inc 0000644 0001750 0001750 00000103704 13771325506 020513 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_create:
borg create
-----------
.. code-block:: none
borg [common options] create [options] ARCHIVE [PATH...]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | name of archive to create (must be also a valid directory name) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not create a backup archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the created archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--filter STATUSCHARS`` | only display items with the given status characters (see description) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | output stats as JSON. Implies ``--stats``. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--no-cache-sync`` | experimental: do not synchronize the cache. Implies not using the files cache. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--no-files-cache`` | do not load/update the file metadata cache used to detect unchanged files |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-name NAME`` | use NAME in archive for stdin data (default: "stdin") |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-user USER`` | set user USER in archive for stdin data (default: 'root') |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-group GROUP`` | set group GROUP in archive for stdin data (default: 'root') |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-mode M`` | set mode to M in archive for stdin data (default: 0660) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-exclude-tags``, ``--keep-tag-files`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-nodump`` | exclude files flagged NODUMP |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Filesystem options** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-x``, ``--one-file-system`` | stay in the same file system and do not store mount points of other file systems. This might behave different from your expectations, see the docs. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-owner`` | only store numeric user and group identifiers |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noatime`` | do not store atime into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noctime`` | do not store ctime into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--nobirthtime`` | do not store birthtime (creation date) into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--nobsdflags`` | do not read and store bsdflags (e.g. NODUMP, IMMUTABLE) into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--ignore-inode`` | ignore inode data in the file metadata cache used to detect unchanged files. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--files-cache MODE`` | operate files cache in MODE. default: ctime,size,inode |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--read-special`` | open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive options** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--comment COMMENT`` | add a comment text to the archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). Alternatively, give a reference file/directory. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--chunker-params PARAMS`` | specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: 19,23,21,4095 |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
ARCHIVE
name of archive to create (must be also a valid directory name)
PATH
paths to archive
optional arguments
-n, --dry-run do not create a backup archive
-s, --stats print statistics for the created archive
--list output verbose list of items (files, dirs, ...)
--filter STATUSCHARS only display items with the given status characters (see description)
--json output stats as JSON. Implies ``--stats``.
--no-cache-sync experimental: do not synchronize the cache. Implies not using the files cache.
--no-files-cache do not load/update the file metadata cache used to detect unchanged files
--stdin-name NAME use NAME in archive for stdin data (default: "stdin")
--stdin-user USER set user USER in archive for stdin data (default: 'root')
--stdin-group GROUP set group GROUP in archive for stdin data (default: 'root')
--stdin-mode M set mode to M in archive for stdin data (default: 0660)
:ref:`common_options`
|
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
--exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html)
--exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
--keep-exclude-tags, --keep-tag-files if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive
--exclude-nodump exclude files flagged NODUMP
Filesystem options
-x, --one-file-system stay in the same file system and do not store mount points of other file systems. This might behave different from your expectations, see the docs.
--numeric-owner only store numeric user and group identifiers
--noatime do not store atime into archive
--noctime do not store ctime into archive
--nobirthtime do not store birthtime (creation date) into archive
--nobsdflags do not read and store bsdflags (e.g. NODUMP, IMMUTABLE) into archive
--ignore-inode ignore inode data in the file metadata cache used to detect unchanged files.
--files-cache MODE operate files cache in MODE. default: ctime,size,inode
--read-special open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files.
Archive options
--comment COMMENT add a comment text to the archive
--timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). Alternatively, give a reference file/directory.
-c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800)
--chunker-params PARAMS specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: 19,23,21,4095
-C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
Description
~~~~~~~~~~~
This command creates a backup archive containing all files found while recursively
traversing all paths specified. Paths are added to the archive as they are given,
that means if relative paths are desired, the command has to be run from the correct
directory.
When giving '-' as path, borg will read data from standard input and create a
file 'stdin' in the created archive from that data. See section *Reading from
stdin* below for details.
The archive will consume almost no disk space for files or parts of files that
have already been stored in other archives.
The archive name needs to be unique. It must not end in '.checkpoint' or
'.checkpoint.N' (with N being a number), because these names are used for
checkpoints and treated in special ways.
In the archive name, you may use the following placeholders:
{now}, {utcnow}, {fqdn}, {hostname}, {user} and some others.
Backup speed is increased by not reprocessing files that are already part of
existing archives and weren't modified. The detection of unmodified files is
done by comparing multiple file metadata values with previous values kept in
the files cache.
This comparison can operate in different modes as given by ``--files-cache``:
- ctime,size,inode (default)
- mtime,size,inode (default behaviour of borg versions older than 1.1.0rc4)
- ctime,size (ignore the inode number)
- mtime,size (ignore the inode number)
- rechunk,ctime (all files are considered modified - rechunk, cache ctime)
- rechunk,mtime (all files are considered modified - rechunk, cache mtime)
- disabled (disable the files cache, all files considered modified - rechunk)
inode number: better safety, but often unstable on network filesystems
Normally, detecting file modifications will take inode information into
consideration to improve the reliability of file change detection.
This is problematic for files located on sshfs and similar network file
systems which do not provide stable inode numbers, such files will always
be considered modified. You can use modes without `inode` in this case to
improve performance, but reliability of change detection might be reduced.
ctime vs. mtime: safety vs. speed
- ctime is a rather safe way to detect changes to a file (metadata and contents)
as it can not be set from userspace. But, a metadata-only change will already
update the ctime, so there might be some unnecessary chunking/hashing even
without content changes. Some filesystems do not support ctime (change time).
E.g. doing a chown or chmod to a file will change its ctime.
- mtime usually works and only updates if file contents were changed. But mtime
can be arbitrarily set from userspace, e.g. to set mtime back to the same value
it had before a content change happened. This can be used maliciously as well as
well-meant, but in both cases mtime based cache modes can be problematic.
The mount points of filesystems or filesystem snapshots should be the same for every
creation of a new archive to ensure fast operation. This is because the file cache that
is used to determine changed files quickly uses absolute filenames.
If this is not possible, consider creating a bind mount to a stable location.
The ``--progress`` option shows (from left to right) Original, Compressed and Deduplicated
(O, C and D, respectively), then the Number of files (N) processed so far, followed by
the currently processed path.
When using ``--stats``, you will get some statistics about how much data was
added - the "This Archive" deduplicated size there is most interesting as that is
how much your repository will grow. Please note that the "All archives" stats refer to
the state after creation. Also, the ``--stats`` and ``--dry-run`` options are mutually
exclusive because the data is not actually compressed and deduplicated during a dry run.
See the output of the "borg help patterns" command for more help on exclude patterns.
See the output of the "borg help placeholders" command for more help on placeholders.
.. man NOTES
The ``--exclude`` patterns are not like tar. In tar ``--exclude`` .bundler/gems will
exclude foo/.bundler/gems. In borg it will not, you need to use ``--exclude``
'\*/.bundler/gems' to get the same effect. See ``borg help patterns`` for
more information.
In addition to using ``--exclude`` patterns, it is possible to use
``--exclude-if-present`` to specify the name of a filesystem object (e.g. a file
or folder name) which, when contained within another folder, will prevent the
containing folder from being backed up. By default, the containing folder and
all of its contents will be omitted from the backup. If, however, you wish to
only include the objects specified by ``--exclude-if-present`` in your backup,
and not include any other contents of the containing folder, this can be enabled
through using the ``--keep-exclude-tags`` option.
The ``-x`` or ``--one-file-system`` option excludes directories, that are mountpoints (and everything in them).
It detects mountpoints by comparing the device number from the output of ``stat()`` of the directory and its
parent directory. Specifically, it excludes directories for which ``stat()`` reports a device number different
from the device number of their parent. Be aware that in Linux (and possibly elsewhere) there are directories
with device number different from their parent, which the kernel does not consider a mountpoint and also the
other way around. Examples are bind mounts (possibly same device number, but always a mountpoint) and ALL
subvolumes of a btrfs (different device number from parent but not necessarily a mountpoint). Therefore when
using ``--one-file-system``, one should make doubly sure that the backup works as intended especially when using
btrfs. This is even more important, if the btrfs layout was created by someone else, e.g. a distribution
installer.
.. _list_item_flags:
Item flags
++++++++++
``--list`` outputs a list of all files, directories and other
file system items it considered (no matter whether they had content changes
or not). For each item, it prefixes a single-letter flag that indicates type
and/or status of the item.
If you are interested only in a subset of that output, you can give e.g.
``--filter=AME`` and it will only show regular files with A, M or E status (see
below).
A uppercase character represents the status of a regular file relative to the
"files" cache (not relative to the repo -- this is an issue if the files cache
is not used). Metadata is stored in any case and for 'A' and 'M' also new data
chunks are stored. For 'U' all data chunks refer to already existing chunks.
- 'A' = regular file, added (see also :ref:`a_status_oddity` in the FAQ)
- 'M' = regular file, modified
- 'U' = regular file, unchanged
- 'E' = regular file, an error happened while accessing/reading *this* file
A lowercase character means a file type other than a regular file,
borg usually just stores their metadata:
- 'd' = directory
- 'b' = block device
- 'c' = char device
- 'h' = regular file, hardlink (to already seen inodes)
- 's' = symlink
- 'f' = fifo
Other flags used include:
- 'i' = backup data was read from standard input (stdin)
- '-' = dry run, item was *not* backed up
- 'x' = excluded, item was *not* backed up
- '?' = missing status code (if you see this, please file a bug report!)
Reading from stdin
++++++++++++++++++
To read from stdin, specify ``-`` as path and pipe directly to borg::
backup-vm --id myvm --stdout | borg create REPO::ARCHIVE -
Note that piping to borg creates an archive even if the command piping
to borg exits with a failure. In this case, **one can end up with
truncated output being backed up**.
Reading from stdin yields just a stream of data without file metadata
associated with it, and the files cache is not needed at all. So it is
safe to disable it via ``--no-files-cache`` and speed up backup
creation a bit.
By default, the content read from stdin is stored in a file called 'stdin'.
Use ``--stdin-name`` to change the name. borgbackup-1.1.15/docs/usage/notes.rst 0000644 0001750 0001750 00000027036 13771325506 017633 0 ustar user user 0000000 0000000 Additional Notes
----------------
Here are misc. notes about topics that are maybe not covered in enough detail in the usage section.
.. _chunker-params:
``--chunker-params``
~~~~~~~~~~~~~~~~~~~~
The chunker params influence how input files are cut into pieces (chunks)
which are then considered for deduplication. They also have a big impact on
resource usage (RAM and disk space) as the amount of resources needed is
(also) determined by the total amount of chunks in the repository (see
:ref:`cache-memory-usage` for details).
``--chunker-params=10,23,16,4095`` results in a fine-grained deduplication|
and creates a big amount of chunks and thus uses a lot of resources to manage
them. This is good for relatively small data volumes and if the machine has a
good amount of free RAM and disk space.
``--chunker-params=19,23,21,4095`` (default) results in a coarse-grained
deduplication and creates a much smaller amount of chunks and thus uses less
resources. This is good for relatively big data volumes and if the machine has
a relatively low amount of free RAM and disk space.
If you already have made some archives in a repository and you then change
chunker params, this of course impacts deduplication as the chunks will be
cut differently.
In the worst case (all files are big and were touched in between backups), this
will store all content into the repository again.
Usually, it is not that bad though:
- usually most files are not touched, so it will just re-use the old chunks
it already has in the repo
- files smaller than the (both old and new) minimum chunksize result in only
one chunk anyway, so the resulting chunks are same and deduplication will apply
If you switch chunker params to save resources for an existing repo that
already has some backup archives, you will see an increasing effect over time,
when more and more files have been touched and stored again using the bigger
chunksize **and** all references to the smaller older chunks have been removed
(by deleting / pruning archives).
If you want to see an immediate big effect on resource usage, you better start
a new repository when changing chunker params.
For more details, see :ref:`chunker_details`.
``--noatime / --noctime``
~~~~~~~~~~~~~~~~~~~~~~~~~
You can use these ``borg create`` options to not store the respective timestamp
into the archive, in case you do not really need it.
Besides saving a little space for the not archived timestamp, it might also
affect metadata stream deduplication: if only this timestamp changes between
backups and is stored into the metadata stream, the metadata stream chunks
won't deduplicate just because of that.
``--nobsdflags``
~~~~~~~~~~~~~~~~
You can use this to not query and store (or not extract and set) bsdflags -
in case you don't need them or if they are broken somehow for your fs.
On Linux, dealing with the bsflags needs some additional syscalls.
Especially when dealing with lots of small files, this causes a noticable
overhead, so you can use this option also for speeding up operations.
``--umask``
~~~~~~~~~~~
If you use ``--umask``, make sure that all repository-modifying borg commands
(create, delete, prune) that access the repository in question use the same
``--umask`` value.
If multiple machines access the same repository, this should hold true for all
of them.
``--read-special``
~~~~~~~~~~~~~~~~~~
The ``--read-special`` option is special - you do not want to use it for normal
full-filesystem backups, but rather after carefully picking some targets for it.
The option ``--read-special`` triggers special treatment for block and char
device files as well as FIFOs. Instead of storing them as such a device (or
FIFO), they will get opened, their content will be read and in the backup
archive they will show up like a regular file.
Symlinks will also get special treatment if (and only if) they point to such
a special file: instead of storing them as a symlink, the target special file
will get processed as described above.
One intended use case of this is backing up the contents of one or multiple
block devices, like e.g. LVM snapshots or inactive LVs or disk partitions.
You need to be careful about what you include when using ``--read-special``,
e.g. if you include ``/dev/zero``, your backup will never terminate.
Restoring such files' content is currently only supported one at a time via
``--stdout`` option (and you have to redirect stdout to where ever it shall go,
maybe directly into an existing device file of your choice or indirectly via
``dd``).
To some extent, mounting a backup archive with the backups of special files
via ``borg mount`` and then loop-mounting the image files from inside the mount
point will work. If you plan to access a lot of data in there, it likely will
scale and perform better if you do not work via the FUSE mount.
Example
+++++++
Imagine you have made some snapshots of logical volumes (LVs) you want to backup.
.. note::
For some scenarios, this is a good method to get "crash-like" consistency
(I call it crash-like because it is the same as you would get if you just
hit the reset button or your machine would abruptly and completely crash).
This is better than no consistency at all and a good method for some use
cases, but likely not good enough if you have databases running.
Then you create a backup archive of all these snapshots. The backup process will
see a "frozen" state of the logical volumes, while the processes working in the
original volumes continue changing the data stored there.
You also add the output of ``lvdisplay`` to your backup, so you can see the LV
sizes in case you ever need to recreate and restore them.
After the backup has completed, you remove the snapshots again.
::
$ # create snapshots here
$ lvdisplay > lvdisplay.txt
$ borg create --read-special /path/to/repo::arch lvdisplay.txt /dev/vg0/*-snapshot
$ # remove snapshots here
Now, let's see how to restore some LVs from such a backup.
::
$ borg extract /path/to/repo::arch lvdisplay.txt
$ # create empty LVs with correct sizes here (look into lvdisplay.txt).
$ # we assume that you created an empty root and home LV and overwrite it now:
$ borg extract --stdout /path/to/repo::arch dev/vg0/root-snapshot > /dev/vg0/root
$ borg extract --stdout /path/to/repo::arch dev/vg0/home-snapshot > /dev/vg0/home
.. _append_only_mode:
Append-only mode
~~~~~~~~~~~~~~~~
A repository can be made "append-only", which means that Borg will never overwrite or
delete committed data (append-only refers to the segment files, but borg will also
reject to delete the repository completely). This is useful for scenarios where a
backup client machine backups remotely to a backup server using ``borg serve``, since
a hacked client machine cannot delete backups on the server permanently.
To activate append-only mode, set ``append_only`` to 1 in the repository config:
::
borg config /path/to/repo append_only 1
Note that you can go back-and-forth between normal and append-only operation with
``borg config``; it's not a "one way trip."
In append-only mode Borg will create a transaction log in the ``transactions`` file,
where each line is a transaction and a UTC timestamp.
In addition, ``borg serve`` can act as if a repository is in append-only mode with
its option ``--append-only``. This can be very useful for fine-tuning access control
in ``.ssh/authorized_keys``:
::
command="borg serve --append-only ..." ssh-rsa
command="borg serve ..." ssh-rsa
Running ``borg init`` via a ``borg serve --append-only`` server will *not* create
an append-only repository. Running ``borg init --append-only`` creates an append-only
repository regardless of server settings.
Example
+++++++
Suppose an attacker remotely deleted all backups, but your repository was in append-only
mode. A transaction log in this situation might look like this:
::
transaction 1, UTC time 2016-03-31T15:53:27.383532
transaction 5, UTC time 2016-03-31T15:53:52.588922
transaction 11, UTC time 2016-03-31T15:54:23.887256
transaction 12, UTC time 2016-03-31T15:55:54.022540
transaction 13, UTC time 2016-03-31T15:55:55.472564
From your security logs you conclude the attacker gained access at 15:54:00 and all
the backups where deleted or replaced by compromised backups. From the log you know
that transactions 11 and later are compromised. Note that the transaction ID is the
name of the *last* file in the transaction. For example, transaction 11 spans files 6
to 11.
In a real attack you'll likely want to keep the compromised repository
intact to analyze what the attacker tried to achieve. It's also a good idea to make this
copy just in case something goes wrong during the recovery. Since recovery is done by
deleting some files, a hard link copy (``cp -al``) is sufficient.
The first step to reset the repository to transaction 5, the last uncompromised transaction,
is to remove the ``hints.N``, ``index.N`` and ``integrity.N`` files in the repository (these
files are always expendable). In this example N is 13.
Then remove or move all segment files from the segment directories in ``data/`` starting
with file 6::
rm data/**/{6..13}
That's all to do in the repository.
If you want to access this rollbacked repository from a client that already has
a cache for this repository, the cache will reflect a newer repository state
than what you actually have in the repository now, after the rollback.
Thus, you need to clear the cache::
borg delete --cache-only repo
The cache will get rebuilt automatically. Depending on repo size and archive
count, it may take a while.
You also will need to remove ~/.config/borg/security/REPOID/manifest-timestamp.
Drawbacks
+++++++++
As data is only appended, and nothing removed, commands like ``prune`` or ``delete``
won't free disk space, they merely tag data as deleted in a new transaction.
Be aware that as soon as you write to the repo in non-append-only mode (e.g. prune,
delete or create archives from an admin machine), it will remove the deleted objects
permanently (including the ones that were already marked as deleted, but not removed,
in append-only mode). Automated edits to the repository (such as a cron job running
``borg prune``) will render append-only mode moot if data is deleted.
Even if an archive appears to be available, it is possible an attacker could delete
just a few chunks from an archive and silently corrupt its data. While in append-only
mode, this is reversible, but ``borg check`` should be run before a writing/pruning
operation on an append-only repository to catch accidental or malicious corruption::
# run without append-only mode
borg check --verify-data repo
Aside from checking repository & archive integrity you may want to also manually check
backups to ensure their content seems correct.
Further considerations
++++++++++++++++++++++
Append-only mode is not respected by tools other than Borg. ``rm`` still works on the
repository. Make sure that backup client machines only get to access the repository via
``borg serve``.
Ensure that no remote access is possible if the repository is temporarily set to normal mode
for e.g. regular pruning.
Further protections can be implemented, but are outside of Borg's scope. For example,
file system snapshots or wrapping ``borg serve`` to set special permissions or ACLs on
new data files.
SSH batch mode
~~~~~~~~~~~~~~
When running Borg using an automated script, ``ssh`` might still ask for a password,
even if there is an SSH key for the target server. Use this to make scripts more robust::
export BORG_RSH='ssh -oBatchMode=yes'
borgbackup-1.1.15/docs/usage/recreate.rst 0000644 0001750 0001750 00000002470 13771325506 020270 0 ustar user user 0000000 0000000 .. include:: recreate.rst.inc
Examples
~~~~~~~~
::
# Make old (Attic / Borg 0.xx) archives deduplicate with Borg 1.x archives.
# Archives created with Borg 1.1+ and the default chunker params are skipped
# (archive ID stays the same).
$ borg recreate /mnt/backup --chunker-params default --progress
# Create a backup with little but fast compression
$ borg create /mnt/backup::archive /some/files --compression lz4
# Then compress it - this might take longer, but the backup has already completed,
# so no inconsistencies from a long-running backup job.
$ borg recreate /mnt/backup::archive --recompress --compression zlib,9
# Remove unwanted files from all archives in a repository.
# Note the relative path for the --exclude option - archives only contain relative paths.
$ borg recreate /mnt/backup --exclude home/icke/Pictures/drunk_photos
# Change archive comment
$ borg create --comment "This is a comment" /mnt/backup::archivename ~
$ borg info /mnt/backup::archivename
Name: archivename
Fingerprint: ...
Comment: This is a comment
...
$ borg recreate --comment "This is a better comment" /mnt/backup::archivename
$ borg info /mnt/backup::archivename
Name: archivename
Fingerprint: ...
Comment: This is a better comment
...
borgbackup-1.1.15/docs/usage/init.rst.inc 0000644 0001750 0001750 00000023343 13771325506 020213 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_init:
borg init
---------
.. code-block:: none
borg [common options] init [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| | ``REPOSITORY`` | repository to create |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| | ``-e MODE``, ``--encryption MODE`` | select encryption key mode **(required)** |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| | ``--append-only`` | create an append-only mode repository |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| | ``--storage-quota QUOTA`` | Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota. |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| | ``--make-parent-dirs`` | create the parent directories of the repository directory, if they are missing. |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+------------------------------------+---------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
repository to create
optional arguments
-e MODE, --encryption MODE select encryption key mode **(required)**
--append-only create an append-only mode repository
--storage-quota QUOTA Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
--make-parent-dirs create the parent directories of the repository directory, if they are missing.
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command initializes an empty repository. A repository is a filesystem
directory containing the deduplicated data from zero or more archives.
Encryption can be enabled at repository init time. It cannot be changed later.
It is not recommended to work without encryption. Repository encryption protects
you e.g. against the case that an attacker has access to your backup repository.
Borg relies on randomly generated key material and uses that for chunking, id
generation, encryption and authentication. The key material is encrypted using
the passphrase you give before it is stored on-disk.
You need to be careful with the key / the passphrase:
If you want "passphrase-only" security, use one of the repokey modes. The
key will be stored inside the repository (in its "config" file). In above
mentioned attack scenario, the attacker will have the key (but not the
passphrase).
If you want "passphrase and having-the-key" security, use one of the keyfile
modes. The key will be stored in your home directory (in .config/borg/keys).
In the attack scenario, the attacker who has just access to your repo won't
have the key (and also not the passphrase).
Make a backup copy of the key file (keyfile mode) or repo config file
(repokey mode) and keep it at a safe place, so you still have the key in
case it gets corrupted or lost. Also keep the passphrase at a safe place.
The backup that is encrypted with that key won't help you with that, of course.
Make sure you use a good passphrase. Not too short, not too simple. The real
encryption / decryption key is encrypted with / locked by your passphrase.
If an attacker gets your key, he can't unlock and use it without knowing the
passphrase.
Be careful with special or non-ascii characters in your passphrase:
- Borg processes the passphrase as unicode (and encodes it as utf-8),
so it does not have problems dealing with even the strangest characters.
- BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
So better use a long passphrase made from simple ascii chars than one that
includes non-ascii stuff or characters that are hard/impossible to enter on
a different keyboard layout.
You can change your passphrase for existing repos at any time, it won't affect
the encryption/decryption key or other secrets.
Encryption modes
++++++++++++++++
You can choose from the encryption modes seen in the table below on a per-repo
basis. The mode determines encryption algorithm, hash/MAC algorithm and also the
key storage location.
Example: `borg init --encryption repokey ...`
.. nanorst: inline-fill
+----------+---------------+------------------------+--------------------------+
| Hash/MAC | Not encrypted | Not encrypted, | Encrypted (AEAD w/ AES) |
| | no auth | but authenticated | and authenticated |
+----------+---------------+------------------------+--------------------------+
| SHA-256 | none | `authenticated` | repokey |
| | | | keyfile |
+----------+---------------+------------------------+--------------------------+
| BLAKE2b | n/a | `authenticated-blake2` | `repokey-blake2` |
| | | | `keyfile-blake2` |
+----------+---------------+------------------------+--------------------------+
.. nanorst: inline-replace
Modes `marked like this` in the above table are new in Borg 1.1 and are not
backwards-compatible with Borg 1.0.x.
On modern Intel/AMD CPUs (except very cheap ones), AES is usually
hardware-accelerated.
BLAKE2b is faster than SHA256 on Intel/AMD 64-bit CPUs
(except AMD Ryzen and future CPUs with SHA extensions),
which makes `authenticated-blake2` faster than `none` and `authenticated`.
On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster
than BLAKE2b-256 there. NEON accelerates AES as well.
Hardware acceleration is always used automatically when available.
`repokey` and `keyfile` use AES-CTR-256 for encryption and HMAC-SHA256 for
authentication in an encrypt-then-MAC (EtM) construction. The chunk ID hash
is HMAC-SHA256 as well (with a separate key).
These modes are compatible with Borg 1.0.x.
`repokey-blake2` and `keyfile-blake2` are also authenticated encryption modes,
but use BLAKE2b-256 instead of HMAC-SHA256 for authentication. The chunk ID
hash is a keyed BLAKE2b-256 hash.
These modes are new and *not* compatible with Borg 1.0.x.
`authenticated` mode uses no encryption, but authenticates repository contents
through the same HMAC-SHA256 hash as the `repokey` and `keyfile` modes (it uses it
as the chunk ID hash). The key is stored like `repokey`.
This mode is new and *not* compatible with Borg 1.0.x.
`authenticated-blake2` is like `authenticated`, but uses the keyed BLAKE2b-256 hash
from the other blake2 modes.
This mode is new and *not* compatible with Borg 1.0.x.
`none` mode uses no encryption and no authentication. It uses SHA256 as chunk
ID hash. This mode is not recommended, you should rather consider using an authenticated
or authenticated/encrypted mode. This mode has possible denial-of-service issues
when running ``borg create`` on contents controlled by an attacker.
Use it only for new repositories where no encryption is wanted **and** when compatibility
with 1.0.x is important. If compatibility with 1.0.x is not important, use
`authenticated-blake2` or `authenticated` instead.
This mode is compatible with Borg 1.0.x. borgbackup-1.1.15/docs/usage/extract.rst.inc 0000644 0001750 0001750 00000024006 13771325506 020717 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_extract:
borg extract
------------
.. code-block:: none
borg [common options] extract [options] ARCHIVE [PATH...]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | archive to extract |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not actually change any files |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--numeric-owner`` | only obey numeric user and group identifiers |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--nobsdflags`` | do not extract/set bsdflags (e.g. NODUMP, IMMUTABLE) |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--stdout`` | write all extracted data to stdout |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--sparse`` | create holes in output sparse file from all-zero chunks |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
ARCHIVE
archive to extract
PATH
paths to extract; patterns are supported
optional arguments
--list output verbose list of items (files, dirs, ...)
-n, --dry-run do not actually change any files
--numeric-owner only obey numeric user and group identifiers
--nobsdflags do not extract/set bsdflags (e.g. NODUMP, IMMUTABLE)
--stdout write all extracted data to stdout
--sparse create holes in output sparse file from all-zero chunks
:ref:`common_options`
|
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
--strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
Description
~~~~~~~~~~~
This command extracts the contents of an archive. By default the entire
archive is extracted but a subset of files and directories can be selected
by passing a list of ``PATHs`` as arguments. The file selection can further
be restricted by using the ``--exclude`` option.
See the output of the "borg help patterns" command for more help on exclude patterns.
By using ``--dry-run``, you can do all extraction steps except actually writing the
output data: reading metadata and data chunks from the repo, checking the hash/hmac,
decrypting, decompressing.
``--progress`` can be slower than no progress display, since it makes one additional
pass over the archive metadata.
.. note::
Currently, extract always writes into the current working directory ("."),
so make sure you ``cd`` to the right place before calling ``borg extract``. borgbackup-1.1.15/docs/usage/create.rst 0000644 0001750 0001750 00000005466 13771325506 017751 0 ustar user user 0000000 0000000 .. include:: create.rst.inc
Examples
~~~~~~~~
::
# Backup ~/Documents into an archive named "my-documents"
$ borg create /path/to/repo::my-documents ~/Documents
# same, but list all files as we process them
$ borg create --list /path/to/repo::my-documents ~/Documents
# Backup ~/Documents and ~/src but exclude pyc files
$ borg create /path/to/repo::my-files \
~/Documents \
~/src \
--exclude '*.pyc'
# Backup home directories excluding image thumbnails (i.e. only
# /home//.thumbnails is excluded, not /home/*/*/.thumbnails etc.)
$ borg create /path/to/repo::my-files /home \
--exclude 'sh:/home/*/.thumbnails'
# Backup the root filesystem into an archive named "root-YYYY-MM-DD"
# use zlib compression (good, but slow) - default is lz4 (fast, low compression ratio)
$ borg create -C zlib,6 --one-file-system /path/to/repo::root-{now:%Y-%m-%d} /
# Backup a remote host locally ("pull" style) using sshfs
$ mkdir sshfs-mount
$ sshfs root@example.com:/ sshfs-mount
$ cd sshfs-mount
$ borg create /path/to/repo::example.com-root-{now:%Y-%m-%d} .
$ cd ..
$ fusermount -u sshfs-mount
# Make a big effort in fine granular deduplication (big chunk management
# overhead, needs a lot of RAM and disk space, see formula in internals
# docs - same parameters as borg < 1.0 or attic):
$ borg create --chunker-params 10,23,16,4095 /path/to/repo::small /smallstuff
# Backup a raw device (must not be active/in use/mounted at that time)
$ dd if=/dev/sdx bs=10M | borg create /path/to/repo::my-sdx -
# No compression (none)
$ borg create --compression none /path/to/repo::arch ~
# Super fast, low compression (lz4, default)
$ borg create /path/to/repo::arch ~
# Less fast, higher compression (zlib, N = 0..9)
$ borg create --compression zlib,N /path/to/repo::arch ~
# Even slower, even higher compression (lzma, N = 0..9)
$ borg create --compression lzma,N /path/to/repo::arch ~
# Only compress compressible data with lzma,N (N = 0..9)
$ borg create --compression auto,lzma,N /path/to/repo::arch ~
# Use short hostname, user name and current time in archive name
$ borg create /path/to/repo::{hostname}-{user}-{now} ~
# Similar, use the same datetime format that is default as of borg 1.1
$ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%dT%H:%M:%S} ~
# As above, but add nanoseconds
$ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%dT%H:%M:%S.%f} ~
# Backing up relative paths by moving into the correct directory first
$ cd /home/user/Documents
# The root directory of the archive will be "projectA"
$ borg create /path/to/repo::daily-projectA-{now:%Y-%m-%d} projectA
borgbackup-1.1.15/docs/usage/prune.rst 0000644 0001750 0001750 00000003056 13771325506 017630 0 ustar user user 0000000 0000000 .. include:: prune.rst.inc
Examples
~~~~~~~~
Be careful, prune is a potentially dangerous command, it will remove backup
archives.
The default of prune is to apply to **all archives in the repository** unless
you restrict its operation to a subset of the archives using ``--prefix``.
When using ``--prefix``, be careful to choose a good prefix - e.g. do not use a
prefix "foo" if you do not also want to match "foobar".
It is strongly recommended to always run ``prune -v --list --dry-run ...``
first so you will see what it would do without it actually doing anything.
::
# Keep 7 end of day and 4 additional end of week archives.
# Do a dry-run without actually deleting anything.
$ borg prune -v --list --dry-run --keep-daily=7 --keep-weekly=4 /path/to/repo
# Same as above but only apply to archive names starting with the hostname
# of the machine followed by a "-" character:
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 --prefix='{hostname}-' /path/to/repo
# Keep 7 end of day, 4 additional end of week archives,
# and an end of month archive for every month:
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 --keep-monthly=-1 /path/to/repo
# Keep all backups in the last 10 days, 4 additional end of week archives,
# and an end of month archive for every month:
$ borg prune -v --list --keep-within=10d --keep-weekly=4 --keep-monthly=-1 /path/to/repo
There is also a visualized prune example in ``docs/misc/prune-example.txt``:
.. highlight:: none
.. include:: ../misc/prune-example.txt
:literal:
borgbackup-1.1.15/docs/usage/export-tar.rst.inc 0000644 0001750 0001750 00000022052 13771325506 021351 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_export-tar:
borg export-tar
---------------
.. code-block:: none
borg [common options] export-tar [options] ARCHIVE FILE [PATH...]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | archive to export |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``FILE`` | output tar file. "-" to write to stdout instead. |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--tar-filter`` | filter program to pipe data through |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
ARCHIVE
archive to export
FILE
output tar file. "-" to write to stdout instead.
PATH
paths to extract; patterns are supported
optional arguments
--tar-filter filter program to pipe data through
--list output verbose list of items (files, dirs, ...)
:ref:`common_options`
|
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
--strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
Description
~~~~~~~~~~~
This command creates a tarball from an archive.
When giving '-' as the output FILE, Borg will write a tar stream to standard output.
By default (``--tar-filter=auto``) Borg will detect whether the FILE should be compressed
based on its file extension and pipe the tarball through an appropriate filter
before writing it to FILE:
- .tar.gz: gzip
- .tar.bz2: bzip2
- .tar.xz: xz
Alternatively a ``--tar-filter`` program may be explicitly specified. It should
read the uncompressed tar stream from stdin and write a compressed/filtered
tar stream to stdout.
The generated tarball uses the GNU tar format.
export-tar is a lossy conversion:
BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported.
Timestamp resolution is limited to whole seconds, not the nanosecond resolution
otherwise supported by Borg.
A ``--sparse`` option (as found in borg extract) is not supported.
By default the entire archive is extracted but a subset of files and directories
can be selected by passing a list of ``PATHs`` as arguments.
The file selection can further be restricted by using the ``--exclude`` option.
See the output of the "borg help patterns" command for more help on exclude patterns.
``--progress`` can be slower than no progress display, since it makes one additional
pass over the archive metadata. borgbackup-1.1.15/docs/usage/upgrade.rst.inc 0000644 0001750 0001750 00000020034 13771325506 020671 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_upgrade:
borg upgrade
------------
.. code-block:: none
borg [common options] upgrade [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``REPOSITORY`` | path to the repository to be upgraded |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``--inplace`` | rewrite repository in place, with no chance of going back to older versions of the repository. |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``--force`` | Force upgrade |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``--tam`` | Enable manifest authentication (in key and cache) (Borg 1.0.9 and later). |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``--disable-tam`` | Disable manifest authentication (in key and cache). |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
path to the repository to be upgraded
optional arguments
-n, --dry-run do not change repository
--inplace rewrite repository in place, with no chance of going back to older versions of the repository.
--force Force upgrade
--tam Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).
--disable-tam Disable manifest authentication (in key and cache).
:ref:`common_options`
|
Description
~~~~~~~~~~~
Upgrade an existing, local Borg repository.
When you do not need borg upgrade
+++++++++++++++++++++++++++++++++
Not every change requires that you run ``borg upgrade``.
You do **not** need to run it when:
- moving your repository to a different place
- upgrading to another point release (like 1.0.x to 1.0.y),
except when noted otherwise in the changelog
- upgrading from 1.0.x to 1.1.x,
except when noted otherwise in the changelog
Borg 1.x.y upgrades
+++++++++++++++++++
Use ``borg upgrade --tam REPO`` to require manifest authentication
introduced with Borg 1.0.9 to address security issues. This means
that modifying the repository after doing this with a version prior
to 1.0.9 will raise a validation error, so only perform this upgrade
after updating all clients using the repository to 1.0.9 or newer.
This upgrade should be done on each client for safety reasons.
If a repository is accidentally modified with a pre-1.0.9 client after
this upgrade, use ``borg upgrade --tam --force REPO`` to remedy it.
If you routinely do this you might not want to enable this upgrade
(which will leave you exposed to the security issue). You can
reverse the upgrade by issuing ``borg upgrade --disable-tam REPO``.
See
https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability
for details.
Attic and Borg 0.xx to Borg 1.x
+++++++++++++++++++++++++++++++
This currently supports converting an Attic repository to Borg and also
helps with converting Borg 0.xx to 1.0.
Currently, only LOCAL repositories can be upgraded (issue #465).
Please note that ``borg create`` (since 1.0.0) uses bigger chunks by
default than old borg or attic did, so the new chunks won't deduplicate
with the old chunks in the upgraded repository.
See ``--chunker-params`` option of ``borg create`` and ``borg recreate``.
``borg upgrade`` will change the magic strings in the repository's
segments to match the new Borg magic strings. The keyfiles found in
$ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and
copied to $BORG_KEYS_DIR or ~/.config/borg/keys.
The cache files are converted, from $ATTIC_CACHE_DIR or
~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the
cache layout between Borg and Attic changed, so it is possible
the first backup after the conversion takes longer than expected
due to the cache resync.
Upgrade should be able to resume if interrupted, although it
will still iterate over all segments. If you want to start
from scratch, use `borg delete` over the copied repository to
make sure the cache files are also removed::
borg delete borg
Unless ``--inplace`` is specified, the upgrade process first creates a backup
copy of the repository, in REPOSITORY.before-upgrade-DATETIME, using hardlinks.
This requires that the repository and its parent directory reside on same
filesystem so the hardlink copy can work.
This takes longer than in place upgrades, but is much safer and gives
progress information (as opposed to ``cp -al``). Once you are satisfied
with the conversion, you can safely destroy the backup copy.
WARNING: Running the upgrade in place will make the current
copy unusable with older version, with no way of going back
to previous versions. This can PERMANENTLY DAMAGE YOUR
REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the
magic strings have changed. You have been warned. borgbackup-1.1.15/docs/usage/check.rst 0000644 0001750 0001750 00000000033 13771325506 017544 0 ustar user user 0000000 0000000 .. include:: check.rst.inc
borgbackup-1.1.15/docs/usage/prune.rst.inc 0000644 0001750 0001750 00000037667 13771325506 020417 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_prune:
borg prune
----------
.. code-block:: none
borg [common options] prune [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY`` | repository to prune |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--force`` | force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the deleted archive |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of archives it keeps/prunes |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-within INTERVAL`` | keep all archives within this time interval |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-last``, ``--keep-secondly`` | number of secondly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-minutely`` | number of minutely archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-H``, ``--keep-hourly`` | number of hourly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-d``, ``--keep-daily`` | number of daily archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-w``, ``--keep-weekly`` | number of weekly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-m``, ``--keep-monthly`` | number of monthly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-y``, ``--keep-yearly`` | number of yearly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
repository to prune
optional arguments
-n, --dry-run do not change repository
--force force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work.
-s, --stats print statistics for the deleted archive
--list output verbose list of archives it keeps/prunes
--keep-within INTERVAL keep all archives within this time interval
--keep-last, --keep-secondly number of secondly archives to keep
--keep-minutely number of minutely archives to keep
-H, --keep-hourly number of hourly archives to keep
-d, --keep-daily number of daily archives to keep
-w, --keep-weekly number of weekly archives to keep
-m, --keep-monthly number of monthly archives to keep
-y, --keep-yearly number of yearly archives to keep
--save-space work slower, but using less space
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
Description
~~~~~~~~~~~
The prune command prunes a repository by deleting all archives not matching
any of the specified retention options. This command is normally used by
automated backup scripts wanting to keep a certain number of historic backups.
Also, prune automatically removes checkpoint archives (incomplete archives left
behind by interrupted backup runs) except if the checkpoint is the latest
archive (and thus still needed). Checkpoint archives are not considered when
comparing archive counts against the retention limits (``--keep-X``).
If a prefix is set with -P, then only archives that start with the prefix are
considered for deletion and only those archives count towards the totals
specified by the rules.
Otherwise, *all* archives in the repository are candidates for deletion!
There is no automatic distinction between archives representing different
contents. These need to be distinguished by specifying matching prefixes.
If you have multiple sequences of archives with different data sets (e.g.
from different machines) in one shared repository, use one prune call per
data set that matches only the respective archives using the -P option.
The ``--keep-within`` option takes an argument of the form "",
where char is "H", "d", "w", "m", "y". For example, ``--keep-within 2d`` means
to keep all archives that were created within the past 48 hours.
"1m" is taken to mean "31d". The archives kept with this option do not
count towards the totals specified by any other options.
A good procedure is to thin out more and more the older your backups get.
As an example, ``--keep-daily 7`` means to keep the latest backup on each day,
up to 7 most recent days with backups (days without backups do not count).
The rules are applied from secondly to yearly, and backups selected by previous
rules do not count towards those of later rules. The time that each backup
starts is used for pruning purposes. Dates and times are interpreted in
the local timezone, and weeks go from Monday to Sunday. Specifying a
negative number of archives to keep means that there is no limit.
The ``--keep-last N`` option is doing the same as ``--keep-secondly N`` (and it will
keep the last N archives under the assumption that you do not create more than one
backup archive in the same second).
When using ``--stats``, you will get some statistics about how much data was
deleted - the "Deleted data" deduplicated size there is most interesting as
that is how much your repository will shrink.
Please note that the "All archives" stats refer to the state after pruning. borgbackup-1.1.15/docs/usage/lock.rst 0000644 0001750 0001750 00000000100 13771325506 017412 0 ustar user user 0000000 0000000 .. include:: with-lock.rst.inc
.. include:: break-lock.rst.inc
borgbackup-1.1.15/docs/usage/serve.rst.inc 0000644 0001750 0001750 00000023364 13771325506 020377 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_serve:
borg serve
----------
.. code-block:: none
borg [common options] serve [options]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--restrict-to-path PATH`` | restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub-directories is granted implicitly; PATH doesn't need to directly point to a repository. |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--restrict-to-repository PATH`` | restrict repository access. Only the repository located at PATH (no sub-directories are considered) is accessible. Can be specified multiple times to allow the client access to several repositories. Unlike ``--restrict-to-path`` sub-directories are not accessible; PATH needs to directly point at a repository location. PATH may be an empty directory or the last element of PATH may not exist, in which case the client may initialize a repository there. |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--append-only`` | only allow appending to repository segment files |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--storage-quota QUOTA`` | Override storage quota of the repository (e.g. 5G, 1.5T). When a new repository is initialized, sets the storage quota on the new repository as well. Default: no quota. |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
optional arguments
--restrict-to-path PATH restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub-directories is granted implicitly; PATH doesn't need to directly point to a repository.
--restrict-to-repository PATH restrict repository access. Only the repository located at PATH (no sub-directories are considered) is accessible. Can be specified multiple times to allow the client access to several repositories. Unlike ``--restrict-to-path`` sub-directories are not accessible; PATH needs to directly point at a repository location. PATH may be an empty directory or the last element of PATH may not exist, in which case the client may initialize a repository there.
--append-only only allow appending to repository segment files
--storage-quota QUOTA Override storage quota of the repository (e.g. 5G, 1.5T). When a new repository is initialized, sets the storage quota on the new repository as well. Default: no quota.
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command starts a repository server process. This command is usually not used manually. borgbackup-1.1.15/docs/usage/config.rst.inc 0000644 0001750 0001750 00000010150 13771325506 020505 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_config:
borg config
-----------
.. code-block:: none
borg [common options] config [options] [REPOSITORY] [NAME] [VALUE]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------------+----------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``REPOSITORY`` | repository to configure |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``NAME`` | name of config key |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``VALUE`` | new value for key |
+-------------------------------------------------------+----------------------+----------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``-c``, ``--cache`` | get and set values from the repo cache |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``-d``, ``--delete`` | delete the key from the config file |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``-l``, ``--list`` | list the configuration of the repo |
+-------------------------------------------------------+----------------------+----------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------------+----------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
repository to configure
NAME
name of config key
VALUE
new value for key
optional arguments
-c, --cache get and set values from the repo cache
-d, --delete delete the key from the config file
-l, --list list the configuration of the repo
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command gets and sets options in a local repository or cache config file.
For security reasons, this command only works on local repositories.
To delete a config value entirely, use ``--delete``. To list the values
of the configuration file or the default values, use ``--list``. To get and existing
key, pass only the key name. To set a key, pass both the key name and
the new value. Keys can be specified in the format "section.name" or
simply "name"; the section will default to "repository" and "cache" for
the repo and cache configs, respectively.
By default, borg config manipulates the repository config file. Using ``--cache``
edits the repository cache's config file instead. borgbackup-1.1.15/docs/usage/upgrade.rst 0000644 0001750 0001750 00000001675 13771325506 020133 0 ustar user user 0000000 0000000 .. include:: upgrade.rst.inc
Examples
~~~~~~~~
::
# Upgrade the borg repository to the most recent version.
$ borg upgrade -v /path/to/repo
making a hardlink copy in /path/to/repo.before-upgrade-2016-02-15-20:51:55
opening attic repository with borg and converting
no key file found for repository
converting repo index /path/to/repo/index.0
converting 1 segments...
converting borg 0.xx to borg current
no key file found for repository
.. _borg_key_migrate-to-repokey:
Upgrading a passphrase encrypted attic repo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attic offered a "passphrase" encryption mode, but this was removed in borg 1.0
and replaced by the "repokey" mode (which stores the passphrase-protected
encryption key into the repository config).
Thus, to upgrade a "passphrase" attic repo to a "repokey" borg repo, 2 steps
are needed, in this order:
- borg upgrade repo
- borg key migrate-to-repokey repo
borgbackup-1.1.15/docs/usage/list.rst.inc 0000644 0001750 0001750 00000052103 13771325506 020217 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_list:
borg list
---------
.. code-block:: none
borg [common options] list [options] [REPOSITORY_OR_ARCHIVE] [PATH...]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to list contents of |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to list; patterns are supported |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--short`` | only print file/directory names, nothing else |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--format FORMAT``, ``--list-format FORMAT`` | specify format for file listing (default: "{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}{NL}") |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | Only valid for listing repository contents. Format output as JSON. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "barchive" key is therefore not available. |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json-lines`` | Only valid for listing archive contents. Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "bpath" key is therefore not available. |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository or archive to list contents of
PATH
paths to list; patterns are supported
optional arguments
--short only print file/directory names, nothing else
--format FORMAT, --list-format FORMAT specify format for file listing (default: "{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}{NL}")
--json Only valid for listing repository contents. Format output as JSON. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "barchive" key is therefore not available.
--json-lines Only valid for listing archive contents. Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "bpath" key is therefore not available.
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
Description
~~~~~~~~~~~
This command lists the contents of a repository or an archive.
See the "borg help patterns" command for more help on exclude patterns.
.. man NOTES
The following keys are available for ``--format``:
- NEWLINE: OS dependent line separator
- NL: alias of NEWLINE
- NUL: NUL character for creating print0 / xargs -0 like output, see barchive/bpath
- SPACE
- TAB
- CR
- LF
Keys for listing repository archives:
- archive: archive name interpreted as text (might be missing non-text characters, see barchive)
- name: alias of "archive"
- barchive: verbatim archive name, can contain any character except NUL
- comment: archive comment interpreted as text (might be missing non-text characters, see bcomment)
- bcomment: verbatim archive comment, can contain any character except NUL
- id: internal ID of the archive
- start: time (start) of creation of the archive
- time: alias of "start"
- end: time (end) of creation of the archive
- hostname: hostname of host on which this archive was created
- username: username of user who created this archive
Keys for listing archive files:
- type
- mode
- uid
- gid
- user
- group
- path: path interpreted as text (might be missing non-text characters, see bpath)
- bpath: verbatim POSIX path, can contain any character except NUL
- source: link target for links (identical to linktarget)
- linktarget
- flags
- size
- csize: compressed size
- dsize: deduplicated size
- dcsize: deduplicated compressed size
- num_chunks: number of chunks in this file
- unique_chunks: number of unique chunks in this file
- mtime
- ctime
- atime
- isomtime
- isoctime
- isoatime
- md5
- sha1
- sha224
- sha256
- sha384
- sha512
- archiveid
- archivename
- extra: prepends {source} with " -> " for soft links and " link to " for hard links
- health: either "healthy" (file ok) or "broken" (if file has all-zero replacement chunks)
borgbackup-1.1.15/docs/usage/general/ 0000755 0001750 0001750 00000000000 13771325773 017364 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/usage/general/date-time.rst.inc 0000644 0001750 0001750 00000000451 13771325506 022531 0 ustar user user 0000000 0000000 Date and Time
~~~~~~~~~~~~~
We format date and time conforming to ISO-8601, that is: YYYY-MM-DD and
HH:MM:SS (24h clock).
For more information about that, see: https://xkcd.com/1179/
Unless otherwise noted, we display local date and time.
Internally, we store and process date and time as UTC.
borgbackup-1.1.15/docs/usage/general/resources.rst.inc 0000644 0001750 0001750 00000011014 13771325506 022667 0 ustar user user 0000000 0000000 Resource Usage
~~~~~~~~~~~~~~
Borg might use a lot of resources depending on the size of the data set it is dealing with.
If one uses Borg in a client/server way (with a ssh: repository),
the resource usage occurs in part on the client and in another part on the
server.
If one uses Borg as a single process (with a filesystem repo),
all the resource usage occurs in that one process, so just add up client +
server to get the approximate resource usage.
CPU client:
- **borg create:** does chunking, hashing, compression, crypto (high CPU usage)
- **chunks cache sync:** quite heavy on CPU, doing lots of hashtable operations.
- **borg extract:** crypto, decompression (medium to high CPU usage)
- **borg check:** similar to extract, but depends on options given.
- **borg prune / borg delete archive:** low to medium CPU usage
- **borg delete repo:** done on the server
It won't go beyond 100% of 1 core as the code is currently single-threaded.
Especially higher zlib and lzma compression levels use significant amounts
of CPU cycles. Crypto might be cheap on the CPU (if hardware accelerated) or
expensive (if not).
CPU server:
It usually doesn't need much CPU, it just deals with the key/value store
(repository) and uses the repository index for that.
borg check: the repository check computes the checksums of all chunks
(medium CPU usage)
borg delete repo: low CPU usage
CPU (only for client/server operation):
When using borg in a client/server way with a ssh:-type repo, the ssh
processes used for the transport layer will need some CPU on the client and
on the server due to the crypto they are doing - esp. if you are pumping
big amounts of data.
Memory (RAM) client:
The chunks index and the files index are read into memory for performance
reasons. Might need big amounts of memory (see below).
Compression, esp. lzma compression with high levels might need substantial
amounts of memory.
Memory (RAM) server:
The server process will load the repository index into memory. Might need
considerable amounts of memory, but less than on the client (see below).
Chunks index (client only):
Proportional to the amount of data chunks in your repo. Lots of chunks
in your repo imply a big chunks index.
It is possible to tweak the chunker params (see create options).
Files index (client only):
Proportional to the amount of files in your last backups. Can be switched
off (see create options), but next backup might be much slower if you do.
The speed benefit of using the files cache is proportional to file size.
Repository index (server only):
Proportional to the amount of data chunks in your repo. Lots of chunks
in your repo imply a big repository index.
It is possible to tweak the chunker params (see create options) to
influence the amount of chunks being created.
Temporary files (client):
Reading data and metadata from a FUSE mounted repository will consume up to
the size of all deduplicated, small chunks in the repository. Big chunks
won't be locally cached.
Temporary files (server):
A non-trivial amount of data will be stored on the remote temp directory
for each client that connects to it. For some remotes, this can fill the
default temporary directory at /tmp. This can be remediated by ensuring the
$TMPDIR, $TEMP, or $TMP environment variable is properly set for the sshd
process.
For some OSes, this can be done just by setting the correct value in the
.bashrc (or equivalent login config file for other shells), however in
other cases it may be necessary to first enable ``PermitUserEnvironment yes``
in your ``sshd_config`` file, then add ``environment="TMPDIR=/my/big/tmpdir"``
at the start of the public key to be used in the ``authorized_hosts`` file.
Cache files (client only):
Contains the chunks index and files index (plus a collection of single-
archive chunk indexes which might need huge amounts of disk space,
depending on archive count and size - see FAQ about how to reduce).
Network (only for client/server operation):
If your repository is remote, all deduplicated (and optionally compressed/
encrypted) data of course has to go over the connection (``ssh://`` repo url).
If you use a locally mounted network filesystem, additionally some copy
operations used for transaction support also go over the connection. If
you backup multiple sources to one target repository, additional traffic
happens for cache resynchronization.
borgbackup-1.1.15/docs/usage/general/file-systems.rst.inc 0000644 0001750 0001750 00000002517 13771325506 023311 0 ustar user user 0000000 0000000 File systems
~~~~~~~~~~~~
We strongly recommend against using Borg (or any other database-like
software) on non-journaling file systems like FAT, since it is not
possible to assume any consistency in case of power failures (or a
sudden disconnect of an external drive or similar failures).
While Borg uses a data store that is resilient against these failures
when used on journaling file systems, it is not possible to guarantee
this with some hardware -- independent of the software used. We don't
know a list of affected hardware.
If you are suspicious whether your Borg repository is still consistent
and readable after one of the failures mentioned above occurred, run
``borg check --verify-data`` to make sure it is consistent.
.. rubric:: Requirements for Borg repository file systems
- Long file names
- At least three directory levels with short names
- Typically, file sizes up to a few hundred MB.
Large repositories may require large files (>2 GB).
- Up to 1000 files per directory (10000 for repositories initialized with Borg 1.0)
- mkdir(2) should be atomic, since it is used for locking
- Hardlinks are needed for :ref:`borg_upgrade` (if ``--inplace`` option is not used).
Also hardlinks are used for more safe and secure file updating (e.g. of the repo
config file), but the code tries to work also if hardlinks are not supported.
borgbackup-1.1.15/docs/usage/general/return-codes.rst.inc 0000644 0001750 0001750 00000001172 13771325506 023273 0 ustar user user 0000000 0000000 Return codes
~~~~~~~~~~~~
Borg can exit with the following return codes (rc):
=========== =======
Return code Meaning
=========== =======
0 success (logged as INFO)
1 warning (operation reached its normal end, but there were warnings --
you should check the log, logged as WARNING)
2 error (like a fatal error, a local or remote exception, the operation
did not reach its normal end, logged as ERROR)
128+N killed by signal N (e.g. 137 == kill -9)
=========== =======
If you use ``--show-rc``, the return code is also logged at the indicated
level as the last log entry.
borgbackup-1.1.15/docs/usage/general/environment.rst.inc 0000644 0001750 0001750 00000022300 13771325506 023221 0 ustar user user 0000000 0000000 Environment Variables
~~~~~~~~~~~~~~~~~~~~~
Borg uses some environment variables for automation:
General:
BORG_REPO
When set, use the value to give the default repository location. If a command needs an archive
parameter, you can abbreviate as ``::archive``. If a command needs a repository parameter, you
can either leave it away or abbreviate as ``::``, if a positional parameter is required.
BORG_PASSPHRASE
When set, use the value to answer the passphrase question for encrypted repositories.
It is used when a passphrase is needed to access an encrypted repo as well as when a new
passphrase should be initially set when initializing an encrypted repo.
See also BORG_NEW_PASSPHRASE.
BORG_PASSCOMMAND
When set, use the standard output of the command (trailing newlines are stripped) to answer the
passphrase question for encrypted repositories.
It is used when a passphrase is needed to access an encrypted repo as well as when a new
passphrase should be initially set when initializing an encrypted repo. Note that the command
is executed without a shell. So variables, like ``$HOME`` will work, but ``~`` won't.
If BORG_PASSPHRASE is also set, it takes precedence.
See also BORG_NEW_PASSPHRASE.
BORG_PASSPHRASE_FD
When set, specifies a file descriptor to read a passphrase
from. Programs starting borg may choose to open an anonymous pipe
and use it to pass a passphrase. This is safer than passing via
BORG_PASSPHRASE, because on some systems (e.g. Linux) environment
can be examined by other processes.
If BORG_PASSPHRASE or BORG_PASSCOMMAND are also set, they take precedence.
BORG_NEW_PASSPHRASE
When set, use the value to answer the passphrase question when a **new** passphrase is asked for.
This variable is checked first. If it is not set, BORG_PASSPHRASE and BORG_PASSCOMMAND will also
be checked.
Main usecase for this is to fully automate ``borg change-passphrase``.
BORG_DISPLAY_PASSPHRASE
When set, use the value to answer the "display the passphrase for verification" question when defining a new passphrase for encrypted repositories.
BORG_HOSTNAME_IS_UNIQUE=no
Borg assumes that it can derive a unique hostname / identity (see ``borg debug info``).
If this is not the case or you do not want Borg to automatically remove stale locks,
set this to *no*.
BORG_HOST_ID
Borg usually computes a host id from the FQDN plus the results of ``uuid.getnode()`` (which usually returns
a unique id based on the MAC address of the network interface. Except if that MAC happens to be all-zero - in
that case it returns a random value, which is not what we want (because it kills automatic stale lock removal).
So, if you have a all-zero MAC address or other reasons to better externally control the host id, just set this
environment variable to a unique value. If all your FQDNs are unique, you can just use the FQDN. If not,
use fqdn@uniqueid.
BORG_LOGGING_CONF
When set, use the given filename as INI_-style logging configuration.
A basic example conf can be found at ``docs/misc/logging.conf``.
BORG_RSH
When set, use this command instead of ``ssh``. This can be used to specify ssh options, such as
a custom identity file ``ssh -i /path/to/private/key``. See ``man ssh`` for other options. Using
the ``--rsh CMD`` commandline option overrides the environment variable.
BORG_REMOTE_PATH
When set, use the given path as borg executable on the remote (defaults to "borg" if unset).
Using ``--remote-path PATH`` commandline option overrides the environment variable.
BORG_FILES_CACHE_SUFFIX
When set to a value at least one character long, instructs borg to use a specifically named
(based on the suffix) alternative files cache. This can be used to avoid loading and saving
cache entries for backup sources other than the current sources.
BORG_FILES_CACHE_TTL
When set to a numeric value, this determines the maximum "time to live" for the files cache
entries (default: 20). The files cache is used to quickly determine whether a file is unchanged.
The FAQ explains this more detailed in: :ref:`always_chunking`
BORG_SHOW_SYSINFO
When set to no (default: yes), system information (like OS, Python version, ...) in
exceptions is not shown.
Please only use for good reasons as it makes issues harder to analyze.
BORG_WORKAROUNDS
A list of comma separated strings that trigger workarounds in borg,
e.g. to work around bugs in other software.
Currently known strings are:
basesyncfile
Use the more simple BaseSyncFile code to avoid issues with sync_file_range.
You might need this to run borg on WSL (Windows Subsystem for Linux) or
in systemd.nspawn containers on some architectures (e.g. ARM).
Using this does not affect data safety, but might result in a more bursty
write to disk behaviour (not continuously streaming to disk).
Some automatic "answerers" (if set, they automatically answer confirmation questions):
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes)
For "Warning: Attempting to access a previously unknown unencrypted repository"
BORG_RELOCATED_REPO_ACCESS_IS_OK=no (or =yes)
For "Warning: The repository at location ... was previously located at ..."
BORG_CHECK_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
For "This is a potentially dangerous function..." (check --repair)
BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
For "You requested to completely DELETE the repository *including* all archives it contains:"
Note: answers are case sensitive. setting an invalid answer value might either give the default
answer or ask you interactively, depending on whether retries are allowed (they by default are
allowed). So please test your scripts interactively before making them a non-interactive script.
.. _XDG env var: https://specifications.freedesktop.org/basedir-spec/0.6/ar01s03.html
Directories and files:
BORG_BASE_DIR
Defaults to ``$HOME`` or ``~$USER`` or ``~`` (in that order).
If you want to move all borg-specific folders to a custom path at once, all you need to do is
to modify ``BORG_BASE_DIR``: the other paths for cache, config etc. will adapt accordingly
(assuming you didn't set them to a different custom value).
BORG_CACHE_DIR
Defaults to ``$BORG_BASE_DIR/.cache/borg``. If ``BORG_BASE_DIR`` is not explicitly set while
`XDG env var`_ ``XDG_CACHE_HOME`` is set, then ``$XDG_CACHE_HOME/borg`` is being used instead.
This directory contains the local cache and might need a lot
of space for dealing with big repositories. Make sure you're aware of the associated
security aspects of the cache location: :ref:`cache_security`
BORG_CONFIG_DIR
Defaults to ``$BORG_BASE_DIR/.config/borg``. If ``BORG_BASE_DIR`` is not explicitly set while
`XDG env var`_ ``XDG_CONFIG_HOME`` is set, then ``$XDG_CONFIG_HOME/borg`` is being used instead.
This directory contains all borg configuration directories, see the FAQ
for a security advisory about the data in this directory: :ref:`home_config_borg`
BORG_SECURITY_DIR
Defaults to ``$BORG_CONFIG_DIR/security``.
This directory contains information borg uses to track its usage of NONCES ("numbers used
once" - usually in encryption context) and other security relevant data.
BORG_KEYS_DIR
Defaults to ``$BORG_CONFIG_DIR/keys``.
This directory contains keys for encrypted repositories.
BORG_KEY_FILE
When set, use the given filename as repository key file.
TMPDIR
This is where temporary files are stored (might need a lot of temporary space for some
operations), see tempfile_ for details.
Building:
BORG_OPENSSL_PREFIX
Adds given OpenSSL header file directory to the default locations (setup.py).
BORG_LIBLZ4_PREFIX
Adds given prefix directory to the default locations. If a 'include/lz4.h' is found Borg
will be linked against the system liblz4 instead of a bundled implementation. (setup.py)
BORG_LIBB2_PREFIX
Adds given prefix directory to the default locations. If a 'include/blake2.h' is found Borg
will be linked against the system libb2 instead of a bundled implementation. (setup.py)
BORG_LIBZSTD_PREFIX
Adds given prefix directory to the default locations. If a 'include/zstd.h' is found Borg
will be linked against the system libzstd instead of a bundled implementation. (setup.py)
Please note:
- Be very careful when using the "yes" sayers, the warnings with prompt exist for your / your data's security/safety.
- Also be very careful when putting your passphrase into a script, make sure it has appropriate file permissions (e.g.
mode 600, root:root).
.. _INI: https://docs.python.org/3/library/logging.config.html#configuration-file-format
.. _tempfile: https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir
borgbackup-1.1.15/docs/usage/general/repository-locations.rst.inc 0000644 0001750 0001750 00000001125 13771325506 025067 0 ustar user user 0000000 0000000 Repository / Archive Locations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many commands want either a repository (just give the repo URL, see above) or
an archive location, which is a repo URL followed by ``::archive_name``.
Archive names must not contain the ``/`` (slash) character. For simplicity,
maybe also avoid blanks or other characters that have special meaning on the
shell or in a filesystem (borg mount will use the archive name as directory
name).
If you have set BORG_REPO (see above) and an archive location is needed, use
``::archive_name`` - the repo URL part is then read from BORG_REPO.
borgbackup-1.1.15/docs/usage/general/units.rst.inc 0000644 0001750 0001750 00000000763 13771325506 022030 0 ustar user user 0000000 0000000 Units
~~~~~
To display quantities, Borg takes care of respecting the
usual conventions of scale. Disk sizes are displayed in `decimal
`_, using powers of ten (so
``kB`` means 1000 bytes). For memory usage, `binary prefixes
`_ are used, and are
indicated using the `IEC binary prefixes
`_,
using powers of two (so ``KiB`` means 1024 bytes).
borgbackup-1.1.15/docs/usage/general/file-metadata.rst.inc 0000644 0001750 0001750 00000005774 13771325506 023372 0 ustar user user 0000000 0000000 Support for file metadata
~~~~~~~~~~~~~~~~~~~~~~~~~
Besides regular file and directory structures, Borg can preserve
* symlinks (stored as symlink, the symlink is not followed)
* special files:
* character and block device files (restored via mknod)
* FIFOs ("named pipes")
* special file *contents* can be backed up in ``--read-special`` mode.
By default the metadata to create them with mknod(2), mkfifo(2) etc. is stored.
* hardlinked regular files, devices, FIFOs (considering all items in the same archive)
* timestamps in nanosecond precision: mtime, atime, ctime
* other timestamps: birthtime (on platforms supporting it)
* permissions:
* IDs of owning user and owning group
* names of owning user and owning group (if the IDs can be resolved)
* Unix Mode/Permissions (u/g/o permissions, suid, sgid, sticky)
On some platforms additional features are supported:
.. Yes/No's are grouped by reason/mechanism/reference.
+-------------------------+----------+-----------+------------+
| Platform | ACLs | xattr | Flags |
| | [#acls]_ | [#xattr]_ | [#flags]_ |
+=========================+==========+===========+============+
| Linux | Yes | Yes | Yes [1]_ |
+-------------------------+----------+-----------+------------+
| Mac OS X | Yes | Yes | Yes (all) |
+-------------------------+----------+-----------+------------+
| FreeBSD | Yes | Yes | Yes (all) |
+-------------------------+----------+-----------+------------+
| OpenBSD | n/a | n/a | Yes (all) |
+-------------------------+----------+-----------+------------+
| NetBSD | n/a | No [2]_ | Yes (all) |
+-------------------------+----------+-----------+------------+
| Solaris and derivatives | No [3]_ | No [3]_ | n/a |
+-------------------------+----------+-----------+------------+
| Windows (cygwin) | No [4]_ | No | No |
+-------------------------+----------+-----------+------------+
Other Unix-like operating systems may work as well, but have not been tested at all.
Note that most of the platform-dependent features also depend on the file system.
For example, ntfs-3g on Linux isn't able to convey NTFS ACLs.
.. [1] Only "nodump", "immutable", "compressed" and "append" are supported.
Feature request :issue:`618` for more flags.
.. [2] Feature request :issue:`1332`
.. [3] Feature request :issue:`1337`
.. [4] Cygwin tries to map NTFS ACLs to permissions with varying degrees of success.
.. [#acls] The native access control list mechanism of the OS. This normally limits access to
non-native ACLs. For example, NTFS ACLs aren't completely accessible on Linux with ntfs-3g.
.. [#xattr] extended attributes; key-value pairs attached to a file, mainly used by the OS.
This includes resource forks on Mac OS X.
.. [#flags] aka *BSD flags*. The Linux set of flags [1]_ is portable across platforms.
The BSDs define additional flags.
borgbackup-1.1.15/docs/usage/general/repository-urls.rst.inc 0000644 0001750 0001750 00000003506 13771325506 024066 0 ustar user user 0000000 0000000 Repository URLs
~~~~~~~~~~~~~~~
**Local filesystem** (or locally mounted network filesystem):
``/path/to/repo`` - filesystem path to repo directory, absolute path
``path/to/repo`` - filesystem path to repo directory, relative path
Also, stuff like ``~/path/to/repo`` or ``~other/path/to/repo`` works (this is
expanded by your shell).
Note: you may also prepend a ``file://`` to a filesystem path to get URL style.
**Remote repositories** accessed via ssh user@host:
``user@host:/path/to/repo`` - remote repo, absolute path
``ssh://user@host:port/path/to/repo`` - same, alternative syntax, port can be given
**Remote repositories with relative paths** can be given using this syntax:
``user@host:path/to/repo`` - path relative to current directory
``user@host:~/path/to/repo`` - path relative to user's home directory
``user@host:~other/path/to/repo`` - path relative to other's home directory
Note: giving ``user@host:/./path/to/repo`` or ``user@host:/~/path/to/repo`` or
``user@host:/~other/path/to/repo`` is also supported, but not required here.
**Remote repositories with relative paths, alternative syntax with port**:
``ssh://user@host:port/./path/to/repo`` - path relative to current directory
``ssh://user@host:port/~/path/to/repo`` - path relative to user's home directory
``ssh://user@host:port/~other/path/to/repo`` - path relative to other's home directory
If you frequently need the same repo URL, it is a good idea to set the
``BORG_REPO`` environment variable to set a default for the repo URL:
::
export BORG_REPO='ssh://user@host:port/path/to/repo'
Then just leave away the repo URL if only a repo URL is needed and you want
to use the default - it will be read from BORG_REPO then.
Use ``::`` syntax to give the repo URL when syntax requires giving a positional
argument for the repo (e.g. ``borg mount :: /mnt``).
borgbackup-1.1.15/docs/usage/general/positional-arguments.rst.inc 0000644 0001750 0001750 00000001205 13771325506 025042 0 ustar user user 0000000 0000000 Positional Arguments and Options: Order matters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Borg only supports taking options (``-s`` and ``--progress`` in the example)
to the left or right of all positional arguments (``repo::archive`` and ``path``
in the example), but not in between them:
::
borg create -s --progress repo::archive path # good and preferred
borg create repo::archive path -s --progress # also works
borg create -s repo::archive path --progress # works, but ugly
borg create repo::archive -s --progress path # BAD
This is due to a problem in the argparse module: https://bugs.python.org/issue15112
borgbackup-1.1.15/docs/usage/general/logging.rst.inc 0000644 0001750 0001750 00000003202 13771325506 022303 0 ustar user user 0000000 0000000 Logging
~~~~~~~
Borg writes all log output to stderr by default. But please note that something
showing up on stderr does *not* indicate an error condition just because it is
on stderr. Please check the log levels of the messages and the return code of
borg for determining error, warning or success conditions.
If you want to capture the log output to a file, just redirect it:
::
borg create repo::archive myfiles 2>> logfile
Custom logging configurations can be implemented via BORG_LOGGING_CONF.
The log level of the builtin logging configuration defaults to WARNING.
This is because we want Borg to be mostly silent and only output
warnings, errors and critical messages, unless output has been requested
by supplying an option that implies output (e.g. ``--list`` or ``--progress``).
Log levels: DEBUG < INFO < WARNING < ERROR < CRITICAL
Use ``--debug`` to set DEBUG log level -
to get debug, info, warning, error and critical level output.
Use ``--info`` (or ``-v`` or ``--verbose``) to set INFO log level -
to get info, warning, error and critical level output.
Use ``--warning`` (default) to set WARNING log level -
to get warning, error and critical level output.
Use ``--error`` to set ERROR log level -
to get error and critical level output.
Use ``--critical`` to set CRITICAL log level -
to get critical level output.
While you can set misc. log levels, do not expect that every command will
give different output on different log levels - it's just a possibility.
.. warning:: Options ``--critical`` and ``--error`` are provided for completeness,
their usage is not recommended as you might miss important information.
borgbackup-1.1.15/docs/usage/rename.rst.inc 0000644 0001750 0001750 00000003514 13771325506 020515 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_rename:
borg rename
-----------
.. code-block:: none
borg [common options] rename [options] ARCHIVE NEWNAME
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+-------------+-----------------------------+
| **positional arguments** |
+-------------------------------------------------------+-------------+-----------------------------+
| | ``ARCHIVE`` | archive to rename |
+-------------------------------------------------------+-------------+-----------------------------+
| | ``NEWNAME`` | the new archive name to use |
+-------------------------------------------------------+-------------+-----------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+-------------+-----------------------------+
.. raw:: html
.. only:: latex
ARCHIVE
archive to rename
NEWNAME
the new archive name to use
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command renames an archive in the repository.
This results in a different archive ID. borgbackup-1.1.15/docs/usage/borgfs.rst 0000644 0001750 0001750 00000000046 13771325506 017755 0 ustar user user 0000000 0000000 :orphan:
.. include:: borgfs.rst.inc
borgbackup-1.1.15/docs/usage/benchmark_crud.rst.inc 0000644 0001750 0001750 00000010211 13771325506 022205 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_benchmark_crud:
borg benchmark crud
-------------------
.. code-block:: none
borg [common options] benchmark crud [options] REPOSITORY PATH
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+----------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------+----------------------------------------------+
| | ``REPOSITORY`` | repository to use for benchmark (must exist) |
+-------------------------------------------------------+----------------+----------------------------------------------+
| | ``PATH`` | path were to create benchmark input data |
+-------------------------------------------------------+----------------+----------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+----------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
repository to use for benchmark (must exist)
PATH
path were to create benchmark input data
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command benchmarks borg CRUD (create, read, update, delete) operations.
It creates input data below the given PATH and backups this data into the given REPO.
The REPO must already exist (it could be a fresh empty repo or an existing repo, the
command will create / read / update / delete some archives named borg-benchmark-crud\* there.
Make sure you have free space there, you'll need about 1GB each (+ overhead).
If your repository is encrypted and borg needs a passphrase to unlock the key, use::
BORG_PASSPHRASE=mysecret borg benchmark crud REPO PATH
Measurements are done with different input file sizes and counts.
The file contents are very artificial (either all zero or all random),
thus the measurement results do not necessarily reflect performance with real data.
Also, due to the kind of content used, no compression is used in these benchmarks.
C- == borg create (1st archive creation, no compression, do not use files cache)
C-Z- == all-zero files. full dedup, this is primarily measuring reader/chunker/hasher.
C-R- == random files. no dedup, measuring throughput through all processing stages.
R- == borg extract (extract archive, dry-run, do everything, but do not write files to disk)
R-Z- == all zero files. Measuring heavily duplicated files.
R-R- == random files. No duplication here, measuring throughput through all processing
stages, except writing to disk.
U- == borg create (2nd archive creation of unchanged input files, measure files cache speed)
The throughput value is kind of virtual here, it does not actually read the file.
U-Z- == needs to check the 2 all-zero chunks' existence in the repo.
U-R- == needs to check existence of a lot of different chunks in the repo.
D- == borg delete archive (delete last remaining archive, measure deletion + compaction)
D-Z- == few chunks to delete / few segments to compact/remove.
D-R- == many chunks to delete / many segments to compact/remove.
Please note that there might be quite some variance in these measurements.
Try multiple measurements and having a otherwise idle machine (and network, if you use it). borgbackup-1.1.15/docs/usage/info.rst 0000644 0001750 0001750 00000005212 13771325506 017426 0 ustar user user 0000000 0000000 .. include:: info.rst.inc
Examples
~~~~~~~~
::
$ borg info /path/to/repo::2017-06-29T11:00-srv
Archive name: 2017-06-29T11:00-srv
Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5
Comment:
Hostname: myhostname
Username: root
Time (start): Thu, 2017-06-29 11:03:07
Time (end): Thu, 2017-06-29 11:03:13
Duration: 5.66 seconds
Number of files: 17037
Command line: /usr/sbin/borg create /path/to/repo::2017-06-29T11:00-srv /srv
Utilization of max. archive size: 0%
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 12.53 GB 12.49 GB 1.62 kB
All archives: 121.82 TB 112.41 TB 215.42 GB
Unique chunks Total chunks
Chunk index: 1015213 626934122
$ borg info /path/to/repo --last 1
Archive name: 2017-06-29T11:00-srv
Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5
Comment:
Hostname: myhostname
Username: root
Time (start): Thu, 2017-06-29 11:03:07
Time (end): Thu, 2017-06-29 11:03:13
Duration: 5.66 seconds
Number of files: 17037
Command line: /usr/sbin/borg create /path/to/repo::2017-06-29T11:00-srv /srv
Utilization of max. archive size: 0%
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 12.53 GB 12.49 GB 1.62 kB
All archives: 121.82 TB 112.41 TB 215.42 GB
Unique chunks Total chunks
Chunk index: 1015213 626934122
$ borg info /path/to/repo
Repository ID: d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5
Location: /path/to/repo
Encrypted: Yes (repokey)
Cache: /root/.cache/borg/d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5
Security dir: /root/.config/borg/security/d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
All archives: 121.82 TB 112.41 TB 215.42 GB
Unique chunks Total chunks
Chunk index: 1015213 626934122
borgbackup-1.1.15/docs/usage/extract.rst 0000644 0001750 0001750 00000001402 13771325506 020142 0 ustar user user 0000000 0000000 .. include:: extract.rst.inc
Examples
~~~~~~~~
::
# Extract entire archive
$ borg extract /path/to/repo::my-files
# Extract entire archive and list files while processing
$ borg extract --list /path/to/repo::my-files
# Verify whether an archive could be successfully extracted, but do not write files to disk
$ borg extract --dry-run /path/to/repo::my-files
# Extract the "src" directory
$ borg extract /path/to/repo::my-files home/USERNAME/src
# Extract the "src" directory but exclude object files
$ borg extract /path/to/repo::my-files home/USERNAME/src --exclude '*.o'
# Restore a raw device (must not be active/in use/mounted at that time)
$ borg extract --stdout /path/to/repo::my-sdx | dd of=/dev/sdx bs=10M
borgbackup-1.1.15/docs/usage/with-lock.rst.inc 0000644 0001750 0001750 00000005100 13771325506 021140 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_with-lock:
borg with-lock
--------------
.. code-block:: none
borg [common options] with-lock [options] REPOSITORY COMMAND [ARGS...]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+--------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------+--------------------+
| | ``REPOSITORY`` | repository to lock |
+-------------------------------------------------------+----------------+--------------------+
| | ``COMMAND`` | command to run |
+-------------------------------------------------------+----------------+--------------------+
| | ``ARGS`` | command arguments |
+-------------------------------------------------------+----------------+--------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+--------------------+
.. raw:: html
.. only:: latex
REPOSITORY
repository to lock
COMMAND
command to run
ARGS
command arguments
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command runs a user-specified command while the repository lock is held.
It will first try to acquire the lock (make sure that no other operation is
running in the repo), then execute the given command as a subprocess and wait
for its termination, release the lock and return the user command's return
code as borg's return code.
.. note::
If you copy a repository with the lock held, the lock will be present in
the copy. Thus, before using borg on the copy from a different host,
you need to use "borg break-lock" on the copied repository, because
Borg is cautious and does not automatically remove stale locks made by a different host. borgbackup-1.1.15/docs/usage/mount.rst 0000644 0001750 0001750 00000004330 13771325506 017635 0 ustar user user 0000000 0000000 .. include:: mount.rst.inc
.. include:: umount.rst.inc
Examples
~~~~~~~~
::
# Mounting the repository shows all archives.
# Archives are loaded lazily, expect some delay when navigating to an archive
# for the first time.
$ borg mount /path/to/repo /tmp/mymountpoint
$ ls /tmp/mymountpoint
root-2016-02-14 root-2016-02-15
$ borg umount /tmp/mymountpoint
# Mounting a specific archive is possible as well.
$ borg mount /path/to/repo::root-2016-02-15 /tmp/mymountpoint
$ ls /tmp/mymountpoint
bin boot etc home lib lib64 lost+found media mnt opt
root sbin srv tmp usr var
$ borg umount /tmp/mymountpoint
# The experimental "versions view" merges all archives in the repository
# and provides a versioned view on files.
$ borg mount -o versions /path/to/repo /tmp/mymountpoint
$ ls -l /tmp/mymountpoint/home/user/doc.txt/
total 24
-rw-rw-r-- 1 user group 12357 Aug 26 21:19 doc.cda00bc9.txt
-rw-rw-r-- 1 user group 12204 Aug 26 21:04 doc.fa760f28.txt
$ borg umount /tmp/mymountpoint
# Archive filters are supported.
# These are especially handy for the "versions view",
# which does not support lazy processing of archives.
$ borg mount -o versions --glob-archives '*-my-home' --last 10 /path/to/repo /tmp/mymountpoint
# Exclusion options are supported.
# These can speed up mounting and lower memory needs significantly.
$ borg mount /path/to/repo /tmp/mymountpoint only/that/path
$ borg mount --exclude '...' /path/to/repo /tmp/mymountpoint
borgfs
++++++
::
$ echo '/mnt/backup /tmp/myrepo fuse.borgfs defaults,noauto 0 0' >> /etc/fstab
$ echo '/mnt/backup::root-2016-02-15 /tmp/myarchive fuse.borgfs defaults,noauto 0 0' >> /etc/fstab
$ mount /tmp/myrepo
$ mount /tmp/myarchive
$ ls /tmp/myrepo
root-2016-02-01 root-2016-02-2015
$ ls /tmp/myarchive
bin boot etc home lib lib64 lost+found media mnt opt root sbin srv tmp usr var
.. Note::
``borgfs`` will be automatically provided if you used a distribution
package, ``pip`` or ``setup.py`` to install Borg. Users of the
standalone binary will have to manually create a symlink (see
:ref:`pyinstaller-binary`).
borgbackup-1.1.15/docs/usage/delete.rst.inc 0000644 0001750 0001750 00000027145 13771325506 020516 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_delete:
borg delete
-----------
.. code-block:: none
borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE] [ARCHIVE...]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to delete |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | archives to delete |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the deleted archive |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--cache-only`` | delete only the local cache for the given repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--force`` | force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository or archive to delete
ARCHIVE
archives to delete
optional arguments
-n, --dry-run do not change repository
-s, --stats print statistics for the deleted archive
--cache-only delete only the local cache for the given repository
--force force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work.
--save-space work slower, but using less space
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Description
~~~~~~~~~~~
This command deletes an archive from the repository or the complete repository.
Disk space is reclaimed accordingly. If you delete the complete repository, the
local cache for it (if any) is also deleted.
When using ``--stats``, you will get some statistics about how much data was
deleted - the "Deleted data" deduplicated size there is most interesting as
that is how much your repository will shrink.
Please note that the "All archives" stats refer to the state after deletion. borgbackup-1.1.15/docs/usage/help.rst.inc 0000644 0001750 0001750 00000033027 13771325506 020200 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_patterns:
borg help patterns
~~~~~~~~~~~~~~~~~~
The path/filenames used as input for the pattern matching start from the
currently active recursion root. You usually give the recursion root(s)
when invoking borg and these can be either relative or absolute paths.
So, when you give `relative/` as root, the paths going into the matcher
will look like `relative/.../file.ext`. When you give `/absolute/` as
root, they will look like `/absolute/.../file.ext`. This is meant when
we talk about "full path" below.
File paths in Borg archives are always stored normalized and relative.
This means that e.g. ``borg create /path/to/repo ../some/path`` will
store all files as `some/path/.../file.ext` and ``borg create
/path/to/repo /home/user`` will store all files as
`home/user/.../file.ext`. Therefore, always use relative paths in your
patterns when matching archive content in commands like ``extract`` or
``mount``. Starting with Borg 1.2 this behaviour will be changed to
accept both absolute and relative paths.
File patterns support these styles: fnmatch, shell, regular expressions,
path prefixes and path full-matches. By default, fnmatch is used for
``--exclude`` patterns and shell-style is used for the experimental
``--pattern`` option.
If followed by a colon (':') the first two characters of a pattern are
used as a style selector. Explicit style selection is necessary when a
non-default style is desired or when the desired pattern starts with
two alphanumeric characters followed by a colon (i.e. `aa:something/*`).
`Fnmatch `_, selector `fm:`
This is the default style for ``--exclude`` and ``--exclude-from``.
These patterns use a variant of shell pattern syntax, with '\*' matching
any number of characters, '?' matching any single character, '[...]'
matching any single character specified, including ranges, and '[!...]'
matching any character not specified. For the purpose of these patterns,
the path separator (backslash for Windows and '/' on other systems) is not
treated specially. Wrap meta-characters in brackets for a literal
match (i.e. `[?]` to match the literal character `?`). For a path
to match a pattern, the full path must match, or it must match
from the start of the full path to just before a path separator. Except
for the root path, paths will never end in the path separator when
matching is attempted. Thus, if a given pattern ends in a path
separator, a '\*' is appended before matching is attempted.
Shell-style patterns, selector `sh:`
This is the default style for ``--pattern`` and ``--patterns-from``.
Like fnmatch patterns these are similar to shell patterns. The difference
is that the pattern may include `**/` for matching zero or more directory
levels, `*` for matching zero or more arbitrary characters with the
exception of any path separator.
Regular expressions, selector `re:`
Regular expressions similar to those found in Perl are supported. Unlike
shell patterns regular expressions are not required to match the full
path and any substring match is sufficient. It is strongly recommended to
anchor patterns to the start ('^'), to the end ('$') or both. Path
separators (backslash for Windows and '/' on other systems) in paths are
always normalized to a forward slash ('/') before applying a pattern. The
regular expression syntax is described in the `Python documentation for
the re module `_.
Path prefix, selector `pp:`
This pattern style is useful to match whole sub-directories. The pattern
`pp:root/somedir` matches `root/somedir` and everything therein.
Path full-match, selector `pf:`
This pattern style is (only) useful to match full paths.
This is kind of a pseudo pattern as it can not have any variable or
unspecified parts - the full path must be given.
`pf:root/file.ext` matches `root/file.ext` only.
Implementation note: this is implemented via very time-efficient O(1)
hashtable lookups (this means you can have huge amounts of such patterns
without impacting performance much).
Due to that, this kind of pattern does not respect any context or order.
If you use such a pattern to include a file, it will always be included
(if the directory recursion encounters it).
Other include/exclude patterns that would normally match will be ignored.
Same logic applies for exclude.
.. note::
`re:`, `sh:` and `fm:` patterns are all implemented on top of the Python SRE
engine. It is very easy to formulate patterns for each of these types which
requires an inordinate amount of time to match paths. If untrusted users
are able to supply patterns, ensure they cannot supply `re:` patterns.
Further, ensure that `sh:` and `fm:` patterns only contain a handful of
wildcards at most.
Exclusions can be passed via the command line option ``--exclude``. When used
from within a shell the patterns should be quoted to protect them from
expansion.
The ``--exclude-from`` option permits loading exclusion patterns from a text
file with one pattern per line. Lines empty or starting with the number sign
('#') after removing whitespace on both ends are ignored. The optional style
selector prefix is also supported for patterns loaded from a file. Due to
whitespace removal paths with whitespace at the beginning or end can only be
excluded using regular expressions.
To test your exclusion patterns without performing an actual backup you can
run ``borg create --list --dry-run ...``.
Examples::
# Exclude '/home/user/file.o' but not '/home/user/file.odt':
$ borg create -e '*.o' backup /
# Exclude '/home/user/junk' and '/home/user/subdir/junk' but
# not '/home/user/importantjunk' or '/etc/junk':
$ borg create -e '/home/*/junk' backup /
# Exclude the contents of '/home/user/cache' but not the directory itself:
$ borg create -e /home/user/cache/ backup /
# The file '/home/user/cache/important' is *not* backed up:
$ borg create -e /home/user/cache/ backup / /home/user/cache/important
# The contents of directories in '/home' are not backed up when their name
# ends in '.tmp'
$ borg create --exclude 're:^/home/[^/]+\.tmp/' backup /
# Load exclusions from file
$ cat >exclude.txt <`_, e.g. {now:%Y-%m-%d_%H:%M:%S}
{utcnow}
The current UTC date and time, by default in ISO-8601 format.
You can also supply your own `format string `_, e.g. {utcnow:%Y-%m-%d_%H:%M:%S}
{user}
The user name (or UID, if no name is available) of the user running borg.
{pid}
The current process ID.
{borgversion}
The version of borg, e.g.: 1.0.8rc1
{borgmajor}
The version of borg, only the major version, e.g.: 1
{borgminor}
The version of borg, only major and minor version, e.g.: 1.0
{borgpatch}
The version of borg, only major, minor and patch version, e.g.: 1.0.8
If literal curly braces need to be used, double them for escaping::
borg create /path/to/repo::{{literal_text}}
Examples::
borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
borg prune --prefix '{hostname}-' ...
.. note::
systemd uses a difficult, non-standard syntax for command lines in unit files (refer to
the `systemd.unit(5)` manual page).
When invoking borg from unit files, pay particular attention to escaping,
especially when using the now/utcnow placeholders, since systemd performs its own
%-based variable replacement even in quoted text. To avoid interference from systemd,
double all percent signs (``{hostname}-{now:%Y-%m-%d_%H:%M:%S}``
becomes ``{hostname}-{now:%%Y-%%m-%%d_%%H:%%M:%%S}``).
.. _borg_compression:
borg help compression
~~~~~~~~~~~~~~~~~~~~~
It is no problem to mix different compression methods in one repo,
deduplication is done on the source data chunks (not on the compressed
or encrypted data).
If some specific chunk was once compressed and stored into the repo, creating
another backup that also uses this chunk will not change the stored chunk.
So if you use different compression specs for the backups, whichever stores a
chunk first determines its compression. See also borg recreate.
Compression is lz4 by default. If you want something else, you have to specify what you want.
Valid compression specifiers are:
none
Do not compress.
lz4
Use lz4 compression. Very high speed, very low compression. (default)
zstd[,L]
Use zstd ("zstandard") compression, a modern wide-range algorithm.
If you do not explicitely give the compression level L (ranging from 1
to 22), it will use level 3.
Archives compressed with zstd are not compatible with borg < 1.1.4.
zlib[,L]
Use zlib ("gz") compression. Medium speed, medium compression.
If you do not explicitely give the compression level L (ranging from 0
to 9), it will use level 6.
Giving level 0 (means "no compression", but still has zlib protocol
overhead) is usually pointless, you better use "none" compression.
lzma[,L]
Use lzma ("xz") compression. Low speed, high compression.
If you do not explicitely give the compression level L (ranging from 0
to 9), it will use level 6.
Giving levels above 6 is pointless and counterproductive because it does
not compress better due to the buffer size used by borg - but it wastes
lots of CPU cycles and RAM.
auto,C[,L]
Use a built-in heuristic to decide per chunk whether to compress or not.
The heuristic tries with lz4 whether the data is compressible.
For incompressible data, it will not use compression (uses "none").
For compressible data, it uses the given C[,L] compression - with C[,L]
being any valid compression specifier.
Examples::
borg create --compression lz4 REPO::ARCHIVE data
borg create --compression zstd REPO::ARCHIVE data
borg create --compression zstd,10 REPO::ARCHIVE data
borg create --compression zlib REPO::ARCHIVE data
borg create --compression zlib,1 REPO::ARCHIVE data
borg create --compression auto,lzma,6 REPO::ARCHIVE data
borg create --compression auto,lzma ...
borgbackup-1.1.15/docs/usage/diff.rst.inc 0000644 0001750 0001750 00000017020 13771325506 020153 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_diff:
borg diff
---------
.. code-block:: none
borg [common options] diff [options] REPO::ARCHIVE1 ARCHIVE2 [PATH...]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``REPO::ARCHIVE1`` | repository location and ARCHIVE1 name |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``ARCHIVE2`` | ARCHIVE2 name (no repository location allowed) |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``PATH`` | paths of items inside the archives to compare; patterns are supported |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``--numeric-owner`` | only consider numeric user and group identifiers |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``--same-chunker-params`` | Override check of chunker parameters. |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``--sort`` | Sort the output lines by file path. |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| **Exclusion options** |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------+----------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPO::ARCHIVE1
repository location and ARCHIVE1 name
ARCHIVE2
ARCHIVE2 name (no repository location allowed)
PATH
paths of items inside the archives to compare; patterns are supported
optional arguments
--numeric-owner only consider numeric user and group identifiers
--same-chunker-params Override check of chunker parameters.
--sort Sort the output lines by file path.
:ref:`common_options`
|
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
Description
~~~~~~~~~~~
This command finds differences (file contents, user/group/mode) between archives.
A repository location and an archive name must be specified for REPO::ARCHIVE1.
ARCHIVE2 is just another archive name in same repository (no repository location
allowed).
For archives created with Borg 1.1 or newer diff automatically detects whether
the archives are created with the same chunker params. If so, only chunk IDs
are compared, which is very fast.
For archives prior to Borg 1.1 chunk contents are compared by default.
If you did not create the archives with different chunker params,
pass ``--same-chunker-params``.
Note that the chunker params changed from Borg 0.xx to 1.0.
See the output of the "borg help patterns" command for more help on exclude patterns. borgbackup-1.1.15/docs/usage/mount.rst.inc 0000644 0001750 0001750 00000036570 13771325506 020420 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_mount:
borg mount
----------
.. code-block:: none
borg [common options] mount [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to mount |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``MOUNTPOINT`` | where to mount filesystem |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-f``, ``--foreground`` | stay in foreground, do not daemonize |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-o`` | Extra mount options |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository or archive to mount
MOUNTPOINT
where to mount filesystem
PATH
paths to extract; patterns are supported
optional arguments
-f, --foreground stay in foreground, do not daemonize
-o Extra mount options
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
--strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
Description
~~~~~~~~~~~
This command mounts an archive as a FUSE filesystem. This can be useful for
browsing an archive or restoring individual files. Unless the ``--foreground``
option is given the command will run in the background until the filesystem
is ``umounted``.
The command ``borgfs`` provides a wrapper for ``borg mount``. This can also be
used in fstab entries:
``/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0``
To allow a regular user to use fstab entries, add the ``user`` option:
``/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0``
For FUSE configuration and mount options, see the mount.fuse(8) manual page.
Additional mount options supported by borg:
- versions: when used with a repository mount, this gives a merged, versioned
view of the files in the archives. EXPERIMENTAL, layout may change in future.
- allow_damaged_files: by default damaged files (where missing chunks were
replaced with runs of zeros by borg check ``--repair``) are not readable and
return EIO (I/O error). Set this option to read such files.
- ignore_permissions: for security reasons the "default_permissions" mount
option is internally enforced by borg. "ignore_permissions" can be given to
not enforce "default_permissions".
The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users
to tweak the performance. It sets the number of cached data chunks; additional
memory usage can be up to ~8 MiB times this number. The default is the number
of CPU cores.
When the daemonized process receives a signal or crashes, it does not unmount.
Unmounting in these cases could cause an active rsync or similar process
to unintentionally delete data.
When running in the foreground ^C/SIGINT unmounts cleanly, but other
signals or crashes do not. borgbackup-1.1.15/docs/usage/umount.rst.inc 0000644 0001750 0001750 00000003521 13771325506 020573 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_umount:
borg umount
-----------
.. code-block:: none
borg [common options] umount [options] MOUNTPOINT
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+----------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------+----------------------------------------+
| | ``MOUNTPOINT`` | mountpoint of the filesystem to umount |
+-------------------------------------------------------+----------------+----------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+----------------------------------------+
.. raw:: html
.. only:: latex
MOUNTPOINT
mountpoint of the filesystem to umount
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command un-mounts a FUSE filesystem that was mounted with ``borg mount``.
This is a convenience wrapper that just calls the platform-specific shell
command - usually this is either umount or fusermount -u. borgbackup-1.1.15/docs/usage/list.rst 0000644 0001750 0001750 00000003033 13771325506 017445 0 ustar user user 0000000 0000000 .. include:: list.rst.inc
Examples
~~~~~~~~
::
$ borg list /path/to/repo
Monday Mon, 2016-02-15 19:15:11
repo Mon, 2016-02-15 19:26:54
root-2016-02-15 Mon, 2016-02-15 19:36:29
newname Mon, 2016-02-15 19:50:19
...
$ borg list /path/to/repo::root-2016-02-15
drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 .
drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 bin
-rwxr-xr-x root root 1029624 Thu, 2014-11-13 00:08:51 bin/bash
lrwxrwxrwx root root 0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff
-rwxr-xr-x root root 2140 Fri, 2015-03-27 20:24:22 bin/bzdiff
...
$ borg list /path/to/repo::root-2016-02-15 --pattern "- bin/ba*"
drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 .
drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 bin
lrwxrwxrwx root root 0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff
-rwxr-xr-x root root 2140 Fri, 2015-03-27 20:24:22 bin/bzdiff
...
$ borg list /path/to/repo::archiveA --format="{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}"
drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 .
drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 code
drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 code/myproject
-rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext
...
borgbackup-1.1.15/docs/usage/info.rst.inc 0000644 0001750 0001750 00000021520 13771325506 020176 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_info:
borg info
---------
.. code-block:: none
borg [common options] info [options] [REPOSITORY_OR_ARCHIVE]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to display information about |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | format output as JSON |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository or archive to display information about
optional arguments
--json format output as JSON
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Description
~~~~~~~~~~~
This command displays detailed information about the specified archive or repository.
Please note that the deduplicated sizes of the individual archives do not add
up to the deduplicated size of the repository ("all archives"), because the two
are meaning different things:
This archive / deduplicated size = amount of data stored ONLY for this archive
= unique chunks of this archive.
All archives / deduplicated size = amount of data stored in the repo
= all chunks in the repository.
Borg archives can only contain a limited amount of file metadata.
The size of an archive relative to this limit depends on a number of factors,
mainly the number of files, the lengths of paths and other metadata stored for files.
This is shown as *utilization of maximum supported archive size*. borgbackup-1.1.15/docs/usage/serve.rst 0000644 0001750 0001750 00000007744 13771325506 017633 0 ustar user user 0000000 0000000 .. include:: serve.rst.inc
Examples
~~~~~~~~
borg serve has special support for ssh forced commands (see ``authorized_keys``
example below): it will detect that you use such a forced command and extract
the value of the ``--restrict-to-path`` option(s).
It will then parse the original command that came from the client, makes sure
that it is also ``borg serve`` and enforce path restriction(s) as given by the
forced command. That way, other options given by the client (like ``--info`` or
``--umask``) are preserved (and are not fixed by the forced command).
Environment variables (such as BORG_HOSTNAME_IS_UNIQUE) contained in the original
command sent by the client are *not* interpreted, but ignored. If BORG_XXX environment
variables should be set on the ``borg serve`` side, then these must be set in system-specific
locations like ``/etc/environment`` or in the forced command itself (example below).
::
# Allow an SSH keypair to only run borg, and only have access to /path/to/repo.
# Use key options to disable unneeded and potentially dangerous SSH functionality.
# This will help to secure an automated remote backup system.
$ cat ~/.ssh/authorized_keys
command="borg serve --restrict-to-path /path/to/repo",restrict ssh-rsa AAAAB3[...]
# Set a BORG_XXX environment variable on the "borg serve" side
$ cat ~/.ssh/authorized_keys
command="export BORG_XXX=value; borg serve [...]",restrict ssh-rsa [...]
.. note::
The examples above use the ``restrict`` directive. This does automatically
block potential dangerous ssh features, even when they are added in a future
update. Thus, this option should be preferred.
If you're using openssh-server < 7.2, however, you have to explicitly specify
the ssh features to restrict and cannot simply use the restrict option as it
has been introduced in v7.2. We recommend to use
``no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc``
in this case.
SSH Configuration
~~~~~~~~~~~~~~~~~
``borg serve``'s pipes (``stdin``/``stdout``/``stderr``) are connected to the ``sshd`` process on the server side. In the event that the SSH connection between ``borg serve`` and the client is disconnected or stuck abnormally (for example, due to a network outage), it can take a long time for ``sshd`` to notice the client is disconnected. In the meantime, ``sshd`` continues running, and as a result so does the ``borg serve`` process holding the lock on the repository. This can cause subsequent ``borg`` operations on the remote repository to fail with the error: ``Failed to create/acquire the lock``.
In order to avoid this, it is recommended to perform the following additional SSH configuration:
Either in the client side's ``~/.ssh/config`` file, or in the client's ``/etc/ssh/ssh_config`` file:
::
Host backupserver
ServerAliveInterval 10
ServerAliveCountMax 30
Replacing ``backupserver`` with the hostname, FQDN or IP address of the borg server.
This will cause the client to send a keepalive to the server every 10 seconds. If 30 consecutive keepalives are sent without a response (a time of 300 seconds), the ssh client process will be terminated, causing the borg process to terminate gracefully.
On the server side's ``sshd`` configuration file (typically ``/etc/ssh/sshd_config``):
::
ClientAliveInterval 10
ClientAliveCountMax 30
This will cause the server to send a keep alive to the client every 10 seconds. If 30 consecutive keepalives are sent without a response (a time of 300 seconds), the server's sshd process will be terminated, causing the ``borg serve`` process to terminate gracefully and release the lock on the repository.
If you then run borg commands with ``--lock-wait 600``, this gives sufficient time for the borg serve processes to terminate after the SSH connection is torn down after the 300 second wait for the keepalives to fail.
You may, of course, modify the timeout values demonstrated above to values that suit your environment and use case.
borgbackup-1.1.15/docs/usage/help.rst 0000644 0001750 0001750 00000000101 13771325506 017413 0 ustar user user 0000000 0000000 Miscellaneous Help
------------------
.. include:: help.rst.inc
borgbackup-1.1.15/docs/usage/rename.rst 0000644 0001750 0001750 00000000530 13771325506 017740 0 ustar user user 0000000 0000000 .. include:: rename.rst.inc
Examples
~~~~~~~~
::
$ borg create /path/to/repo::archivename ~
$ borg list /path/to/repo
archivename Mon, 2016-02-15 19:50:19
$ borg rename /path/to/repo::archivename newname
$ borg list /path/to/repo
newname Mon, 2016-02-15 19:50:19
borgbackup-1.1.15/docs/usage/tar.rst 0000644 0001750 0001750 00000001302 13771325506 017255 0 ustar user user 0000000 0000000 .. include:: export-tar.rst.inc
Examples
~~~~~~~~
::
# export as uncompressed tar
$ borg export-tar /path/to/repo::Monday Monday.tar
# exclude some types, compress using gzip
$ borg export-tar /path/to/repo::Monday Monday.tar.gz --exclude '*.so'
# use higher compression level with gzip
$ borg export-tar --tar-filter="gzip -9" testrepo::linux Monday.tar.gz
# export a tar, but instead of storing it on disk,
# upload it to a remote site using curl.
$ borg export-tar /path/to/repo::Monday - | curl --data-binary @- https://somewhere/to/POST
# remote extraction via "tarpipe"
$ borg export-tar /path/to/repo::Monday - | ssh somewhere "cd extracted; tar x"
borgbackup-1.1.15/docs/usage/common-options.rst.inc 0000644 0001750 0001750 00000002605 13771325506 022227 0 ustar user user 0000000 0000000 -h, --help show this help message and exit
--critical work on log level CRITICAL
--error work on log level ERROR
--warning work on log level WARNING (default)
--info, -v, --verbose work on log level INFO
--debug enable debug output, work on log level DEBUG
--debug-topic TOPIC enable TOPIC debugging (can be specified multiple times). The logger path is borg.debug. if TOPIC is not fully qualified.
-p, --progress show progress information
--log-json Output one JSON object per log line instead of formatted text.
--lock-wait SECONDS wait at most SECONDS for acquiring a repository/cache lock (default: 1).
--bypass-lock Bypass locking mechanism
--show-version show/log the borg version
--show-rc show/log the return code (rc)
--umask M set umask to M (local and remote, default: 0077)
--remote-path PATH use PATH as borg executable on the remote (default: "borg")
--remote-ratelimit RATE set remote network upload rate limit in kiByte/s (default: 0=unlimited)
--consider-part-files treat part files like normal files (e.g. to list/extract them)
--debug-profile FILE Write execution profile in Borg format into FILE. For local use a Python-compatible file can be generated by suffixing FILE with ".pyprof".
--rsh RSH Use this command to connect to the 'borg serve' process (default: 'ssh')
borgbackup-1.1.15/docs/usage/check.rst.inc 0000644 0001750 0001750 00000032255 13771325506 020327 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_check:
borg check
----------
.. code-block:: none
borg [common options] check [options] [REPOSITORY_OR_ARCHIVE]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to check consistency of |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--repository-only`` | only perform repository checks |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--archives-only`` | only perform archives checks |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--verify-data`` | perform cryptographic archive data integrity verification (conflicts with ``--repository-only``) |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--repair`` | attempt to repair any inconsistencies found |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository or archive to check consistency of
optional arguments
--repository-only only perform repository checks
--archives-only only perform archives checks
--verify-data perform cryptographic archive data integrity verification (conflicts with ``--repository-only``)
--repair attempt to repair any inconsistencies found
--save-space work slower, but using less space
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Description
~~~~~~~~~~~
The check command verifies the consistency of a repository and the corresponding archives.
check --repair is a potentially dangerous function and might lead to data loss
(for kinds of corruption it is not capable of dealing with). BE VERY CAREFUL!
First, the underlying repository data files are checked:
- For all segments, the segment magic header is checked.
- For all objects stored in the segments, all metadata (e.g. CRC and size) and
all data is read. The read data is checked by size and CRC. Bit rot and other
types of accidental damage can be detected this way.
- In repair mode, if an integrity error is detected in a segment, try to recover
as many objects from the segment as possible.
- In repair mode, make sure that the index is consistent with the data stored in
the segments.
- If checking a remote repo via ``ssh:``, the repo check is executed on the server
without causing significant network traffic.
- The repository check can be skipped using the ``--archives-only`` option.
Second, the consistency and correctness of the archive metadata is verified:
- Is the repo manifest present? If not, it is rebuilt from archive metadata
chunks (this requires reading and decrypting of all metadata and data).
- Check if archive metadata chunk is present; if not, remove archive from manifest.
- For all files (items) in the archive, for all chunks referenced by these
files, check if chunk is present. In repair mode, if a chunk is not present,
replace it with a same-size replacement chunk of zeroes. If a previously lost
chunk reappears (e.g. via a later backup), in repair mode the all-zero replacement
chunk will be replaced by the correct chunk. This requires reading of archive and
file metadata, but not data.
- In repair mode, when all the archives were checked, orphaned chunks are deleted
from the repo. One cause of orphaned chunks are input file related errors (like
read errors) in the archive creation process.
- If checking a remote repo via ``ssh:``, the archive check is executed on the
client machine because it requires decryption, and this is always done client-side
as key access is needed.
- The archive checks can be time consuming; they can be skipped using the
``--repository-only`` option.
The ``--verify-data`` option will perform a full integrity verification (as opposed to
checking the CRC32 of the segment) of data, which means reading the data from the
repository, decrypting and decompressing it. This is a cryptographic verification,
which will detect (accidental) corruption. For encrypted repositories it is
tamper-resistant as well, unless the attacker has access to the keys. It is also very
slow. borgbackup-1.1.15/docs/usage/key_export.rst.inc 0000644 0001750 0001750 00000010517 13771325506 021440 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_key_export:
borg key export
---------------
.. code-block:: none
borg [common options] key export [options] [REPOSITORY] [PATH]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| | ``REPOSITORY`` | |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| | ``PATH`` | where to store the backup |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| | ``--paper`` | Create an export suitable for printing and later type-in |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| | ``--qr-html`` | Create an html file suitable for printing and later type-in or qr scan |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY
PATH
where to store the backup
optional arguments
--paper Create an export suitable for printing and later type-in
--qr-html Create an html file suitable for printing and later type-in or qr scan
:ref:`common_options`
|
Description
~~~~~~~~~~~
If repository encryption is used, the repository is inaccessible
without the key. This command allows to backup this essential key.
Note that the backup produced does not include the passphrase itself
(i.e. the exported key stays encrypted). In order to regain access to a
repository, one needs both the exported key and the original passphrase.
There are two backup formats. The normal backup format is suitable for
digital storage as a file. The ``--paper`` backup format is optimized
for printing and typing in while importing, with per line checks to
reduce problems with manual input.
For repositories using keyfile encryption the key is saved locally
on the system that is capable of doing backups. To guard against loss
of this key, the key needs to be backed up independently of the main
data backup.
For repositories using the repokey encryption the key is saved in the
repository in the config file. A backup is thus not strictly needed,
but guards against the repository becoming inaccessible if the file
is damaged for some reason. borgbackup-1.1.15/docs/usage/change-passphrase.rst.inc 0000644 0001750 0001750 00000003314 13771325506 022640 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_change-passphrase:
borg change-passphrase
----------------------
.. code-block:: none
borg [common options] change-passphrase [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+--+
| **positional arguments** |
+-------------------------------------------------------+----------------+--+
| | ``REPOSITORY`` | |
+-------------------------------------------------------+----------------+--+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+--+
.. raw:: html
.. only:: latex
REPOSITORY
:ref:`common_options`
|
Description
~~~~~~~~~~~
The key files used for repository encryption are optionally passphrase
protected. This command can be used to change this passphrase.
Please note that this command only changes the passphrase, but not any
secret protected by it (like e.g. encryption/MAC keys or chunker seed).
Thus, changing the passphrase after passphrase and borg key got compromised
does not protect future (nor past) backups to the same repository. borgbackup-1.1.15/docs/usage/usage_general.rst.inc 0000644 0001750 0001750 00000001013 13771325506 022037 0 ustar user user 0000000 0000000 .. include:: general/positional-arguments.rst.inc
.. include:: general/repository-urls.rst.inc
.. include:: general/repository-locations.rst.inc
.. include:: general/logging.rst.inc
.. include:: general/return-codes.rst.inc
.. _env_vars:
.. include:: general/environment.rst.inc
.. _file-systems:
.. include:: general/file-systems.rst.inc
.. include:: general/units.rst.inc
.. include:: general/date-time.rst.inc
.. include:: general/resources.rst.inc
.. _platforms:
.. include:: general/file-metadata.rst.inc
borgbackup-1.1.15/docs/usage/key_migrate-to-repokey.rst.inc 0000644 0001750 0001750 00000004124 13771325506 023640 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_key_migrate-to-repokey:
borg key migrate-to-repokey
---------------------------
.. code-block:: none
borg [common options] key migrate-to-repokey [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+--+
| **positional arguments** |
+-------------------------------------------------------+----------------+--+
| | ``REPOSITORY`` | |
+-------------------------------------------------------+----------------+--+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+--+
.. raw:: html
.. only:: latex
REPOSITORY
:ref:`common_options`
|
Description
~~~~~~~~~~~
This command migrates a repository from passphrase mode (removed in Borg 1.0)
to repokey mode.
You will be first asked for the repository passphrase (to open it in passphrase
mode). This is the same passphrase as you used to use for this repo before 1.0.
It will then derive the different secrets from this passphrase.
Then you will be asked for a new passphrase (twice, for safety). This
passphrase will be used to protect the repokey (which contains these same
secrets in encrypted form). You may use the same passphrase as you used to
use, but you may also use a different one.
After migrating to repokey mode, you can change the passphrase at any time.
But please note: the secrets will always stay the same and they could always
be derived from your (old) passphrase-mode passphrase. borgbackup-1.1.15/docs/usage/config.rst 0000644 0001750 0001750 00000000750 13771325506 017742 0 ustar user user 0000000 0000000 .. include:: config.rst.inc
.. note::
The repository & cache config files are some of the only directly manipulable
parts of a repository that aren't versioned or backed up, so be careful when
making changes\!
Examples
~~~~~~~~
::
# find cache directory
$ cd ~/.cache/borg/$(borg config /path/to/repo id)
# reserve some space
$ borg config /path/to/repo additional_free_space 2G
# make a repo append-only
$ borg config /path/to/repo append_only 1
borgbackup-1.1.15/docs/usage/init.rst 0000644 0001750 0001750 00000001212 13771325506 017432 0 ustar user user 0000000 0000000 .. include:: init.rst.inc
Examples
~~~~~~~~
::
# Local repository, repokey encryption, BLAKE2b (often faster, since Borg 1.1)
$ borg init --encryption=repokey-blake2 /path/to/repo
# Local repository (no encryption)
$ borg init --encryption=none /path/to/repo
# Remote repository (accesses a remote borg via ssh)
# repokey: stores the (encrypted) key into /config
$ borg init --encryption=repokey-blake2 user@hostname:backup
# Remote repository (accesses a remote borg via ssh)
# keyfile: stores the (encrypted) key into ~/.config/borg/keys/
$ borg init --encryption=keyfile user@hostname:backup
borgbackup-1.1.15/docs/usage/borgfs.rst.inc 0000644 0001750 0001750 00000037375 13771325506 020544 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_borgfs:
borg borgfs
-----------
.. code-block:: none
borg [common options] borgfs [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...]
.. only:: html
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository/archive to mount |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``MOUNTPOINT`` | where to mount filesystem |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-V``, ``--version`` | show version number and exit |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-f``, ``--foreground`` | stay in foreground, do not daemonize |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-o`` | Extra mount options |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** — Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
.. only:: latex
REPOSITORY_OR_ARCHIVE
repository/archive to mount
MOUNTPOINT
where to mount filesystem
PATH
paths to extract; patterns are supported
optional arguments
-V, --version show version number and exit
-f, --foreground stay in foreground, do not daemonize
-o Extra mount options
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Exclusion options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN experimental: include/exclude paths matching PATTERN
--patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
--strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
Description
~~~~~~~~~~~
This command mounts an archive as a FUSE filesystem. This can be useful for
browsing an archive or restoring individual files. Unless the ``--foreground``
option is given the command will run in the background until the filesystem
is ``umounted``.
The command ``borgfs`` provides a wrapper for ``borg mount``. This can also be
used in fstab entries:
``/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0``
To allow a regular user to use fstab entries, add the ``user`` option:
``/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0``
For mount options, see the fuse(8) manual page. Additional mount options
supported by borg:
- versions: when used with a repository mount, this gives a merged, versioned
view of the files in the archives. EXPERIMENTAL, layout may change in future.
- allow_damaged_files: by default damaged files (where missing chunks were
replaced with runs of zeros by borg check ``--repair``) are not readable and
return EIO (I/O error). Set this option to read such files.
The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users
to tweak the performance. It sets the number of cached data chunks; additional
memory usage can be up to ~8 MiB times this number. The default is the number
of CPU cores.
When the daemonized process receives a signal or crashes, it does not unmount.
Unmounting in these cases could cause an active rsync or similar process
to unintentionally delete data.
When running in the foreground ^C/SIGINT unmounts cleanly, but other
signals or crashes do not. borgbackup-1.1.15/docs/usage/key_change-passphrase.rst.inc 0000644 0001750 0001750 00000003334 13771325506 023512 0 ustar user user 0000000 0000000 .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_key_change-passphrase:
borg key change-passphrase
--------------------------
.. code-block:: none
borg [common options] key change-passphrase [options] [REPOSITORY]
.. only:: html
.. class:: borg-options-table
+-------------------------------------------------------+----------------+--+
| **positional arguments** |
+-------------------------------------------------------+----------------+--+
| | ``REPOSITORY`` | |
+-------------------------------------------------------+----------------+--+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+----------------+--+
.. raw:: html
.. only:: latex
REPOSITORY
:ref:`common_options`
|
Description
~~~~~~~~~~~
The key files used for repository encryption are optionally passphrase
protected. This command can be used to change this passphrase.
Please note that this command only changes the passphrase, but not any
secret protected by it (like e.g. encryption/MAC keys or chunker seed).
Thus, changing the passphrase after passphrase and borg key got compromised
does not protect future (nor past) backups to the same repository. borgbackup-1.1.15/docs/usage/debug.rst 0000644 0001750 0001750 00000003302 13771325506 017557 0 ustar user user 0000000 0000000 Debugging Facilities
--------------------
There is a ``borg debug`` command that has some subcommands which are all
**not intended for normal use** and **potentially very dangerous** if used incorrectly.
For example, ``borg debug put-obj`` and ``borg debug delete-obj`` will only do
what their name suggests: put objects into repo / delete objects from repo.
Please note:
- they will not update the chunks cache (chunks index) about the object
- they will not update the manifest (so no automatic chunks index resync is triggered)
- they will not check whether the object is in use (e.g. before delete-obj)
- they will not update any metadata which may point to the object
They exist to improve debugging capabilities without direct system access, e.g.
in case you ever run into some severe malfunction. Use them only if you know
what you are doing or if a trusted Borg developer tells you what to do.
Borg has a ``--debug-topic TOPIC`` option to enable specific debugging messages. Topics
are generally not documented.
A ``--debug-profile FILE`` option exists which writes a profile of the main program's
execution to a file. The format of these files is not directly compatible with the
Python profiling tools, since these use the "marshal" format, which is not intended
to be secure (quoting the Python docs: "Never unmarshal data received from an untrusted
or unauthenticated source.").
The ``borg debug profile-convert`` command can be used to take a Borg profile and convert
it to a profile file that is compatible with the Python tools.
Additionally, if the filename specified for ``--debug-profile`` ends with ".pyprof" a
Python compatible profile is generated. This is only intended for local use by developers.
borgbackup-1.1.15/docs/global.rst.inc 0000644 0001750 0001750 00000003153 13771325506 017401 0 ustar user user 0000000 0000000 .. highlight:: bash
.. |project_name| replace:: Borg
.. |package_dirname| replace:: borgbackup-|version|
.. |package_filename| replace:: |package_dirname|.tar.gz
.. |package_url| replace:: https://pypi.python.org/packages/source/b/borgbackup/|package_filename|
.. |git_url| replace:: https://github.com/borgbackup/borg.git
.. _github: https://github.com/borgbackup/borg
.. _issue tracker: https://github.com/borgbackup/borg/issues
.. _deduplication: https://en.wikipedia.org/wiki/Data_deduplication
.. _AES: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
.. _HMAC-SHA256: https://en.wikipedia.org/wiki/HMAC
.. _SHA256: https://en.wikipedia.org/wiki/SHA-256
.. _PBKDF2: https://en.wikipedia.org/wiki/PBKDF2
.. _ACL: https://en.wikipedia.org/wiki/Access_control_list
.. _libacl: https://savannah.nongnu.org/projects/acl/
.. _libattr: https://savannah.nongnu.org/projects/attr/
.. _liblz4: https://github.com/Cyan4973/lz4
.. _libzstd: https://github.com/facebook/zstd
.. _libb2: https://github.com/BLAKE2/libb2
.. _OpenSSL: https://www.openssl.org/
.. _`Python 3`: https://www.python.org/
.. _Buzhash: https://en.wikipedia.org/wiki/Buzhash
.. _msgpack: https://msgpack.org/
.. _`msgpack-python`: https://pypi.python.org/pypi/msgpack-python/
.. _llfuse: https://pypi.python.org/pypi/llfuse/
.. _homebrew: http://brew.sh/
.. _userspace filesystems: https://en.wikipedia.org/wiki/Filesystem_in_Userspace
.. _Cython: http://cython.org/
.. _virtualenv: https://pypi.python.org/pypi/virtualenv/
.. _mailing list discussion about internals: http://librelist.com/browser/attic/2014/5/6/questions-and-suggestions-about-inner-working-of-attic>
borgbackup-1.1.15/docs/changes.rst 0000644 0001750 0001750 00000443661 13771325506 017015 0 ustar user user 0000000 0000000 .. _important_notes:
Important notes
===============
This section provides information about security and corruption issues.
.. _hashindex_set_bug:
Pre-1.1.11 potential index corruption / data loss issue
-------------------------------------------------------
A bug was discovered in our hashtable code, see issue #4829.
The code is used for the client-side chunks cache and the server-side repo index.
Although borg uses the hashtables very heavily, the index corruption did not
happen too frequently, because it needed specific conditions to happen.
Data loss required even more specific conditions, so it should be rare (and
also detectable via borg check).
You might be affected if borg crashed with / complained about:
- AssertionError: Corrupted segment reference count - corrupted index or hints
- ObjectNotFound: Object with key ... not found in repository ...
- Index mismatch for key b'...'. (..., ...) != (-1, -1)
- ValueError: stats_against: key contained in self but not in master_index.
Advised procedure to fix any related issue in your indexes/caches:
- install fixed borg code (on client AND server)
- for all of your clients and repos remove the cache by:
borg delete --cache-only YOURREPO
(later, the cache will be re-built automatically)
- for all your repos, rebuild the repo index by:
borg check --repair YOURREPO
This will also check all archives and detect if there is any data-loss issue.
Affected branches / releases:
- fd06497 introduced the bug into 1.1-maint branch - it affects all borg 1.1.x since 1.1.0b4.
- fd06497 introduced the bug into master branch - it affects all borg 1.2.0 alpha releases.
- c5cd882 introduced the bug into 1.0-maint branch - it affects all borg 1.0.x since 1.0.11rc1.
The bug was fixed by:
- 701159a fixes the bug in 1.1-maint branch - will be released with borg 1.1.11.
- fa63150 fixes the bug in master branch - will be released with borg 1.2.0a8.
- 7bb90b6 fixes the bug in 1.0-maint branch. Branch is EOL, no new release is planned as of now.
.. _broken_validator:
Pre-1.1.4 potential data corruption issue
-----------------------------------------
A data corruption bug was discovered in borg check --repair, see issue #3444.
This is a 1.1.x regression, releases < 1.1 (e.g. 1.0.x) are not affected.
To avoid data loss, you must not run borg check --repair using an unfixed version
of borg 1.1.x. The first official release that has the fix is 1.1.4.
Package maintainers may have applied the fix to updated packages of 1.1.x (x<4)
though, see the package maintainer's package changelog to make sure.
If you never had missing item metadata chunks, the bug has not affected you
even if you did run borg check --repair with an unfixed version.
When borg check --repair tried to repair corrupt archives that miss item metadata
chunks, the resync to valid metadata in still present item metadata chunks
malfunctioned. This was due to a broken validator that considered all (even valid)
item metadata as invalid. As they were considered invalid, borg discarded them.
Practically, that means the affected files, directories or other fs objects were
discarded from the archive.
Due to the malfunction, the process was extremely slow, but if you let it
complete, borg would have created a "repaired" archive that has lost a lot of items.
If you interrupted borg check --repair because it was so strangely slow (killing
borg somehow, e.g. Ctrl-C) the transaction was rolled back and no corruption occurred.
The log message indicating the precondition for the bug triggering looks like:
item metadata chunk missing [chunk: 001056_bdee87d...a3e50d]
If you never had that in your borg check --repair runs, you're not affected.
But if you're unsure or you actually have seen that, better check your archives.
By just using "borg list repo::archive" you can see if all expected filesystem
items are listed.
.. _tam_vuln:
Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)
----------------------------------------------------------
A flaw in the cryptographic authentication scheme in Borg allowed an attacker
to spoof the manifest. The attack requires an attacker to be able to
1. insert files (with no additional headers) into backups
2. gain write access to the repository
This vulnerability does not disclose plaintext to the attacker, nor does it
affect the authenticity of existing archives.
The vulnerability allows an attacker to create a spoofed manifest (the list of archives).
Creating plausible fake archives may be feasible for small archives, but is unlikely
for large archives.
The fix adds a separate authentication tag to the manifest. For compatibility
with prior versions this authentication tag is *not* required by default
for existing repositories. Repositories created with 1.0.9 and later require it.
Steps you should take:
1. Upgrade all clients to 1.0.9 or later.
2. Run ``borg upgrade --tam `` *on every client* for *each* repository.
3. This will list all archives, including archive IDs, for easy comparison with your logs.
4. Done.
Prior versions can access and modify repositories with this measure enabled, however,
to 1.0.9 or later their modifications are indiscernible from an attack and will
raise an error until the below procedure is followed. We are aware that this can
be be annoying in some circumstances, but don't see a way to fix the vulnerability
otherwise.
In case a version prior to 1.0.9 is used to modify a repository where above procedure
was completed, and now you get an error message from other clients:
1. ``borg upgrade --tam --force `` once with *any* client suffices.
This attack is mitigated by:
- Noting/logging ``borg list``, ``borg info``, or ``borg create --stats``, which
contain the archive IDs.
We are not aware of others having discovered, disclosed or exploited this vulnerability.
Vulnerability time line:
* 2016-11-14: Vulnerability and fix discovered during review of cryptography by Marian Beermann (@enkore)
* 2016-11-20: First patch
* 2016-12-20: Released fixed version 1.0.9
* 2017-01-02: CVE was assigned
* 2017-01-15: Released fixed version 1.1.0b3 (fix was previously only available from source)
.. _attic013_check_corruption:
Pre-1.0.9 potential data loss
-----------------------------
If you have archives in your repository that were made with attic <= 0.13
(and later migrated to borg), running borg check would report errors in these
archives. See issue #1837.
The reason for this is a invalid (and useless) metadata key that was
always added due to a bug in these old attic versions.
If you run borg check --repair, things escalate quickly: all archive items
with invalid metadata will be killed. Due to that attic bug, that means all
items in all archives made with these old attic versions.
Pre-1.0.4 potential repo corruption
-----------------------------------
Some external errors (like network or disk I/O errors) could lead to
corruption of the backup repository due to issue #1138.
A sign that this happened is if "E" status was reported for a file that can
not be explained by problems with the source file. If you still have logs from
"borg create -v --list", you can check for "E" status.
Here is what could cause corruption and what you can do now:
1) I/O errors (e.g. repo disk errors) while writing data to repo.
This could lead to corrupted segment files.
Fix::
# check for corrupt chunks / segments:
borg check -v --repository-only REPO
# repair the repo:
borg check -v --repository-only --repair REPO
# make sure everything is fixed:
borg check -v --repository-only REPO
2) Unreliable network / unreliable connection to the repo.
This could lead to archive metadata corruption.
Fix::
# check for corrupt archives:
borg check -v --archives-only REPO
# delete the corrupt archives:
borg delete --force REPO::CORRUPT_ARCHIVE
# make sure everything is fixed:
borg check -v --archives-only REPO
3) In case you want to do more intensive checking.
The best check that everything is ok is to run a dry-run extraction::
borg extract -v --dry-run REPO::ARCHIVE
.. _changelog:
Changelog
=========
Version 1.1.15 (2020-12-25)
---------------------------
Compatibility notes:
- When upgrading from borg 1.0.x to 1.1.x, please note:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
about a unknown unencrypted repository one time.
- your first backup with 1.1.x might be significantly slower (it might
completely read, chunk, hash a lot files) - this is due to the
--files-cache mode change (and happens every time you change mode).
You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible
mode (but that is less safe for detecting changed files than the default).
See the --files-cache docs for details.
- 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux).
If WSL still has a problem with sync_file_range, you need to set
BORG_WORKAROUNDS=basesyncfile in the borg process environment to
work around the WSL issue.
- 1.1.14 changes return codes due to a bug fix:
In case you have scripts expecting rc == 2 for a signal exit, you need to
update them to check for >= 128 (as documented since long).
- 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now.
Fixes:
- extract:
- improve exception handling when setting xattrs, #5092.
- emit a warning message giving the path, xattr key and error message.
- continue trying to restore other xattrs and bsdflags of the same file
after an exception with xattr-setting happened.
- export-tar:
- set tar format to GNU_FORMAT explicitly, #5274
- fix memory leak with ssh: remote repository, #5568
- fix potential memory leak with ssh: remote repository with partial extraction
- create: fix --dry-run and --stats coexistence, #5415
- use --timestamp for {utcnow} and {now} if given, #5189
New features:
- create: implement --stdin-mode, --stdin-user and --stdin-group, #5333
- allow appending the files cache filename with BORG_FILES_CACHE_SUFFIX env var
Other changes:
- drop python 3.4 support, minimum requirement is 3.5 now.
- enable using libxxhash instead of bundled xxh64 code
- update llfuse requirements (1.3.8)
- set cython language_level in some files to fix warnings
- allow EIO with warning when trying to hardlink
- PropDict: fail early if internal_dict is not a dict
- update shell completions
- tests / CI
- add a test for the hashindex corruption bug, #5531 #4829
- fix spurious failure in test_cache_files, #5438
- added a github ci workflow
- reduce testing on travis, no macOS, no py3x-dev, #5467
- travis: use newer dists, native py on dist
- vagrant:
- remove jessie and trusty boxes, #5348 #5383
- pyinstaller 4.0, build on py379
- binary build on stretch64, #5348
- remove easy_install based pip installation
- docs:
- clarify '--one-file-system' for btrfs, #5391
- add example for excluding content using the --pattern cmd line arg
- complement the documentation for pattern files and exclude files, #5524
- made ansible playbook more generic, use package instead of pacman. also
change state from "latest" to "present".
- complete documentation on append-only remote repos, #5497
- internals: rather talk about target size than statistics, #5336
- new compression algorithm policy, #1633 #5505
- faq: add a hint on sleeping computer, #5301
- note requirements for full disk access on macOS Catalina, #5303
- fix/improve description of borg upgrade hardlink usage, #5518
- modernize 1.1 code:
- drop code/workarounds only needed to support Python 3.4
- remove workaround for pre-release py37 argparse bug
- removed some outdated comments/docstrings
- requirements: remove some restrictions, lock on current versions
Version 1.1.14 (2020-10-07)
---------------------------
Fixes:
- check --repair: fix potential data loss when interrupting it, #5325
- exit with 128 + signal number (as documented) when borg is killed by a signal, #5161
- fix hardlinked CACHEDIR.TAG processing, #4911
- create --read-special: .part files also should be regular files, #5217
- llfuse dependency: choose least broken 1.3.6/1.3.7.
1.3.6 is broken on python 3.9, 1.3.7 is broken on FreeBSD.
Other changes:
- upgrade bundled xxhash to 0.7.4
- self test: if it fails, also point to OS and hardware, #5334
- pyinstaller: compute basepath from spec file location
- prettier error message when archive gets too big, #5307
- check/recreate are not "experimental" any more (but still potentially dangerous):
- recreate: remove extra confirmation
- rephrase some warnings, update docs, #5164
- shell completions:
- misc. updates / fixes
- support repositories in fish tab completion, #5256
- complete $BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING
- rewrite zsh completion:
- completion for almost all optional and positional arguments
- completion for Borg environment variables (parameters)
- use "allow/deny list" instead of "white/black list" wording
- declare "allow_cache_wipe" marker in setup.cfg to avoid pytest warning
- vagrant / tests:
- misc. fixes / updates
- use python 3.5.10 for binary build
- build directory-based binaries additionally to the single file binaries
- add libffi-dev, required to build python
- use cryptography<3.0, more recent versions break the jessie box
- test on python 3.9
- do brew update with /dev/null redirect to avoid "too much log output" on travis-ci
- docs:
- add ssh-agent pull backup method docs, #5288
- how to approach borg speed issues, #5371
- mention double --force in prune docs
- update Homebrew install instructions, #5185
- better description of how cache and rebuilds of it work
- point to borg create --list item flags in recreate usage, #5165
- add security faq explaining AES-CTR crypto issues, #5254
- add a note to create from stdin regarding files cache, #5180
- fix borg.1 manpage generation regression, #5211
- clarify how exclude options work in recreate, #5193
- add section for retired contributors
- hint about not misusing private email addresses of contributors for borg support
Version 1.1.13 (2020-06-06)
---------------------------
Fixes:
- rebuilt using a current Cython version, compatible with python 3.8, #5214
Version 1.1.12 (2020-06-06)
---------------------------
Fixes:
- fix preload-related memory leak, #5202.
- mount / borgfs (FUSE filesystem):
- fix FUSE low linear read speed on large files, #5067
- fix crash on old llfuse without birthtime attrs, #5064 - accidentally
we required llfuse >= 1.3. Now also old llfuse works again.
- set f_namemax in statfs result, #2684
- update precedence of env vars to set config and cache paths, #4894
- correctly calculate compression ratio, taking header size into account, too
New features:
- --bypass-lock option to bypass locking with read-only repositories
Other changes:
- upgrade bundled zstd to 1.4.5
- travis: adding comments and explanations to Travis config / install script,
improve macOS builds.
- tests: test_delete_force: avoid sporadic test setup issues, #5196
- misc. vagrant fixes
- the binary for macOS is now built on macOS 10.12
- the binaries for Linux are now built on Debian 8 "Jessie", #3761
- docs:
- PlaceholderError not printed as JSON, #4073
- "How important is Borg config?", #4941
- make Sphinx warnings break docs build, #4587
- some markup / warning fixes
- add "updating borgbackup.org/releases" to release checklist, #4999
- add "rendering docs" to release checklist, #5000
- clarify borg init's encryption modes
- add note about patterns and stored paths, #4160
- add upgrade of tools to pip installation how-to
- document one cause of orphaned chunks in check command, #2295
- linked recommended restrictions to ssh public keys on borg servers in faq, #4946
Version 1.1.11 (2020-03-08)
---------------------------
Fixes:
- fixed potential index corruption / data loss issue due to bug in hashindex_set, #4829.
Please read and follow the more detailled notes close to the top of this document.
- upgrade bundled xxhash to 0.7.3, #4891.
0.7.2 is the minimum requirement for correct operations on ARMv6 in non-fixup
mode, where unaligned memory accesses cause bus errors.
0.7.3 adds some speedups and libxxhash 0.7.3 even has a pkg-config file now.
- upgrade bundled lz4 to 1.9.2
- upgrade bundled zstd to 1.4.4
- fix crash when upgrading erroneous hints file, #4922
- extract:
- fix KeyError for "partial" extraction, #4607
- fix "partial" extract for hardlinked contentless file types, #4725
- fix preloading for old (0.xx) remote servers, #4652
- fix confusing output of borg extract --list --strip-components, #4934
- delete: after double-force delete, warn about necessary repair, #4704
- create: give invalid repo error msg if repo config not found, #4411
- mount: fix FUSE mount missing st_birthtime, #4763 #4767
- check: do not stumble over invalid item key, #4845
- info: if the archive doesn't exist, print a pretty message, #4793
- SecurityManager.known(): check all files, #4614
- Repository.open: use stat() to check for repo dir, #4695
- Repository.check_can_create_repository: use stat() to check, #4695
- fix invalid archive error message
- fix optional/non-optional location arg, #4541
- commit-time free space calc: ignore bad compact map entries, #4796
- ignore EACCES (errno 13) when hardlinking the old config, #4730
- --prefix / -P: fix processing, avoid argparse issue, #4769
New features:
- enable placeholder usage in all extra archive arguments
- new BORG_WORKAROUNDS mechanism, basesyncfile, #4710
- recreate: support --timestamp option, #4745
- support platforms without os.link (e.g. Android with Termux), #4901.
if we don't have os.link, we just extract another copy instead of making a hardlink.
- support linux platforms without sync_file_range (e.g. Android 7 with Termux), #4905
Other:
- ignore --stats when given with --dry-run, but continue, #4373
- add some ProgressIndicator msgids to code / fix docs, #4935
- elaborate on "Calculating size" message
- argparser: always use REPOSITORY in metavar, also use more consistent help phrasing.
- check: improve error output for matching index size, see #4829
- docs:
- changelog: add advisory about hashindex_set bug #4829
- better describe BORG_SECURITY_DIR, BORG_CACHE_DIR, #4919
- infos about cache security assumptions, #4900
- add FAQ describing difference between a local repo vs. repo on a server.
- document how to test exclusion patterns without performing an actual backup
- timestamps in the files cache are now usually ctime, #4583
- fix bad reference to borg compact (does not exist in 1.1), #4660
- create: borg 1.1 is not future any more
- extract: document limitation "needs empty destination", #4598
- how to supply a passphrase, use crypto devices, #4549
- fix osxfuse github link in installation docs
- add example of exclude-norecurse rule in help patterns
- update macOS Brew link
- add note about software for automating backups, #4581
- AUTHORS: mention copyright+license for bundled msgpack
- fix various code blocks in the docs, #4708
- updated docs to cover use of temp directory on remote, #4545
- add restore docs, #4670
- add a pull backup / push restore how-to, #1552
- add FAQ how to retain original paths, #4532
- explain difference between --exclude and --pattern, #4118
- add FAQs for SSH connection issues, #3866
- improve password FAQ, #4591
- reiterate that 'file cache names are absolute' in FAQ
- tests:
- cope with ANY error when importing pytest into borg.testsuite, #4652
- fix broken test that relied on improper zlib assumptions
- test_fuse: filter out selinux xattrs, #4574
- travis / vagrant:
- misc python versions removed / changed (due to openssl 1.1 compatibility)
or added (3.7 and 3.8, for better borg compatibility testing)
- binary building is on python 3.5.9 now
- vagrant:
- add new boxes: ubuntu 18.04 and 20.04, debian 10
- update boxes: openindiana, darwin, netbsd
- remove old boxes: centos 6
- darwin: updated osxfuse to 3.10.4
- use debian/ubuntu pip/virtualenv packages
- rather use python 3.6.2 than 3.6.0, fixes coverage/sqlite3 issue
- use requirements.d/development.lock.txt to avoid compat issues
- travis:
- darwin: backport some install code / order from master
- remove deprecated keyword "sudo" from travis config
- allow osx builds to fail, #4955
this is due to travis-ci frequently being so slow that the OS X builds
just fail because they exceed 50 minutes and get killed by travis.
Version 1.1.10 (2019-05-16)
---------------------------
Fixes:
- extract: hang on partial extraction with ssh: repo, when hardlink master
is not matched/extracted and borg hangs on related slave hardlink, #4350
- lrucache: regularly remove old FDs, #4427
- avoid stale filehandle issues, #3265
- freebsd: make xattr platform code api compatible with linux, #3952
- use whitelist approach for borg serve, #4097
- borg command shall terminate with rc 2 for ImportErrors, #4424
- create: only run stat_simple_attrs() once, this increases
backup with lots of unchanged files performance by ~ 5%.
- prune: fix incorrect borg prune --stats output with --dry-run, #4373
- key export: emit user-friendly error if repo key is exported to a directory,
#4348
New features:
- bundle latest supported msgpack-python release (0.5.6), remove msgpack-python
from setup.py install_requires - by default we use the bundled code now.
optionally, we still support using an external msgpack (see hints in
setup.py), but this requires solid requirements management within
distributions and is not recommended.
borgbackup will break if you upgrade msgpack to an unsupported version.
- display msgpack version as part of sysinfo (e.g. in tracebacks)
- timestamp for borg delete --info added, #4359
- enable placeholder usage in --comment and --glob-archives, #4559, #4495
Other:
- serve: do not check python/libc for borg serve, #4483
- shell completions: borg diff second archive
- release scripts: signing binaries with Qubes OS support
- testing:
- vagrant: upgrade openbsd box to 6.4
- travis-ci: lock test env to py 3.4 compatible versions, #4343
- get rid of confusing coverage warning, #2069
- rename test_mount_hardlinks to test_fuse_mount_hardlinks,
so both can be excluded by "not test_fuse".
- pure-py msgpack warning shall not make a lot of tests fail, #4558
- docs:
- add "SSH Configuration" section to "borg serve", #3988, #636, #4485
- README: new URL for funding options
- add a sample logging.conf in docs/misc, #4380
- elaborate on append-only mode docs, #3504
- installation: added Alpine Linux to distribution list, #4415
- usage.html: only modify window.location when redirecting, #4133
- add msgpack license to docs/3rd_party/msgpack
- vagrant / binary builds:
- use python 3.5.7 for builds
- use osxfuse 3.8.3
Version 1.1.9 (2019-02-10)
--------------------------
Fixes:
- security fix: configure FUSE with "default_permissions", #3903
"default_permissions" is now enforced by borg by default to let the
kernel check uid/gid/mode based permissions.
"ignore_permissions" can be given to not enforce "default_permissions".
- make "hostname" short, even on misconfigured systems, #4262
- fix free space calculation on macOS (and others?), #4289
- config: quit with error message when no key is provided, #4223
- recover_segment: handle too small segment files correctly, #4272
- correctly release memoryview, #4243
- avoid diaper pattern in configparser by opening files, #4263
- add "# cython: language_level=3" directive to .pyx files, #4214
- info: consider part files for "This archive" stats, #3522
- work around Microsoft WSL issue #645 (sync_file_range), #1961
New features:
- add --rsh command line option to complement BORG_RSH env var, #1701
- init: --make-parent-dirs parent1/parent2/repo_dir, #4235
Other:
- add archive name to check --repair output, #3447
- check for unsupported msgpack versions
- shell completions:
- new shell completions for borg 1.1.9
- more complete shell completions for borg mount -o
- added shell completions for borg help
- option arguments for zsh tab completion
- docs:
- add FAQ regarding free disk space check, #3905
- update BORG_PASSCOMMAND example and clarify variable expansion, #4249
- FAQ regarding change of compression settings, #4222
- add note about BSD flags to changelog, #4246
- improve logging in example automation script
- add note about files changing during backup, #4081
- work around the backslash issue, #4280
- update release workflow using twine (docs, scripts), #4213
- add warnings on repository copies to avoid future problems, #4272
- tests:
- fix the homebrew 1.9 issues on travis-ci, #4254
- fix duplicate test method name, #4311
- test_mount_hardlinks: get rid of fakeroot-caused test fails, #3389
Version 1.1.8 (2018-12-09)
--------------------------
Fixes:
- enforce storage quota if set by serve-command, #4093
- invalid locations: give err msg containing parsed location, #4179
- list repo: add placeholders for hostname and username, #4130
- on linux, symlinks can't have ACLs, so don't try to set any, #4044
New features:
- create: added PATH::archive output on INFO log level
- read a passphrase from a file descriptor specified in the
BORG_PASSPHRASE_FD environment variable.
Other:
- docs:
- option --format is required for some expensive-to-compute values for json
borg list by default does not compute expensive values except when
they are needed. whether they are needed is determined by the format,
in standard mode as well as in --json mode.
- tell that our binaries are x86/x64 amd/intel, bauerj has ARM
- fixed wrong archive name pattern in CRUD benchmark help
- fixed link to cachedir spec in docs, #4140
- tests:
- stop using fakeroot on travis, avoids sporadic EISDIR errors, #2482
- xattr key names must start with "user." on linux
- fix code so flake8 3.6 does not complain
- explicitly convert environment variable to str, #4136
- fix DeprecationWarning: Flags not at the start of the expression, #4137
- support pytest4, #4172
- vagrant:
- use python 3.5.6 for builds
Version 1.1.7 (2018-08-11)
--------------------------
Compatibility notes:
- added support for Python 3.7
Fixes:
- cache lock: use lock_wait everywhere to fix infinite wait, see #3968
- don't archive tagged dir when recursing an excluded dir, #3991
- py37 argparse: work around bad default in py 3.7.0a/b/rc, #3996
- py37 remove loggerDict.clear() from tearDown method, #3805
- some fixes for bugs which likely did not result in problems in practice:
- fixed logic bug in platform module API version check
- fixed xattr/acl function prototypes, added missing ones
New features:
- init: add warning to store both key and passphrase at safe place(s)
- BORG_HOST_ID env var to work around all-zero MAC address issue, #3985
- borg debug dump-repo-objs --ghost (dump everything from segment files,
including deleted or superceded objects or commit tags)
- borg debug search-repo-objs (search in repo objects for hex bytes or strings)
Other changes:
- add Python 3.7 support
- updated shell completions
- call socket.gethostname only once
- locking: better logging, add some asserts
- borg debug dump-repo-objs:
- filename layout improvements
- use repository.scan() to get on-disk order
- docs:
- update installation instructions for macOS
- added instructions to install fuse via homebrew
- improve diff docs
- added note that checkpoints inside files requires 1.1+
- add link to tempfile module
- remove row/column-spanning from docs source, #4000 #3990
- tests:
- fetch less data via os.urandom
- add py37 env for tox
- travis: add 3.7, remove 3.6-dev (we test with -dev in master)
- vagrant / binary builds:
- use osxfuse 3.8.2
- use own (uptodate) openindiana box
Version 1.1.6 (2018-06-11)
--------------------------
Compatibility notes:
- 1.1.6 changes:
- also allow msgpack-python 0.5.6.
Fixes:
- fix borg exception handling on ENOSPC error with xattrs, #3808
- prune: fix/improve overall progress display
- borg config repo ... does not need cache/manifest/key, #3802
- debug dump-repo-objs should not depend on a manifest obj
- pypi package:
- include .coveragerc, needed by tox.ini
- fix package long description, #3854
New features:
- mount: add uid, gid, umask mount options
- delete:
- only commit once, #3823
- implement --dry-run, #3822
- check:
- show progress while rebuilding missing manifest, #3787
- more --repair output
- borg config --list , #3612
Other changes:
- update msgpack requirement, #3753
- update bundled zstd to 1.3.4, #3745
- update bundled lz4 code to 1.8.2, #3870
- docs:
- describe what BORG_LIBZSTD_PREFIX does
- fix and deduplicate encryption quickstart docs, #3776
- vagrant:
- FUSE for macOS: upgrade 3.7.1 to 3.8.0
- exclude macOS High Sierra upgrade on the darwin64 machine
- remove borgbackup.egg-info dir in fs_init (after rsync)
- use pyenv-based build/test on jessie32/62
- use local 32 and 64bit debian jessie boxes
- use "vagrant" as username for new xenial box
- travis OS X: use xcode 8.3 (not broken)
Version 1.1.5 (2018-04-01)
--------------------------
Compatibility notes:
- 1.1.5 changes:
- require msgpack-python >= 0.4.6 and < 0.5.0.
0.5.0+ dropped python 3.4 testing and also caused some other issues because
the python package was renamed to msgpack and emitted some FutureWarning.
Fixes:
- create --list: fix that it was never showing M status, #3492
- create: fix timing for first checkpoint (read files cache early, init
checkpoint timer after that), see #3394
- extract: set rc=1 when extracting damaged files with all-zero replacement
chunks or with size inconsistencies, #3448
- diff: consider an empty file as different to a non-existing file, #3688
- files cache: improve exception handling, #3553
- ignore exceptions in scandir_inorder() caused by an implicit stat(),
also remove unneeded sort, #3545
- fixed tab completion problem where a space is always added after path even
when it shouldn't
- build: do .h file content checks in binary mode, fixes build issue for
non-ascii header files on pure-ascii locale platforms, #3544 #3639
- borgfs: fix patterns/paths processing, #3551
- config: add some validation, #3566
- repository config: add validation for max_segment_size, #3592
- set cache previous_location on load instead of save
- remove platform.uname() call which caused library mismatch issues, #3732
- add exception handler around deprecated platform.linux_distribution() call
- use same datetime object for {now} and {utcnow}, #3548
New features:
- create: implement --stdin-name, #3533
- add chunker_params to borg archive info (--json)
- BORG_SHOW_SYSINFO=no to hide system information from exceptions
Other changes:
- updated zsh completions for borg 1.1.4
- files cache related code cleanups
- be more helpful when parsing invalid --pattern values, #3575
- be more clear in secure-erase warning message, #3591
- improve getpass user experience, #3689
- docs build: unicode problem fixed when using a py27-based sphinx
- docs:
- security: explicitly note what happens OUTSIDE the attack model
- security: add note about combining compression and encryption
- security: describe chunk size / proximity issue, #3687
- quickstart: add note about permissions, borg@localhost, #3452
- quickstart: add introduction to repositories & archives, #3620
- recreate --recompress: add missing metavar, clarify description, #3617
- improve logging docs, #3549
- add an example for --pattern usage, #3661
- clarify path semantics when matching, #3598
- link to offline documentation from README, #3502
- add docs on how to verify a signed release with GPG, #3634
- chunk seed is generated per repository (not: archive)
- better formatting of CPU usage documentation, #3554
- extend append-only repo rollback docs, #3579
- tests:
- fix erroneously skipped zstd compressor tests, #3606
- skip a test if argparse is broken, #3705
- vagrant:
- xenial64 box now uses username 'vagrant', #3707
- move cleanup steps to fs_init, #3706
- the boxcutter wheezy boxes are 404, use local ones
- update to Python 3.5.5 (for binary builds)
Version 1.1.4 (2017-12-31)
--------------------------
Compatibility notes:
- When upgrading from borg 1.0.x to 1.1.x, please note:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
about a unknown unencrypted repository one time.
- your first backup with 1.1.x might be significantly slower (it might
completely read, chunk, hash a lot files) - this is due to the
--files-cache mode change (and happens every time you change mode).
You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible
mode (but that is less safe for detecting changed files than the default).
See the --files-cache docs for details.
- borg 1.1.4 changes:
- zstd compression is new in borg 1.1.4, older borg can't handle it.
- new minimum requirements for the compression libraries - if the required
versions (header and lib) can't be found at build time, bundled code will
be used:
- added requirement: libzstd >= 1.3.0 (bundled: 1.3.2)
- updated requirement: liblz4 >= 1.7.0 / r129 (bundled: 1.8.0)
Fixes:
- check: data corruption fix: fix for borg check --repair malfunction, #3444.
See the more detailled notes close to the top of this document.
- delete: also delete security dir when deleting a repo, #3427
- prune: fix building the "borg prune" man page, #3398
- init: use given --storage-quota for local repo, #3470
- init: properly quote repo path in output
- fix startup delay with dns-only own fqdn resolving, #3471
New features:
- added zstd compression. try it!
- added placeholder {reverse-fqdn} for fqdn in reverse notation
- added BORG_BASE_DIR environment variable, #3338
Other changes:
- list help topics when invalid topic is requested
- fix lz4 deprecation warning, requires lz4 >= 1.7.0 (r129)
- add parens for C preprocessor macro argument usages (did not cause malfunction)
- exclude broken pytest 3.3.0 release
- updated fish/bash completions
- init: more clear exception messages for borg create, #3465
- docs:
- add auto-generated docs for borg config
- don't generate HTML docs page for borgfs, #3404
- docs update for lz4 b2 zstd changes
- add zstd to compression help, readme, docs
- update requirements and install docs about bundled lz4 and zstd
- refactored build of the compress and crypto.low_level extensions, #3415:
- move some lib/build related code to setup_{zstd,lz4,b2}.py
- bundle lz4 1.8.0 (requirement: >= 1.7.0 / r129)
- bundle zstd 1.3.2 (requirement: >= 1.3.0)
- blake2 was already bundled
- rename BORG_LZ4_PREFIX env var to BORG_LIBLZ4_PREFIX for better consistency:
we also have BORG_LIBB2_PREFIX and BORG_LIBZSTD_PREFIX now.
- add prefer_system_lib* = True settings to setup.py - by default the build
will prefer a shared library over the bundled code, if library and headers
can be found and meet the minimum requirements.
Version 1.1.3 (2017-11-27)
--------------------------
Fixes:
- Security Fix for CVE-2017-15914: Incorrect implementation of access controls
allows remote users to override repository restrictions in Borg servers.
A user able to access a remote Borg SSH server is able to circumvent access
controls post-authentication.
Affected releases: 1.1.0, 1.1.1, 1.1.2. Releases 1.0.x are NOT affected.
- crc32: deal with unaligned buffer, add tests - this broke borg on older ARM
CPUs that can not deal with unaligned 32bit memory accesses and raise a bus
error in such cases. the fix might also improve performance on some CPUs as
all 32bit memory accesses by the crc32 code are properly aligned now. #3317
- mount: fixed support of --consider-part-files and do not show .borg_part_N
files by default in the mounted FUSE filesystem. #3347
- fixed cache/repo timestamp inconsistency message, highlight that information
is obtained from security dir (deleting the cache will not bypass this error
in case the user knows this is a legitimate repo).
- borgfs: don't show sub-command in borgfs help, #3287
- create: show an error when --dry-run and --stats are used together, #3298
New features:
- mount: added exclusion group options and paths, #2138
Reused some code to support similar options/paths as borg extract offers -
making good use of these to only mount a smaller subset of dirs/files can
speed up mounting a lot and also will consume way less memory.
borg mount [options] repo_or_archive mountpoint path [paths...]
paths: you can just give some "root paths" (like for borg extract) to
only partially populate the FUSE filesystem.
new options: --exclude[-from], --pattern[s-from], --strip-components
- create/extract: support st_birthtime on platforms supporting it, #3272
- add "borg config" command for querying/setting/deleting config values, #3304
Other changes:
- clean up and simplify packaging (only package committed files, do not install
.c/.h/.pyx files)
- docs:
- point out tuning options for borg create, #3239
- add instructions for using ntfsclone, zerofree, #81
- move image backup-related FAQ entries to a new page
- clarify key aliases for borg list --format, #3111
- mention break-lock in checkpointing FAQ entry, #3328
- document sshfs rename workaround, #3315
- add FAQ about removing files from existing archives
- add FAQ about different prune policies
- usage and man page for borgfs, #3216
- clarify create --stats duration vs. wall time, #3301
- clarify encrypted key format for borg key export, #3296
- update release checklist about security fixes
- document good and problematic option placements, fix examples, #3356
- add note about using --nobsdflags to avoid speed penalty related to
bsdflags, #3239
- move most of support section to www.borgbackup.org
Version 1.1.2 (2017-11-05)
--------------------------
Fixes:
- fix KeyError crash when talking to borg server < 1.0.7, #3244
- extract: set bsdflags last (include immutable flag), #3263
- create: don't do stat() call on excluded-norecurse directory, fix exception
handling for stat() call, #3209
- create --stats: do not count data volume twice when checkpointing, #3224
- recreate: move chunks_healthy when excluding hardlink master, #3228
- recreate: get rid of chunks_healthy when rechunking (does not match), #3218
- check: get rid of already existing not matching chunks_healthy metadata, #3218
- list: fix stdout broken pipe handling, #3245
- list/diff: remove tag-file options (not used), #3226
New features:
- bash, zsh and fish shell auto-completions, see scripts/shell_completions/
- added BORG_CONFIG_DIR env var, #3083
Other changes:
- docs:
- clarify using a blank passphrase in keyfile mode
- mention "!" (exclude-norecurse) type in "patterns" help
- document to first heal before running borg recreate to re-chunk stuff,
because that will have to get rid of chunks_healthy metadata.
- more than 23 is not supported for CHUNK_MAX_EXP, #3115
- borg does not respect nodump flag by default any more
- clarify same-filesystem requirement for borg upgrade, #2083
- update / rephrase cygwin / WSL status, #3174
- improve docs about --stats, #3260
- vagrant: openindiana new clang package
Already contained in 1.1.1 (last minute fix):
- arg parsing: fix fallback function, refactor, #3205. This is a fixup
for #3155, which was broken on at least python <= 3.4.2.
Version 1.1.1 (2017-10-22)
--------------------------
Compatibility notes:
- The deprecated --no-files-cache is not a global/common option any more,
but only available for borg create (it is not needed for anything else).
Use --files-cache=disabled instead of --no-files-cache.
- The nodump flag ("do not backup this file") is not honoured any more by
default because this functionality (esp. if it happened by error or
unexpected) was rather confusing and unexplainable at first to users.
If you want that "do not backup NODUMP-flagged files" behaviour, use:
borg create --exclude-nodump ...
- If you are on Linux and do not need bsdflags archived, consider using
``--nobsdflags`` with ``borg create`` to avoid additional syscalls and
speed up backup creation.
Fixes:
- borg recreate: correctly compute part file sizes. fixes cosmetic, but
annoying issue as borg check complains about size inconsistencies of part
files in affected archives. you can solve that by running borg recreate on
these archives, see also #3157.
- bsdflags support: do not open BLK/CHR/LNK files, avoid crashes and
slowness, #3130
- recreate: don't crash on attic archives w/o time_end, #3109
- don't crash on repository filesystems w/o hardlink support, #3107
- don't crash in first part of truncate_and_unlink, #3117
- fix server-side IndexError crash with clients < 1.0.7, #3192
- don't show traceback if only a global option is given, show help, #3142
- cache: use SaveFile for more safety, #3158
- init: fix wrong encryption choices in command line parser, fix missing
"authenticated-blake2", #3103
- move --no-files-cache from common to borg create options, #3146
- fix detection of non-local path (failed on ..filename), #3108
- logging with fileConfig: set json attr on "borg" logger, #3114
- fix crash with relative BORG_KEY_FILE, #3197
- show excluded dir with "x" for tagged dirs / caches, #3189
New features:
- create: --nobsdflags and --exclude-nodump options, #3160
- extract: --nobsdflags option, #3160
Other changes:
- remove annoying hardlinked symlinks warning, #3175
- vagrant: use self-made FreeBSD 10.3 box, #3022
- travis: don't brew update, hopefully fixes #2532
- docs:
- readme: -e option is required in borg 1.1
- add example showing --show-version --show-rc
- use --format rather than --list-format (deprecated) in example
- update docs about hardlinked symlinks limitation
Version 1.1.0 (2017-10-07)
--------------------------
Compatibility notes:
- borg command line: do not put options in between positional arguments
This sometimes works (e.g. it worked in borg 1.0.x), but can easily stop
working if we make positional arguments optional (like it happened for
borg create's "paths" argument in 1.1). There are also places in borg 1.0
where we do that, so it doesn't work there in general either. #3356
Good: borg create -v --stats repo::archive path
Good: borg create repo::archive path -v --stats
Bad: borg create repo::archive -v --stats path
Fixes:
- fix LD_LIBRARY_PATH restoration for subprocesses, #3077
- "auto" compression: make sure expensive compression is actually better,
otherwise store lz4 compressed data we already computed.
Other changes:
- docs:
- FAQ: we do not implement futile attempts of ETA / progress displays
- manpage: fix typos, update homepage
- implement simple "issue" role for manpage generation, #3075
Version 1.1.0rc4 (2017-10-01)
-----------------------------
Compatibility notes:
- A borg server >= 1.1.0rc4 does not support borg clients 1.1.0b3-b5. #3033
- The files cache is now controlled differently and has a new default mode:
- the files cache now uses ctime by default for improved file change
detection safety. You can still use mtime for more speed and less safety.
- --ignore-inode is deprecated (use --files-cache=... without "inode")
- --no-files-cache is deprecated (use --files-cache=disabled)
New features:
- --files-cache - implement files cache mode control, #911
You can now control the files cache mode using this option:
--files-cache={ctime,mtime,size,inode,rechunk,disabled}
(only some combinations are supported). See the docs for details.
Fixes:
- remote progress/logging: deal with partial lines, #2637
- remote progress: flush json mode output
- fix subprocess environments, #3050 (and more)
Other changes:
- remove client_supports_log_v3 flag, #3033
- exclude broken Cython 0.27(.0) in requirements, #3066
- vagrant:
- upgrade to FUSE for macOS 3.7.1
- use Python 3.5.4 to build the binaries
- docs:
- security: change-passphrase only changes the passphrase, #2990
- fixed/improved borg create --compression examples, #3034
- add note about metadata dedup and --no[ac]time, #2518
- twitter account @borgbackup now, better visible, #2948
- simplified rate limiting wrapper in FAQ
Version 1.1.0rc3 (2017-09-10)
-----------------------------
New features:
- delete: support naming multiple archives, #2958
Fixes:
- repo cleanup/write: invalidate cached FDs, #2982
- fix datetime.isoformat() microseconds issues, #2994
- recover_segment: use mmap(), lower memory needs, #2987
Other changes:
- with-lock: close segment file before invoking subprocess
- keymanager: don't depend on optional readline module, #2976
- docs:
- fix macOS keychain integration command
- show/link new screencasts in README, #2936
- document utf-8 locale requirement for json mode, #2273
- vagrant: clean up shell profile init, user name, #2977
- test_detect_attic_repo: don't test mount, #2975
- add debug logging for repository cleanup
Version 1.1.0rc2 (2017-08-28)
-----------------------------
Compatibility notes:
- list: corrected mix-up of "isomtime" and "mtime" formats. Previously,
"isomtime" was the default but produced a verbose human format,
while "mtime" produced a ISO-8601-like format.
The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like),
and the default is now "mtime".
"isomtime" is now a real ISO-8601 format ("T" between date and time, not a space).
New features:
- None.
Fixes:
- list: fix weird mixup of mtime/isomtime
- create --timestamp: set start time, #2957
- ignore corrupt files cache, #2939
- migrate locks to child PID when daemonize is used
- fix exitcode of borg serve, #2910
- only compare contents when chunker params match, #2899
- umount: try fusermount, then try umount, #2863
Other changes:
- JSON: use a more standard ISO 8601 datetime format, #2376
- cache: write_archive_index: truncate_and_unlink on error, #2628
- detect non-upgraded Attic repositories, #1933
- delete various nogil and threading related lines
- coala / pylint related improvements
- docs:
- renew asciinema/screencasts, #669
- create: document exclusion through nodump, #2949
- minor formatting fixes
- tar: tarpipe example
- improve "with-lock" and "info" docs, #2869
- detail how to use macOS/GNOME/KDE keyrings for repo passwords, #392
- travis: only short-circuit docs-only changes for pull requests
- vagrant:
- netbsd: bash is already installed
- fix netbsd version in PKG_PATH
- add exe location to PATH when we build an exe
Version 1.1.0rc1 (2017-07-24)
-----------------------------
Compatibility notes:
- delete: removed short option for --cache-only
New features:
- support borg list repo --format {comment} {bcomment} {end}, #2081
- key import: allow reading from stdin, #2760
Fixes:
- with-lock: avoid creating segment files that might be overwritten later, #1867
- prune: fix checkpoints processing with --glob-archives
- FUSE: versions view: keep original file extension at end, #2769
- fix --last, --first: do not accept values <= 0,
fix reversed archive ordering with --last
- include testsuite data (attic.tar.gz) when installing the package
- use limited unpacker for outer key, for manifest (both security precautions),
#2174 #2175
- fix bashism in shell scripts, #2820, #2816
- cleanup endianness detection, create _endian.h,
fixes build on alpine linux, #2809
- fix crash with --no-cache-sync (give known chunk size to chunk_incref), #2853
Other changes:
- FUSE: versions view: linear numbering by archive time
- split up interval parsing from filtering for --keep-within, #2610
- add a basic .editorconfig, #2734
- use archive creation time as mtime for FUSE mount, #2834
- upgrade FUSE for macOS (osxfuse) from 3.5.8 to 3.6.3, #2706
- hashindex: speed up by replacing modulo with "if" to check for wraparound
- coala checker / pylint: fixed requirements and .coafile, more ignores
- borg upgrade: name backup directories as 'before-upgrade', #2811
- add .mailmap
- some minor changes suggested by lgtm.com
- docs:
- better explanation of the --ignore-inode option relevance, #2800
- fix openSUSE command and add openSUSE section
- simplify ssh authorized_keys file using "restrict", add legacy note, #2121
- mount: show usage of archive filters
- mount: add repository example, #2462
- info: update and add examples, #2765
- prune: include example
- improved style / formatting
- improved/fixed segments_per_dir docs
- recreate: fix wrong "remove unwanted files" example
- reference list of status chars in borg recreate --filter description
- update source-install docs about doc build dependencies, #2795
- cleanup installation docs
- file system requirements, update segs per dir
- fix checkpoints/parts reference in FAQ, #2859
- code:
- hashindex: don't pass side effect into macro
- crypto low_level: don't mutate local bytes()
- use dash_open function to open file or "-" for stdin/stdout
- archiver: argparse cleanup / refactoring
- shellpattern: add match_end arg
- tests: added some additional unit tests, some fixes, #2700 #2710
- vagrant: fix setup of cygwin, add Debian 9 "stretch"
- travis: don't perform full travis build on docs-only changes, #2531
Version 1.1.0b6 (2017-06-18)
----------------------------
Compatibility notes:
- Running "borg init" via a "borg serve --append-only" server will *not* create
an append-only repository anymore. Use "borg init --append-only" to initialize
an append-only repository.
- Repositories in the "repokey" and "repokey-blake2" modes with an empty passphrase
are now treated as unencrypted repositories for security checks (e.g.
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK).
Previously there would be no prompts nor messages if an unknown repository
in one of these modes with an empty passphrase was encountered. This would
allow an attacker to swap a repository, if one assumed that the lack of
password prompts was due to a set BORG_PASSPHRASE.
Since the "trick" does not work if BORG_PASSPHRASE is set, this does generally
not affect scripts.
- Repositories in the "authenticated" mode are now treated as the unencrypted
repositories they are.
- The client-side temporary repository cache now holds unencrypted data for better speed.
- borg init: removed the short form of --append-only (-a).
- borg upgrade: removed the short form of --inplace (-i).
New features:
- reimplemented the RepositoryCache, size-limited caching of decrypted repo
contents, integrity checked via xxh64. #2515
- reduced space usage of chunks.archive.d. Existing caches are migrated during
a cache sync. #235 #2638
- integrity checking using xxh64 for important files used by borg, #1101:
- repository: index and hints files
- cache: chunks and files caches, chunks.archive.d
- improve cache sync speed, #1729
- create: new --no-cache-sync option
- add repository mandatory feature flags infrastructure, #1806
- Verify most operations against SecurityManager. Location, manifest timestamp
and key types are now checked for almost all non-debug commands. #2487
- implement storage quotas, #2517
- serve: add --restrict-to-repository, #2589
- BORG_PASSCOMMAND: use external tool providing the key passphrase, #2573
- borg export-tar, #2519
- list: --json-lines instead of --json for archive contents, #2439
- add --debug-profile option (and also "borg debug convert-profile"), #2473
- implement --glob-archives/-a, #2448
- normalize authenticated key modes for better naming consistency:
- rename "authenticated" to "authenticated-blake2" (uses blake2b)
- implement "authenticated" mode (uses hmac-sha256)
Fixes:
- hashindex: read/write indices >2 GiB on 32bit systems, better error
reporting, #2496
- repository URLs: implement IPv6 address support and also more informative
error message when parsing fails.
- mount: check whether llfuse is installed before asking for passphrase, #2540
- mount: do pre-mount checks before opening repository, #2541
- FUSE:
- fix crash if empty (None) xattr is read, #2534
- fix read(2) caching data in metadata cache
- fix negative uid/gid crash (fix crash when mounting archives
of external drives made on cygwin), #2674
- redo ItemCache, on top of object cache
- use decrypted cache
- remove unnecessary normpaths
- serve: ignore --append-only when initializing a repository (borg init), #2501
- serve: fix incorrect type of exception_short for Errors, #2513
- fix --exclude and --exclude-from recursing into directories, #2469
- init: don't allow creating nested repositories, #2563
- --json: fix encryption[mode] not being the cmdline name
- remote: propagate Error.traceback correctly
- fix remote logging and progress, #2241
- implement --debug-topic for remote servers
- remote: restore "Remote:" prefix (as used in 1.0.x)
- rpc negotiate: enable v3 log protocol only for supported clients
- fix --progress and logging in general for remote
- fix parse_version, add tests, #2556
- repository: truncate segments (and also some other files) before unlinking, #2557
- recreate: keep timestamps as in original archive, #2384
- recreate: if single archive is not processed, exit 2
- patterns: don't recurse with ! / --exclude for pf:, #2509
- cache sync: fix n^2 behaviour in lookup_name
- extract: don't write to disk with --stdout (affected non-regular-file items), #2645
- hashindex: implement KeyError, more tests
Other changes:
- remote: show path in PathNotAllowed
- consider repokey w/o passphrase == unencrypted, #2169
- consider authenticated mode == unencrypted, #2503
- restrict key file names, #2560
- document follow_symlinks requirements, check libc, use stat and chown
with follow_symlinks=False, #2507
- support common options on the main command, #2508
- support common options on mid-level commands (e.g. borg *key* export)
- make --progress a common option
- increase DEFAULT_SEGMENTS_PER_DIR to 1000
- chunker: fix invalid use of types (function only used by tests)
- chunker: don't do uint32_t >> 32
- FUSE:
- add instrumentation (--debug and SIGUSR1/SIGINFO)
- reduced memory usage for repository mounts by lazily instantiating archives
- improved archive load times
- info: use CacheSynchronizer & HashIndex.stats_against (better performance)
- docs:
- init: document --encryption as required
- security: OpenSSL usage
- security: used implementations; note python libraries
- security: security track record of OpenSSL and msgpack
- patterns: document denial of service (regex, wildcards)
- init: note possible denial of service with "none" mode
- init: document SHA extension is supported in OpenSSL and thus SHA is
faster on AMD Ryzen than blake2b.
- book: use A4 format, new builder option format.
- book: create appendices
- data structures: explain repository compaction
- data structures: add chunk layout diagram
- data structures: integrity checking
- data structures: demingle cache and repo index
- Attic FAQ: separate section for attic stuff
- FAQ: I get an IntegrityError or similar - what now?
- FAQ: Can I use Borg on SMR hard drives?, #2252
- FAQ: specify "using inline shell scripts"
- add systemd warning regarding placeholders, #2543
- xattr: document API
- add docs/misc/borg-data-flow data flow chart
- debugging facilities
- README: how to help the project, #2550
- README: add bountysource badge, #2558
- fresh new theme + tweaking
- logo: vectorized (PDF and SVG) versions
- frontends: use headlines - you can link to them
- mark --pattern, --patterns-from as experimental
- highlight experimental features in online docs
- remove regex based pattern examples, #2458
- nanorst for "borg help TOPIC" and --help
- split deployment
- deployment: hosting repositories
- deployment: automated backups to a local hard drive
- development: vagrant, windows10 requirements
- development: update docs remarks
- split usage docs, #2627
- usage: avoid bash highlight, [options] instead of
- usage: add benchmark page
- helpers: truncate_and_unlink doc
- don't suggest to leak BORG_PASSPHRASE
- internals: columnize rather long ToC [webkit fixup]
internals: manifest & feature flags
- internals: more HashIndex details
- internals: fix ASCII art equations
- internals: edited obj graph related sections a bit
- internals: layers image + description
- fix way too small figures in pdf
- index: disable syntax highlight (bash)
- improve options formatting, fix accidental block quotes
- testing / checking:
- add support for using coala, #1366
- testsuite: add ArchiverCorruptionTestCase
- do not test logger name, #2504
- call setup_logging after destroying logging config
- testsuite.archiver: normalise pytest.raises vs. assert_raises
- add test for preserved intermediate folder permissions, #2477
- key: add round-trip test
- remove attic dependency of the tests, #2505
- enable remote tests on cygwin
- tests: suppress tar's future timestamp warning
- cache sync: add more refcount tests
- repository: add tests, including corruption tests
- vagrant:
- control VM cpus and pytest workers via env vars VMCPUS and XDISTN
- update cleaning workdir
- fix openbsd shell
- add OpenIndiana
- packaging:
- binaries: don't bundle libssl
- setup.py clean to remove compiled files
- fail in borg package if version metadata is very broken (setuptools_scm)
- repo / code structure:
- create borg.algorithms and borg.crypto packages
- algorithms: rename crc32 to checksums
- move patterns to module, #2469
- gitignore: complete paths for src/ excludes
- cache: extract CacheConfig class
- implement IntegrityCheckedFile + Detached variant, #2502 #1688
- introduce popen_with_error_handling to handle common user errors
Version 1.1.0b5 (2017-04-30)
----------------------------
Compatibility notes:
- BORG_HOSTNAME_IS_UNIQUE is now on by default.
- removed --compression-from feature
- recreate: add --recompress flag, unify --always-recompress and
--recompress
Fixes:
- catch exception for os.link when hardlinks are not supported, #2405
- borg rename / recreate: expand placeholders, #2386
- generic support for hardlinks (files, devices, FIFOs), #2324
- extract: also create parent dir for device files, if needed, #2358
- extract: if a hardlink master is not in the to-be-extracted subset,
the "x" status was not displayed for it, #2351
- embrace y2038 issue to support 32bit platforms: clamp timestamps to int32,
#2347
- verify_data: fix IntegrityError handling for defect chunks, #2442
- allow excluding parent and including child, #2314
Other changes:
- refactor compression decision stuff
- change global compression default to lz4 as well, to be consistent
with --compression defaults.
- placeholders: deny access to internals and other unspecified stuff
- clearer error message for unrecognized placeholder
- more clear exception if borg check does not help, #2427
- vagrant: upgrade FUSE for macOS to 3.5.8, #2346
- linux binary builds: get rid of glibc 2.13 dependency, #2430
- docs:
- placeholders: document escaping
- serve: env vars in original commands are ignored
- tell what kind of hardlinks we support
- more docs about compression
- LICENSE: use canonical formulation
("copyright holders and contributors" instead of "author")
- document borg init behaviour via append-only borg serve, #2440
- be clear about what buzhash is used for, #2390
- add hint about chunker params, #2421
- clarify borg upgrade docs, #2436
- FAQ to explain warning when running borg check --repair, #2341
- repository file system requirements, #2080
- pre-install considerations
- misc. formatting / crossref fixes
- tests:
- enhance travis setuptools_scm situation
- add extra test for the hashindex
- fix invalid param issue in benchmarks
These belong to 1.1.0b4 release, but did not make it into changelog by then:
- vagrant: increase memory for parallel testing
- lz4 compress: lower max. buffer size, exception handling
- add docstring to do_benchmark_crud
- patterns help: mention path full-match in intro
Version 1.1.0b4 (2017-03-27)
----------------------------
Compatibility notes:
- init: the --encryption argument is mandatory now (there are several choices)
- moved "borg migrate-to-repokey" to "borg key migrate-to-repokey".
- "borg change-passphrase" is deprecated, use "borg key change-passphrase"
instead.
- the --exclude-if-present option now supports tagging a folder with any
filesystem object type (file, folder, etc), instead of expecting only files
as tags, #1999
- the --keep-tag-files option has been deprecated in favor of the new
--keep-exclude-tags, to account for the change mentioned above.
- use lz4 compression by default, #2179
New features:
- JSON API to make developing frontends and automation easier
(see :ref:`json_output`)
- add JSON output to commands: `borg create/list/info --json ...`.
- add --log-json option for structured logging output.
- add JSON progress information, JSON support for confirmations (yes()).
- add two new options --pattern and --patterns-from as discussed in #1406
- new path full match pattern style (pf:) for very fast matching, #2334
- add 'debug dump-manifest' and 'debug dump-archive' commands
- add 'borg benchmark crud' command, #1788
- new 'borg delete --force --force' to delete severely corrupted archives, #1975
- info: show utilization of maximum archive size, #1452
- list: add dsize and dcsize keys, #2164
- paperkey.html: Add interactive html template for printing key backups.
- key export: add qr html export mode
- securely erase config file (which might have old encryption key), #2257
- archived file items: add size to metadata, 'borg extract' and 'borg check' do
check the file size for consistency, FUSE uses precomputed size from Item.
Fixes:
- fix remote speed regression introduced in 1.1.0b3, #2185
- fix regression handling timestamps beyond 2262 (revert bigint removal),
introduced in 1.1.0b3, #2321
- clamp (nano)second values to unproblematic range, #2304
- hashindex: rebuild hashtable if we have too little empty buckets
(performance fix), #2246
- Location regex: fix bad parsing of wrong syntax
- ignore posix_fadvise errors in repository.py, #2095
- borg rpc: use limited msgpack.Unpacker (security precaution), #2139
- Manifest: Make sure manifest timestamp is strictly monotonically increasing.
- create: handle BackupOSError on a per-path level in one spot
- create: clarify -x option / meaning of "same filesystem"
- create: don't create hard link refs to failed files
- archive check: detect and fix missing all-zero replacement chunks, #2180
- files cache: update inode number when --ignore-inode is used, #2226
- fix decompression exceptions crashing ``check --verify-data`` and others
instead of reporting integrity error, #2224 #2221
- extract: warning for unextracted big extended attributes, #2258, #2161
- mount: umount on SIGINT/^C when in foreground
- mount: handle invalid hard link refs
- mount: fix huge RAM consumption when mounting a repository (saves number of
archives * 8 MiB), #2308
- hashindex: detect mingw byte order #2073
- hashindex: fix wrong skip_hint on hashindex_set when encountering tombstones,
the regression was introduced in #1748
- fix ChunkIndex.__contains__ assertion for big-endian archs
- fix borg key/debug/benchmark crashing without subcommand, #2240
- Location: accept //servername/share/path
- correct/refactor calculation of unique/non-unique chunks
- extract: fix missing call to ProgressIndicator.finish
- prune: fix error msg, it is --keep-within, not --within
- fix "auto" compression mode bug (not compressing), #2331
- fix symlink item fs size computation, #2344
Other changes:
- remote repository: improved async exception processing, #2255 #2225
- with --compression auto,C, only use C if lz4 achieves at least 3% compression
- PatternMatcher: only normalize path once, #2338
- hashindex: separate endian-dependent defs from endian detection
- migrate-to-repokey: ask using canonical_path() as we do everywhere else.
- SyncFile: fix use of fd object after close
- make LoggedIO.close_segment reentrant
- creating a new segment: use "xb" mode, #2099
- redo key_creator, key_factory, centralise key knowledge, #2272
- add return code functions, #2199
- list: only load cache if needed
- list: files->items, clarifications
- list: add "name" key for consistency with info cmd
- ArchiveFormatter: add "start" key for compatibility with "info"
- RemoteRepository: account rx/tx bytes
- setup.py build_usage/build_man/build_api fixes
- Manifest.in: simplify, exclude .so, .dll and .orig, #2066
- FUSE: get rid of chunk accounting, st_blocks = ceil(size / blocksize).
- tests:
- help python development by testing 3.6-dev
- test for borg delete --force
- vagrant:
- freebsd: some fixes, #2067
- darwin64: use osxfuse 3.5.4 for tests / to build binaries
- darwin64: improve VM settings
- use python 3.5.3 to build binaries, #2078
- upgrade pyinstaller from 3.1.1+ to 3.2.1
- pyinstaller: use fixed AND freshly compiled bootloader, #2002
- pyinstaller: automatically builds bootloader if missing
- docs:
- create really nice man pages
- faq: mention --remote-ratelimit in bandwidth limit question
- fix caskroom link, #2299
- docs/security: reiterate that RPC in Borg does no networking
- docs/security: counter tracking, #2266
- docs/development: update merge remarks
- address SSH batch mode in docs, #2202 #2270
- add warning about running build_usage on Python >3.4, #2123
- one link per distro in the installation page
- improve --exclude-if-present and --keep-exclude-tags, #2268
- improve automated backup script in doc, #2214
- improve remote-path description
- update docs for create -C default change (lz4)
- document relative path usage, #1868
- document snapshot usage, #2178
- corrected some stuff in internals+security
- internals: move toctree to after the introduction text
- clarify metadata kind, manifest ops
- key enc: correct / clarify some stuff, link to internals/security
- datas: enc: 1.1.x mas different MACs
- datas: enc: correct factual error -- no nonce involved there.
- make internals.rst an index page and edit it a bit
- add "Cryptography in Borg" and "Remote RPC protocol security" sections
- document BORG_HOSTNAME_IS_UNIQUE, #2087
- FAQ by categories as proposed by @anarcat in #1802
- FAQ: update Which file types, attributes, etc. are *not* preserved?
- development: new branching model for git repository
- development: define "ours" merge strategy for auto-generated files
- create: move --exclude note to main doc
- create: move item flags to main doc
- fix examples using borg init without -e/--encryption
- list: don't print key listings in fat (html + man)
- remove Python API docs (were very incomplete, build problems on RTFD)
- added FAQ section about backing up root partition
Version 1.0.10 (2017-02-13)
---------------------------
Bug fixes:
- Manifest timestamps are now monotonically increasing,
this fixes issues when the system clock jumps backwards
or is set inconsistently across computers accessing the same repository, #2115
- Fixed testing regression in 1.0.10rc1 that lead to a hard dependency on
py.test >= 3.0, #2112
New features:
- "key export" can now generate a printable HTML page with both a QR code and
a human-readable "paperkey" representation (and custom text) through the
``--qr-html`` option.
The same functionality is also available through `paperkey.html `_,
which is the same HTML page generated by ``--qr-html``. It works with existing
"key export" files and key files.
Other changes:
- docs:
- language clarification - "borg create --one-file-system" option does not respect
mount points, but considers different file systems instead, #2141
- setup.py: build_api: sort file list for determinism
Version 1.1.0b3 (2017-01-15)
----------------------------
Compatibility notes:
- borg init: removed the default of "--encryption/-e", #1979
This was done so users do a informed decision about -e mode.
Bug fixes:
- borg recreate: don't rechunkify unless explicitly told so
- borg info: fixed bug when called without arguments, #1914
- borg init: fix free space check crashing if disk is full, #1821
- borg debug delete/get obj: fix wrong reference to exception
- fix processing of remote ~/ and ~user/ paths (regressed since 1.1.0b1), #1759
- posix platform module: only build / import on non-win32 platforms, #2041
New features:
- new CRC32 implementations that are much faster than the zlib one used previously, #1970
- add blake2b key modes (use blake2b as MAC). This links against system libb2,
if possible, otherwise uses bundled code
- automatically remove stale locks - set BORG_HOSTNAME_IS_UNIQUE env var
to enable stale lock killing. If set, stale locks in both cache and
repository are deleted. #562 #1253
- borg info : print general repo information, #1680
- borg check --first / --last / --sort / --prefix, #1663
- borg mount --first / --last / --sort / --prefix, #1542
- implement "health" item formatter key, #1749
- BORG_SECURITY_DIR to remember security related infos outside the cache.
Key type, location and manifest timestamp checks now survive cache
deletion. This also means that you can now delete your cache and avoid
previous warnings, since Borg can still tell it's safe.
- implement BORG_NEW_PASSPHRASE, #1768
Other changes:
- borg recreate:
- remove special-cased --dry-run
- update --help
- remove bloat: interruption blah, autocommit blah, resuming blah
- re-use existing checkpoint functionality
- archiver tests: add check_cache tool - lints refcounts
- fixed cache sync performance regression from 1.1.0b1 onwards, #1940
- syncing the cache without chunks.archive.d (see :ref:`disable_archive_chunks`)
now avoids any merges and is thus faster, #1940
- borg check --verify-data: faster due to linear on-disk-order scan
- borg debug-xxx commands removed, we use "debug xxx" subcommands now, #1627
- improve metadata handling speed
- shortcut hashindex_set by having hashindex_lookup hint about address
- improve / add progress displays, #1721
- check for index vs. segment files object count mismatch
- make RPC protocol more extensible: use named parameters.
- RemoteRepository: misc. code cleanups / refactors
- clarify cache/repository README file
- docs:
- quickstart: add a comment about other (remote) filesystems
- quickstart: only give one possible ssh url syntax, all others are
documented in usage chapter.
- mention file://
- document repo URLs / archive location
- clarify borg diff help, #980
- deployment: synthesize alternative --restrict-to-path example
- improve cache / index docs, esp. files cache docs, #1825
- document using "git merge 1.0-maint -s recursive -X rename-threshold=20%"
for avoiding troubles when merging the 1.0-maint branch into master.
- tests:
- FUSE tests: catch ENOTSUP on freebsd
- FUSE tests: test troublesome xattrs last
- fix byte range error in test, #1740
- use monkeypatch to set env vars, but only on pytest based tests.
- point XDG_*_HOME to temp dirs for tests, #1714
- remove all BORG_* env vars from the outer environment
Version 1.0.10rc1 (2017-01-29)
------------------------------
Bug fixes:
- borg serve: fix transmission data loss of pipe writes, #1268
This affects only the cygwin platform (not Linux, BSD, OS X).
- Avoid triggering an ObjectiveFS bug in xattr retrieval, #1992
- When running out of buffer memory when reading xattrs, only skip the
current file, #1993
- Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since
:ref:`the issue ` is not relevant for unencrypted repositories,
it now does nothing and prints an error, #1981.
- Fixed change-passphrase crashing with unencrypted repositories, #1978
- Fixed "borg check repo::archive" indicating success if "archive" does not exist, #1997
- borg check: print non-exit-code warning if --last or --prefix aren't fulfilled
- fix bad parsing of wrong repo location syntax
- create: don't create hard link refs to failed files,
mount: handle invalid hard link refs, #2092
- detect mingw byte order, #2073
- creating a new segment: use "xb" mode, #2099
- mount: umount on SIGINT/^C when in foreground, #2082
Other changes:
- binary: use fixed AND freshly compiled pyinstaller bootloader, #2002
- xattr: ignore empty names returned by llistxattr(2) et al
- Enable the fault handler: install handlers for the SIGSEGV, SIGFPE, SIGABRT,
SIGBUS and SIGILL signals to dump the Python traceback.
- Also print a traceback on SIGUSR2.
- borg change-passphrase: print key location (simplify making a backup of it)
- officially support Python 3.6 (setup.py: add Python 3.6 qualifier)
- tests:
- vagrant / travis / tox: add Python 3.6 based testing
- vagrant: fix openbsd repo, #2042
- vagrant: fix the freebsd64 machine, #2037 #2067
- vagrant: use python 3.5.3 to build binaries, #2078
- vagrant: use osxfuse 3.5.4 for tests / to build binaries
vagrant: improve darwin64 VM settings
- travis: fix osxfuse install (fixes OS X testing on Travis CI)
- travis: require succeeding OS X tests, #2028
- travis: use latest pythons for OS X based testing
- use pytest-xdist to parallelize testing
- fix xattr test race condition, #2047
- setup.cfg: fix pytest deprecation warning, #2050
- docs:
- language clarification - VM backup FAQ
- borg create: document how to backup stdin, #2013
- borg upgrade: fix incorrect title levels
- add CVE numbers for issues fixed in 1.0.9, #2106
- fix typos (taken from Debian package patch)
- remote: include data hexdump in "unexpected RPC data" error message
- remote: log SSH command line at debug level
- API_VERSION: use numberspaces, #2023
- remove .github from pypi package, #2051
- add pip and setuptools to requirements file, #2030
- SyncFile: fix use of fd object after close (cosmetic)
- Manifest.in: simplify, exclude \*.{so,dll,orig}, #2066
- ignore posix_fadvise errors in repository.py, #2095
(works around issues with docker on ARM)
- make LoggedIO.close_segment reentrant, avoid reentrance
Version 1.0.9 (2016-12-20)
--------------------------
Security fixes:
- A flaw in the cryptographic authentication scheme in Borg allowed an attacker
to spoof the manifest. See :ref:`tam_vuln` above for the steps you should
take.
CVE-2016-10099 was assigned to this vulnerability.
- borg check: When rebuilding the manifest (which should only be needed very rarely)
duplicate archive names would be handled on a "first come first serve" basis, allowing
an attacker to apparently replace archives.
CVE-2016-10100 was assigned to this vulnerability.
Bug fixes:
- borg check:
- rebuild manifest if it's corrupted
- skip corrupted chunks during manifest rebuild
- fix TypeError in integrity error handler, #1903, #1894
- fix location parser for archives with @ char (regression introduced in 1.0.8), #1930
- fix wrong duration/timestamps if system clock jumped during a create
- fix progress display not updating if system clock jumps backwards
- fix checkpoint interval being incorrect if system clock jumps
Other changes:
- docs:
- add python3-devel as a dependency for cygwin-based installation
- clarify extract is relative to current directory
- FAQ: fix link to changelog
- markup fixes
- tests:
- test_get\_(cache|keys)_dir: clean env state, #1897
- get back pytest's pretty assertion failures, #1938
- setup.py build_usage:
- fixed build_usage not processing all commands
- fixed build_usage not generating includes for debug commands
Version 1.0.9rc1 (2016-11-27)
-----------------------------
Bug fixes:
- files cache: fix determination of newest mtime in backup set (which is
used in cache cleanup and led to wrong "A" [added] status for unchanged
files in next backup), #1860.
- borg check:
- fix incorrectly reporting attic 0.13 and earlier archives as corrupt
- handle repo w/o objects gracefully and also bail out early if repo is
*completely* empty, #1815.
- fix tox/pybuild in 1.0-maint
- at xattr module import time, loggers are not initialized yet
New features:
- borg umount
exposed already existing umount code via the CLI api, so users can use it,
which is more consistent than using borg to mount and fusermount -u (or
umount) to un-mount, #1855.
- implement borg create --noatime --noctime, fixes #1853
Other changes:
- docs:
- display README correctly on PyPI
- improve cache / index docs, esp. files cache docs, fixes #1825
- different pattern matching for --exclude, #1779
- datetime formatting examples for {now} placeholder, #1822
- clarify passphrase mode attic repo upgrade, #1854
- clarify --umask usage, #1859
- clarify how to choose PR target branch
- clarify prune behavior for different archive contents, #1824
- fix PDF issues, add logo, fix authors, headings, TOC
- move security verification to support section
- fix links in standalone README (:ref: tags)
- add link to security contact in README
- add FAQ about security
- move fork differences to FAQ
- add more details about resource usage
- tests: skip remote tests on cygwin, #1268
- travis:
- allow OS X failures until the brew cask osxfuse issue is fixed
- caskroom osxfuse-beta gone, it's osxfuse now (3.5.3)
- vagrant:
- upgrade OSXfuse / FUSE for macOS to 3.5.3
- remove llfuse from tox.ini at a central place
- do not try to install llfuse on centos6
- fix FUSE test for darwin, #1546
- add windows virtual machine with cygwin
- Vagrantfile cleanup / code deduplication
Version 1.1.0b2 (2016-10-01)
----------------------------
Bug fixes:
- fix incorrect preservation of delete tags, leading to "object count mismatch"
on borg check, #1598. This only occurred with 1.1.0b1 (not with 1.0.x) and is
normally fixed by running another borg create/delete/prune.
- fix broken --progress for double-cell paths (e.g. CJK), #1624
- borg recreate: also catch SIGHUP
- FUSE:
- fix hardlinks in versions view, #1599
- add parameter check to ItemCache.get to make potential failures more clear
New features:
- Archiver, RemoteRepository: add --remote-ratelimit (send data)
- borg help compression, #1582
- borg check: delete chunks with integrity errors, #1575, so they can be
"repaired" immediately and maybe healed later.
- archives filters concept (refactoring/unifying older code)
- covers --first/--last/--prefix/--sort-by options
- currently used for borg list/info/delete
Other changes:
- borg check --verify-data slightly tuned (use get_many())
- change {utcnow} and {now} to ISO-8601 format ("T" date/time separator)
- repo check: log transaction IDs, improve object count mismatch diagnostic
- Vagrantfile: use TW's fresh-bootloader pyinstaller branch
- fix module names in api.rst
- hashindex: bump api_version
Version 1.1.0b1 (2016-08-28)
----------------------------
New features:
- new commands:
- borg recreate: re-create existing archives, #787 #686 #630 #70, also see
#757, #770.
- selectively remove files/dirs from old archives
- re-compress data
- re-chunkify data, e.g. to have upgraded Attic / Borg 0.xx archives
deduplicate with Borg 1.x archives or to experiment with chunker-params.
- borg diff: show differences between archives
- borg with-lock: execute a command with the repository locked, #990
- borg create:
- Flexible compression with pattern matching on path/filename,
and LZ4 heuristic for deciding compressibility, #810, #1007
- visit files in inode order (better speed, esp. for large directories and rotating disks)
- in-file checkpoints, #1217
- increased default checkpoint interval to 30 minutes (was 5 minutes), #896
- added uuid archive format tag, #1151
- save mountpoint directories with --one-file-system, makes system restore easier, #1033
- Linux: added support for some BSD flags, #1050
- add 'x' status for excluded paths, #814
- also means files excluded via UF_NODUMP, #1080
- borg check:
- will not produce the "Checking segments" output unless new --progress option is passed, #824.
- --verify-data to verify data cryptographically on the client, #975
- borg list, #751, #1179
- removed {formatkeys}, see "borg list --help"
- --list-format is deprecated, use --format instead
- --format now also applies to listing archives, not only archive contents, #1179
- now supports the usual [PATH [PATHS…]] syntax and excludes
- new keys: csize, num_chunks, unique_chunks, NUL
- supports guaranteed_available hashlib hashes
(to avoid varying functionality depending on environment),
which includes the SHA1 and SHA2 family as well as MD5
- borg prune:
- to better visualize the "thinning out", we now list all archives in
reverse time order. rephrase and reorder help text.
- implement --keep-last N via --keep-secondly N, also --keep-minutely.
assuming that there is not more than 1 backup archive made in 1s,
--keep-last N and --keep-secondly N are equivalent, #537
- cleanup checkpoints except the latest, #1008
- borg extract:
- added --progress, #1449
- Linux: limited support for BSD flags, #1050
- borg info:
- output is now more similar to borg create --stats, #977
- borg mount:
- provide "borgfs" wrapper for borg mount, enables usage via fstab, #743
- "versions" mount option - when used with a repository mount, this gives
a merged, versioned view of the files in all archives, #729
- repository:
- added progress information to commit/compaction phase (often takes some time when deleting/pruning), #1519
- automatic recovery for some forms of repository inconsistency, #858
- check free space before going forward with a commit, #1336
- improved write performance (esp. for rotating media), #985
- new IO code for Linux
- raised default segment size to approx 512 MiB
- improved compaction performance, #1041
- reduced client CPU load and improved performance for remote repositories, #940
- options that imply output (--show-rc, --show-version, --list, --stats,
--progress) don't need -v/--info to have that output displayed, #865
- add archive comments (via borg (re)create --comment), #842
- borg list/prune/delete: also output archive id, #731
- --show-version: shows/logs the borg version, #725
- added --debug-topic for granular debug logging, #1447
- use atomic file writing/updating for configuration and key files, #1377
- BORG_KEY_FILE environment variable, #1001
- self-testing module, #970
Bug fixes:
- list: fixed default output being produced if --format is given with empty parameter, #1489
- create: fixed overflowing progress line with CJK and similar characters, #1051
- prune: fixed crash if --prefix resulted in no matches, #1029
- init: clean up partial repo if passphrase input is aborted, #850
- info: quote cmdline arguments that have spaces in them
- fix hardlinks failing in some cases for extracting subtrees, #761
Other changes:
- replace stdlib hmac with OpenSSL, zero-copy decrypt (10-15% increase in
performance of hash-lists and extract).
- improved chunker performance, #1021
- open repository segment files in exclusive mode (fail-safe), #1134
- improved error logging, #1440
- Source:
- pass meta-data around, #765
- move some constants to new constants module
- better readability and fewer errors with namedtuples, #823
- moved source tree into src/ subdirectory, #1016
- made borg.platform a package, #1113
- removed dead crypto code, #1032
- improved and ported parts of the test suite to py.test, #912
- created data classes instead of passing dictionaries around, #981, #1158, #1161
- cleaned up imports, #1112
- Docs:
- better help texts and sphinx reproduction of usage help:
- Group options
- Nicer list of options in Sphinx
- Deduplicate 'Common options' (including --help)
- chunker: added some insights by "Voltara", #903
- clarify what "deduplicated size" means
- fix / update / add package list entries
- added a SaltStack usage example, #956
- expanded FAQ
- new contributors in AUTHORS!
- Tests:
- vagrant: add ubuntu/xenial 64bit - this box has still some issues
- ChunkBuffer: add test for leaving partial chunk in buffer, fixes #945
Version 1.0.8 (2016-10-29)
--------------------------
Bug fixes:
- RemoteRepository: Fix busy wait in call_many, #940
New features:
- implement borgmajor/borgminor/borgpatch placeholders, #1694
{borgversion} was already there (full version string). With the new
placeholders you can now also get e.g. 1 or 1.0 or 1.0.8.
Other changes:
- avoid previous_location mismatch, #1741
due to the changed canonicalization for relative paths in PR #1711 / #1655
(implement /./ relpath hack), there would be a changed repo location warning
and the user would be asked if this is ok. this would break automation and
require manual intervention, which is unwanted.
thus, we automatically fix the previous_location config entry, if it only
changed in the expected way, but still means the same location.
- docs:
- deployment.rst: do not use bare variables in ansible snippet
- add clarification about append-only mode, #1689
- setup.py: add comment about requiring llfuse, #1726
- update usage.rst / api.rst
- repo url / archive location docs + typo fix
- quickstart: add a comment about other (remote) filesystems
- vagrant / tests:
- no chown when rsyncing (fixes boxes w/o vagrant group)
- fix FUSE permission issues on linux/freebsd, #1544
- skip FUSE test for borg binary + fakeroot
- ignore security.selinux xattrs, fixes tests on centos, #1735
Version 1.0.8rc1 (2016-10-17)
-----------------------------
Bug fixes:
- fix signal handling (SIGINT, SIGTERM, SIGHUP), #1620 #1593
Fixes e.g. leftover lock files for quickly repeated signals (e.g. Ctrl-C
Ctrl-C) or lost connections or systemd sending SIGHUP.
- progress display: adapt formatting to narrow screens, do not crash, #1628
- borg create --read-special - fix crash on broken symlink, #1584.
also correctly processes broken symlinks. before this regressed to a crash
(5b45385) a broken symlink would've been skipped.
- process_symlink: fix missing backup_io()
Fixes a chmod/chown/chgrp/unlink/rename/... crash race between getting
dirents and dispatching to process_symlink.
- yes(): abort on wrong answers, saying so, #1622
- fixed exception borg serve raised when connection was closed before reposiory
was openend. add an error message for this.
- fix read-from-closed-FD issue, #1551
(this seems not to get triggered in 1.0.x, but was discovered in master)
- hashindex: fix iterators (always raise StopIteration when exhausted)
(this seems not to get triggered in 1.0.x, but was discovered in master)
- enable relative paths in ssh:// repo URLs, via /./relpath hack, #1655
- allow repo paths with colons, #1705
- update changed repo location immediately after acceptance, #1524
- fix debug get-obj / delete-obj crash if object not found and remote repo,
#1684
- pyinstaller: use a spec file to build borg.exe binary, exclude osxfuse dylib
on Mac OS X (avoids mismatch lib <-> driver), #1619
New features:
- add "borg key export" / "borg key import" commands, #1555, so users are able
to backup / restore their encryption keys more easily.
Supported formats are the keyfile format used by borg internally and a
special "paper" format with by line checksums for printed backups. For the
paper format, the import is an interactive process which checks each line as
soon as it is input.
- add "borg debug-refcount-obj" to determine a repo objects' referrer counts,
#1352
Other changes:
- add "borg debug ..." subcommands
(borg debug-* still works, but will be removed in borg 1.1)
- setup.py: Add subcommand support to build_usage.
- remote: change exception message for unexpected RPC data format to indicate
dataflow direction.
- improved messages / error reporting:
- IntegrityError: add placeholder for message, so that the message we give
appears not only in the traceback, but also in the (short) error message,
#1572
- borg.key: include chunk id in exception msgs, #1571
- better messages for cache newer than repo, #1700
- vagrant (testing/build VMs):
- upgrade OSXfuse / FUSE for macOS to 3.5.2
- update Debian Wheezy boxes, #1686
- openbsd / netbsd: use own boxes, fixes misc rsync installation and
FUSE/llfuse related testing issues, #1695 #1696 #1670 #1671 #1728
- docs:
- add docs for "key export" and "key import" commands, #1641
- fix inconsistency in FAQ (pv-wrapper).
- fix second block in "Easy to use" section not showing on GitHub, #1576
- add bestpractices badge
- link reference docs and faq about BORG_FILES_CACHE_TTL, #1561
- improve borg info --help, explain size infos, #1532
- add release signing key / security contact to README, #1560
- add contribution guidelines for developers
- development.rst: add sphinx_rtd_theme to the sphinx install command
- adjust border color in borg.css
- add debug-info usage help file
- internals.rst: fix typos
- setup.py: fix build_usage to always process all commands
- added docs explaining multiple --restrict-to-path flags, #1602
- add more specific warning about write-access debug commands, #1587
- clarify FAQ regarding backup of virtual machines, #1672
- tests:
- work around FUSE xattr test issue with recent fakeroot
- simplify repo/hashindex tests
- travis: test FUSE-enabled borg, use trusty to have a recent FUSE
- re-enable FUSE tests for RemoteArchiver (no deadlocks any more)
- clean env for pytest based tests, #1714
- fuse_mount contextmanager: accept any options
Version 1.0.7 (2016-08-19)
--------------------------
Security fixes:
- borg serve: fix security issue with remote repository access, #1428
If you used e.g. --restrict-to-path /path/client1/ (with or without trailing
slash does not make a difference), it acted like a path prefix match using
/path/client1 (note the missing trailing slash) - the code then also allowed
working in e.g. /path/client13 or /path/client1000.
As this could accidentally lead to major security/privacy issues depending on
the paths you use, the behaviour was changed to be a strict directory match.
That means --restrict-to-path /path/client1 (with or without trailing slash
does not make a difference) now uses /path/client1/ internally (note the
trailing slash here!) for matching and allows precisely that path AND any
path below it. So, /path/client1 is allowed, /path/client1/repo1 is allowed,
but not /path/client13 or /path/client1000.
If you willingly used the undocumented (dangerous) previous behaviour, you
may need to rearrange your --restrict-to-path paths now. We are sorry if
that causes work for you, but we did not want a potentially dangerous
behaviour in the software (not even using a for-backwards-compat option).
Bug fixes:
- fixed repeated LockTimeout exceptions when borg serve tried to write into
a already write-locked repo (e.g. by a borg mount), #502 part b)
This was solved by the fix for #1220 in 1.0.7rc1 already.
- fix cosmetics + file leftover for "not a valid borg repository", #1490
- Cache: release lock if cache is invalid, #1501
- borg extract --strip-components: fix leak of preloaded chunk contents
- Repository, when a InvalidRepository exception happens:
- fix spurious, empty lock.roster
- fix repo not closed cleanly
New features:
- implement borg debug-info, fixes #1122
(just calls already existing code via cli, same output as below tracebacks)
Other changes:
- skip the O_NOATIME test on GNU Hurd, fixes #1315
(this is a very minor issue and the GNU Hurd project knows the bug)
- document using a clean repo to test / build the release
Version 1.0.7rc2 (2016-08-13)
-----------------------------
Bug fixes:
- do not write objects to repository that are bigger than the allowed size,
borg will reject reading them, #1451.
Important: if you created archives with many millions of files or
directories, please verify if you can open them successfully,
e.g. try a "borg list REPO::ARCHIVE".
- lz4 compression: dynamically enlarge the (de)compression buffer, the static
buffer was not big enough for archives with extremely many items, #1453
- larger item metadata stream chunks, raise archive item limit by 8x, #1452
- fix untracked segments made by moved DELETEs, #1442
Impact: Previously (metadata) segments could become untracked when deleting data,
these would never be cleaned up.
- extended attributes (xattrs) related fixes:
- fixed a race condition in xattrs querying that led to the entire file not
being backed up (while logging the error, exit code = 1), #1469
- fixed a race condition in xattrs querying that led to a crash, #1462
- raise OSError including the error message derived from errno, deal with
path being a integer FD
Other changes:
- print active env var override by default, #1467
- xattr module: refactor code, deduplicate, clean up
- repository: split object size check into too small and too big
- add a transaction_id assertion, so borg init on a broken (inconsistent)
filesystem does not look like a coding error in borg, but points to the
real problem.
- explain confusing TypeError caused by compat support for old servers, #1456
- add forgotten usage help file from build_usage
- refactor/unify buffer code into helpers.Buffer class, add tests
- docs:
- document archive limitation, #1452
- improve prune examples
Version 1.0.7rc1 (2016-08-05)
-----------------------------
Bug fixes:
- fix repo lock deadlocks (related to lock upgrade), #1220
- catch unpacker exceptions, resync, #1351
- fix borg break-lock ignoring BORG_REPO env var, #1324
- files cache performance fixes (fixes unnecessary re-reading/chunking/
hashing of unmodified files for some use cases):
- fix unintended file cache eviction, #1430
- implement BORG_FILES_CACHE_TTL, update FAQ, raise default TTL from 10
to 20, #1338
- FUSE:
- cache partially read data chunks (performance), #965, #966
- always create a root dir, #1125
- use an OrderedDict for helptext, making the build reproducible, #1346
- RemoteRepository init: always call close on exceptions, #1370 (cosmetic)
- ignore stdout/stderr broken pipe errors (cosmetic), #1116
New features:
- better borg versions management support (useful esp. for borg servers
wanting to offer multiple borg versions and for clients wanting to choose
a specific server borg version), #1392:
- add BORG_VERSION environment variable before executing "borg serve" via ssh
- add new placeholder {borgversion}
- substitute placeholders in --remote-path
- borg init --append-only option (makes using the more secure append-only mode
more convenient. when used remotely, this requires 1.0.7+ also on the borg
server), #1291.
Other changes:
- Vagrantfile:
- darwin64: upgrade to FUSE for macOS 3.4.1 (aka osxfuse), #1378
- xenial64: use user "ubuntu", not "vagrant" (as usual), #1331
- tests:
- fix FUSE tests on OS X, #1433
- docs:
- FAQ: add backup using stable filesystem names recommendation
- FAQ about glibc compatibility added, #491, glibc-check improved
- FAQ: 'A' unchanged file; remove ambiguous entry age sentence.
- OS X: install pkg-config to build with FUSE support, fixes #1400
- add notes about shell/sudo pitfalls with env. vars, #1380
- added platform feature matrix
- implement borg debug-dump-repo-objs
Version 1.0.6 (2016-07-12)
--------------------------
Bug fixes:
- Linux: handle multiple LD_PRELOAD entries correctly, #1314, #1111
- Fix crash with unclear message if the libc is not found, #1314, #1111
Other changes:
- tests:
- Fixed O_NOATIME tests for Solaris and GNU Hurd, #1315
- Fixed sparse file tests for (file) systems not supporting it, #1310
- docs:
- Fixed syntax highlighting, #1313
- misc docs: added data processing overview picture
Version 1.0.6rc1 (2016-07-10)
-----------------------------
New features:
- borg check --repair: heal damaged files if missing chunks re-appear (e.g. if
the previously missing chunk was added again in a later backup archive),
#148. (*) Also improved logging.
Bug fixes:
- sync_dir: silence fsync() failing with EINVAL, #1287
Some network filesystems (like smbfs) don't support this and we use this in
repository code.
- borg mount (FUSE):
- fix directories being shadowed when contained paths were also specified,
#1295
- raise I/O Error (EIO) on damaged files (unless -o allow_damaged_files is
used), #1302. (*)
- borg extract: warn if a damaged file is extracted, #1299. (*)
- Added some missing return code checks (ChunkIndex._add, hashindex_resize).
- borg check: fix/optimize initial hash table size, avoids resize of the table.
Other changes:
- tests:
- add more FUSE tests, #1284
- deduplicate FUSE (u)mount code
- fix borg binary test issues, #862
- docs:
- changelog: added release dates to older borg releases
- fix some sphinx (docs generator) warnings, #881
Notes:
(*) Some features depend on information (chunks_healthy list) added to item
metadata when a file with missing chunks was "repaired" using all-zero
replacement chunks. The chunks_healthy list is generated since borg 1.0.4,
thus borg can't recognize such "repaired" (but content-damaged) files if the
repair was done with an older borg version.
Version 1.0.5 (2016-07-07)
--------------------------
Bug fixes:
- borg mount: fix FUSE crash in xattr code on Linux introduced in 1.0.4, #1282
Other changes:
- backport some FAQ entries from master branch
- add release helper scripts
- Vagrantfile:
- centos6: no FUSE, don't build binary
- add xz for redhat-like dists
Version 1.0.4 (2016-07-07)
--------------------------
New features:
- borg serve --append-only, #1168
This was included because it was a simple change (append-only functionality
was already present via repository config file) and makes better security now
practically usable.
- BORG_REMOTE_PATH environment variable, #1258
This was included because it was a simple change (--remote-path cli option
was already present) and makes borg much easier to use if you need it.
- Repository: cleanup incomplete transaction on "no space left" condition.
In many cases, this can avoid a 100% full repo filesystem (which is very
problematic as borg always needs free space - even to delete archives).
Bug fixes:
- Fix wrong handling and reporting of OSErrors in borg create, #1138.
This was a serious issue: in the context of "borg create", errors like
repository I/O errors (e.g. disk I/O errors, ssh repo connection errors)
were handled badly and did not lead to a crash (which would be good for this
case, because the repo transaction would be incomplete and trigger a
transaction rollback to clean up).
Now, error handling for source files is cleanly separated from every other
error handling, so only problematic input files are logged and skipped.
- Implement fail-safe error handling for borg extract.
Note that this isn't nearly as critical as the borg create error handling
bug, since nothing is written to the repo. So this was "merely" misleading
error reporting.
- Add missing error handler in directory attr restore loop.
- repo: make sure write data hits disk before the commit tag (#1236) and also
sync the containing directory.
- FUSE: getxattr fail must use errno.ENOATTR, #1126
(fixes Mac OS X Finder malfunction: "zero bytes" file length, access denied)
- borg check --repair: do not lose information about the good/original chunks.
If we do not lose the original chunk IDs list when "repairing" a file
(replacing missing chunks with all-zero chunks), we have a chance to "heal"
the file back into its original state later, in case the chunks re-appear
(e.g. in a fresh backup). Healing is not implemented yet, see #148.
- fixes for --read-special mode:
- ignore known files cache, #1241
- fake regular file mode, #1214
- improve symlinks handling, #1215
- remove passphrase from subprocess environment, #1105
- Ignore empty index file (will trigger index rebuild), #1195
- add missing placeholder support for --prefix, #1027
- improve exception handling for placeholder replacement
- catch and format exceptions in arg parsing
- helpers: fix "undefined name 'e'" in exception handler
- better error handling for missing repo manifest, #1043
- borg delete:
- make it possible to delete a repo without manifest
- borg delete --forced allows to delete corrupted archives, #1139
- borg check:
- make borg check work for empty repo
- fix resync and msgpacked item qualifier, #1135
- rebuild_manifest: fix crash if 'name' or 'time' key were missing.
- better validation of item metadata dicts, #1130
- better validation of archive metadata dicts
- close the repo on exit - even if rollback did not work, #1197.
This is rather cosmetic, it avoids repo closing in the destructor.
- tests:
- fix sparse file test, #1170
- flake8: ignore new F405, #1185
- catch "invalid argument" on cygwin, #257
- fix sparseness assertion in test prep, #1264
Other changes:
- make borg build/work on OpenSSL 1.0 and 1.1, #1187
- docs / help:
- fix / clarify prune help, #1143
- fix "patterns" help formatting
- add missing docs / help about placeholders
- resources: rename atticmatic to borgmatic
- document sshd settings, #545
- more details about checkpoints, add split trick, #1171
- support docs: add freenode web chat link, #1175
- add prune visualization / example, #723
- add note that Fnmatch is default, #1247
- make clear that lzma levels > 6 are a waste of cpu cycles
- add a "do not edit" note to auto-generated files, #1250
- update cygwin installation docs
- repository interoperability with borg master (1.1dev) branch:
- borg check: read item metadata keys from manifest, #1147
- read v2 hints files, #1235
- fix hints file "unknown version" error handling bug
- tests: add tests for format_line
- llfuse: update version requirement for freebsd
- Vagrantfile:
- use openbsd 5.9, #716
- do not install llfuse on netbsd (broken)
- update OSXfuse to version 3.3.3
- use Python 3.5.2 to build the binaries
- glibc compatibility checker: scripts/glibc_check.py
- add .eggs to .gitignore
Version 1.0.3 (2016-05-20)
--------------------------
Bug fixes:
- prune: avoid that checkpoints are kept and completed archives are deleted in
a prune run), #997
- prune: fix commandline argument validation - some valid command lines were
considered invalid (annoying, but harmless), #942
- fix capabilities extraction on Linux (set xattrs last, after chown()), #1069
- repository: fix commit tags being seen in data
- when probing key files, do binary reads. avoids crash when non-borg binary
files are located in borg's key files directory.
- handle SIGTERM and make a clean exit - avoids orphan lock files.
- repository cache: don't cache large objects (avoid using lots of temp. disk
space), #1063
Other changes:
- Vagrantfile: OS X: update osxfuse / install lzma package, #933
- setup.py: add check for platform_darwin.c
- setup.py: on freebsd, use a llfuse release that builds ok
- docs / help:
- update readthedocs URLs, #991
- add missing docs for "borg break-lock", #992
- borg create help: add some words to about the archive name
- borg create help: document format tags, #894
Version 1.0.2 (2016-04-16)
--------------------------
Bug fixes:
- fix malfunction and potential corruption on (nowadays rather rare) big-endian
architectures or bi-endian archs in (rare) BE mode. #886, #889
cache resync / index merge was malfunctioning due to this, potentially
leading to data loss. borg info had cosmetic issues (displayed wrong values).
note: all (widespread) little-endian archs (like x86/x64) or bi-endian archs
in (widespread) LE mode (like ARMEL, MIPSEL, ...) were NOT affected.
- add overflow and range checks for 1st (special) uint32 of the hashindex
values, switch from int32 to uint32.
- fix so that refcount will never overflow, but just stick to max. value after
a overflow would have occurred.
- borg delete: fix --cache-only for broken caches, #874
Makes --cache-only idempotent: it won't fail if the cache is already deleted.
- fixed borg create --one-file-system erroneously traversing into other
filesystems (if starting fs device number was 0), #873
- workround a bug in Linux fadvise FADV_DONTNEED, #907
Other changes:
- better test coverage for hashindex, incl. overflow testing, checking correct
computations so endianness issues would be discovered.
- reproducible doc for ProgressIndicator*, make the build reproducible.
- use latest llfuse for vagrant machines
- docs:
- use /path/to/repo in examples, fixes #901
- fix confusing usage of "repo" as archive name (use "arch")
Version 1.0.1 (2016-04-08)
--------------------------
New features:
Usually there are no new features in a bugfix release, but these were added
due to their high impact on security/safety/speed or because they are fixes
also:
- append-only mode for repositories, #809, #36 (see docs)
- borg create: add --ignore-inode option to make borg detect unmodified files
even if your filesystem does not have stable inode numbers (like sshfs and
possibly CIFS).
- add options --warning, --error, --critical for missing log levels, #826.
it's not recommended to suppress warnings or errors, but the user may decide
this on his own.
note: --warning is not given to borg serve so a <= 1.0.0 borg will still
work as server (it is not needed as it is the default).
do not use --error or --critical when using a <= 1.0.0 borg server.
Bug fixes:
- fix silently skipping EIO, #748
- add context manager for Repository (avoid orphan repository locks), #285
- do not sleep for >60s while waiting for lock, #773
- unpack file stats before passing to FUSE
- fix build on illumos
- don't try to backup doors or event ports (Solaris and derivates)
- remove useless/misleading libc version display, #738
- test suite: reset exit code of persistent archiver, #844
- RemoteRepository: clean up pipe if remote open() fails
- Remote: don't print tracebacks for Error exceptions handled downstream, #792
- if BORG_PASSPHRASE is present but wrong, don't prompt for password, but fail
instead, #791
- ArchiveChecker: move "orphaned objects check skipped" to INFO log level, #826
- fix capitalization, add ellipses, change log level to debug for 2 messages,
#798
Other changes:
- update llfuse requirement, llfuse 1.0 works
- update OS / dist packages on build machines, #717
- prefer showing --info over -v in usage help, #859
- docs:
- fix cygwin requirements (gcc-g++)
- document how to debug / file filesystem issues, #664
- fix reproducible build of api docs
- RTD theme: CSS !important overwrite, #727
- Document logo font. Recreate logo png. Remove GIMP logo file.
Version 1.0.0 (2016-03-05)
--------------------------
The major release number change (0.x -> 1.x) indicates bigger incompatible
changes, please read the compatibility notes, adapt / test your scripts and
check your backup logs.
Compatibility notes:
- drop support for python 3.2 and 3.3, require 3.4 or 3.5, #221 #65 #490
note: we provide binaries that include python 3.5.1 and everything else
needed. they are an option in case you are stuck with < 3.4 otherwise.
- change encryption to be on by default (using "repokey" mode)
- moved keyfile keys from ~/.borg/keys to ~/.config/borg/keys,
you can either move them manually or run "borg upgrade "
- remove support for --encryption=passphrase,
use borg migrate-to-repokey to switch to repokey mode, #97
- remove deprecated --compression ,
use --compression zlib, instead
in case of 0, you could also use --compression none
- remove deprecated --hourly/daily/weekly/monthly/yearly
use --keep-hourly/daily/weekly/monthly/yearly instead
- remove deprecated --do-not-cross-mountpoints,
use --one-file-system instead
- disambiguate -p option, #563:
- -p now is same as --progress
- -P now is same as --prefix
- remove deprecated "borg verify",
use "borg extract --dry-run" instead
- cleanup environment variable semantics, #355
the environment variables used to be "yes sayers" when set, this was
conceptually generalized to "automatic answerers" and they just give their
value as answer (as if you typed in that value when being asked).
See the "usage" / "Environment Variables" section of the docs for details.
- change the builtin default for --chunker-params, create 2MiB chunks, #343
--chunker-params new default: 19,23,21,4095 - old default: 10,23,16,4095
one of the biggest issues with borg < 1.0 (and also attic) was that it had a
default target chunk size of 64kiB, thus it created a lot of chunks and thus
also a huge chunk management overhead (high RAM and disk usage).
please note that the new default won't change the chunks that you already
have in your repository. the new big chunks do not deduplicate with the old
small chunks, so expect your repo to grow at least by the size of every
changed file and in the worst case (e.g. if your files cache was lost / is
not used) by the size of every file (minus any compression you might use).
in case you want to immediately see a much lower resource usage (RAM / disk)
for chunks management, it might be better to start with a new repo than
continuing in the existing repo (with an existing repo, you'ld have to wait
until all archives with small chunks got pruned to see a lower resource
usage).
if you used the old --chunker-params default value (or if you did not use
--chunker-params option at all) and you'ld like to continue using small
chunks (and you accept the huge resource usage that comes with that), just
explicitly use borg create --chunker-params=10,23,16,4095.
- archive timestamps: the 'time' timestamp now refers to archive creation
start time (was: end time), the new 'time_end' timestamp refers to archive
creation end time. This might affect prune if your backups take rather long.
if you give a timestamp via cli this is stored into 'time', therefore it now
needs to mean archive creation start time.
New features:
- implement password roundtrip, #695
Bug fixes:
- remote end does not need cache nor keys directories, do not create them, #701
- added retry counter for passwords, #703
Other changes:
- fix compiler warnings, #697
- docs:
- update README.rst to new changelog location in docs/changes.rst
- add Teemu to AUTHORS
- changes.rst: fix old chunker params, #698
- FAQ: how to limit bandwidth
Version 1.0.0rc2 (2016-02-28)
-----------------------------
New features:
- format options for location: user, pid, fqdn, hostname, now, utcnow, user
- borg list --list-format
- borg prune -v --list enables the keep/prune list output, #658
Bug fixes:
- fix _open_rb noatime handling, #657
- add a simple archivename validator, #680
- borg create --stats: show timestamps in localtime, use same labels/formatting
as borg info, #651
- llfuse compatibility fixes (now compatible with: 0.40, 0.41, 0.42)
Other changes:
- it is now possible to use "pip install borgbackup[fuse]" to automatically
install the llfuse dependency using the correct version requirement
for it. you still need to care about having installed the FUSE / build
related OS package first, though, so that building llfuse can succeed.
- Vagrant: drop Ubuntu Precise (12.04) - does not have Python >= 3.4
- Vagrant: use pyinstaller v3.1.1 to build binaries
- docs:
- borg upgrade: add to docs that only LOCAL repos are supported
- borg upgrade also handles borg 0.xx -> 1.0
- use pip extras or requirements file to install llfuse
- fix order in release process
- updated usage docs and other minor / cosmetic fixes
- verified borg examples in docs, #644
- freebsd dependency installation and FUSE configuration, #649
- add example how to restore a raw device, #671
- add a hint about the dev headers needed when installing from source
- add examples for delete (and handle delete after list, before prune), #656
- update example for borg create -v --stats (use iso datetime format), #663
- added example to BORG_RSH docs
- "connection closed by remote": add FAQ entry and point to issue #636
Version 1.0.0rc1 (2016-02-07)
-----------------------------
New features:
- borg migrate-to-repokey ("passphrase" -> "repokey" encryption key mode)
- implement --short for borg list REPO, #611
- implement --list for borg extract (consistency with borg create)
- borg serve: overwrite client's --restrict-to-path with ssh forced command's
option value (but keep everything else from the client commandline), #544
- use $XDG_CONFIG_HOME/keys for keyfile keys (~/.config/borg/keys), #515
- "borg upgrade" moves the keyfile keys to the new location
- display both archive creation start and end time in "borg info", #627
Bug fixes:
- normalize trailing slashes for the repository path, #606
- Cache: fix exception handling in __init__, release lock, #610
Other changes:
- suppress unneeded exception context (PEP 409), simpler tracebacks
- removed special code needed to deal with imperfections / incompatibilities /
missing stuff in py 3.2/3.3, simplify code that can be done simpler in 3.4
- removed some version requirements that were kept on old versions because
newer did not support py 3.2 any more
- use some py 3.4+ stdlib code instead of own/openssl/pypi code:
- use os.urandom instead of own cython openssl RAND_bytes wrapper, #493
- use hashlib.pbkdf2_hmac from py stdlib instead of own openssl wrapper
- use hmac.compare_digest instead of == operator (constant time comparison)
- use stat.filemode instead of homegrown code
- use "mock" library from stdlib, #145
- remove borg.support (with non-broken argparse copy), it is ok in 3.4+, #358
- Vagrant: copy CHANGES.rst as symlink, #592
- cosmetic code cleanups, add flake8 to tox/travis, #4
- docs / help:
- make "borg -h" output prettier, #591
- slightly rephrase prune help
- add missing example for --list option of borg create
- quote exclude line that includes an asterisk to prevent shell expansion
- fix dead link to license
- delete Ubuntu Vivid, it is not supported anymore (EOL)
- OS X binary does not work for older OS X releases, #629
- borg serve's special support for forced/original ssh commands, #544
- misc. updates and fixes
Version 0.30.0 (2016-01-23)
---------------------------
Compatibility notes:
- you may need to use -v (or --info) more often to actually see output emitted
at INFO log level (because it is suppressed at the default WARNING log level).
See the "general" section in the usage docs.
- for borg create, you need --list (additionally to -v) to see the long file
list (was needed so you can have e.g. --stats alone without the long list)
- see below about BORG_DELETE_I_KNOW_WHAT_I_AM_DOING (was:
BORG_CHECK_I_KNOW_WHAT_I_AM_DOING)
Bug fixes:
- fix crash when using borg create --dry-run --keep-tag-files, #570
- make sure teardown with cleanup happens for Cache and RepositoryCache,
avoiding leftover locks and TEMP dir contents, #285 (partially), #548
- fix locking KeyError, partial fix for #502
- log stats consistently, #526
- add abbreviated weekday to timestamp format, fixes #496
- strip whitespace when loading exclusions from file
- unset LD_LIBRARY_PATH before invoking ssh, fixes strange OpenSSL library
version warning when using the borg binary, #514
- add some error handling/fallback for C library loading, #494
- added BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for check in "borg delete", #503
- remove unused "repair" rpc method name
New features:
- borg create: implement exclusions using regular expression patterns.
- borg create: implement inclusions using patterns.
- borg extract: support patterns, #361
- support different styles for patterns:
- fnmatch (`fm:` prefix, default when omitted), like borg <= 0.29.
- shell (`sh:` prefix) with `*` not matching directory separators and
`**/` matching 0..n directories
- path prefix (`pp:` prefix, for unifying borg create pp1 pp2 into the
patterns system), semantics like in borg <= 0.29
- regular expression (`re:`), new!
- --progress option for borg upgrade (#291) and borg delete
- update progress indication more often (e.g. for borg create within big
files or for borg check repo), #500
- finer chunker granularity for items metadata stream, #547, #487
- borg create --list now used (additionally to -v) to enable the verbose
file list output
- display borg version below tracebacks, #532
Other changes:
- hashtable size (and thus: RAM and disk consumption) follows a growth policy:
grows fast while small, grows slower when getting bigger, #527
- Vagrantfile: use pyinstaller 3.1 to build binaries, freebsd sqlite3 fix,
fixes #569
- no separate binaries for centos6 any more because the generic linux binaries
also work on centos6 (or in general: on systems with a slightly older glibc
than debian7
- dev environment: require virtualenv<14.0 so we get a py32 compatible pip
- docs:
- add space-saving chunks.archive.d trick to FAQ
- important: clarify -v and log levels in usage -> general, please read!
- sphinx configuration: create a simple man page from usage docs
- add a repo server setup example
- disable unneeded SSH features in authorized_keys examples for security.
- borg prune only knows "--keep-within" and not "--within"
- add gource video to resources docs, #507
- add netbsd install instructions
- authors: make it more clear what refers to borg and what to attic
- document standalone binary requirements, #499
- rephrase the mailing list section
- development docs: run build_api and build_usage before tagging release
- internals docs: hash table max. load factor is 0.75 now
- markup, typo, grammar, phrasing, clarifications and other fixes.
- add gcc gcc-c++ to redhat/fedora/corora install docs, fixes #583
Version 0.29.0 (2015-12-13)
---------------------------
Compatibility notes:
- when upgrading to 0.29.0 you need to upgrade client as well as server
installations due to the locking and commandline interface changes otherwise
you'll get an error msg about a RPC protocol mismatch or a wrong commandline
option.
if you run a server that needs to support both old and new clients, it is
suggested that you have a "borg-0.28.2" and a "borg-0.29.0" command.
clients then can choose via e.g. "borg --remote-path=borg-0.29.0 ...".
- the default waiting time for a lock changed from infinity to 1 second for a
better interactive user experience. if the repo you want to access is
currently locked, borg will now terminate after 1s with an error message.
if you have scripts that shall wait for the lock for a longer time, use
--lock-wait N (with N being the maximum wait time in seconds).
Bug fixes:
- hash table tuning (better chosen hashtable load factor 0.75 and prime initial
size of 1031 gave ~1000x speedup in some scenarios)
- avoid creation of an orphan lock for one case, #285
- --keep-tag-files: fix file mode and multiple tag files in one directory, #432
- fixes for "borg upgrade" (attic repo converter), #466
- remove --progress isatty magic (and also --no-progress option) again, #476
- borg init: display proper repo URL
- fix format of umask in help pages, #463
New features:
- implement --lock-wait, support timeout for UpgradableLock, #210
- implement borg break-lock command, #157
- include system info below traceback, #324
- sane remote logging, remote stderr, #461:
- remote log output: intercept it and log it via local logging system,
with "Remote: " prefixed to message. log remote tracebacks.
- remote stderr: output it to local stderr with "Remote: " prefixed.
- add --debug and --info (same as --verbose) to set the log level of the
builtin logging configuration (which otherwise defaults to warning), #426
note: there are few messages emitted at DEBUG level currently.
- optionally configure logging via env var BORG_LOGGING_CONF
- add --filter option for status characters: e.g. to show only the added
or modified files (and also errors), use "borg create -v --filter=AME ...".
- more progress indicators, #394
- use ISO-8601 date and time format, #375
- "borg check --prefix" to restrict archive checking to that name prefix, #206
Other changes:
- hashindex_add C implementation (speed up cache re-sync for new archives)
- increase FUSE read_size to 1024 (speed up metadata operations)
- check/delete/prune --save-space: free unused segments quickly, #239
- increase rpc protocol version to 2 (see also Compatibility notes), #458
- silence borg by default (via default log level WARNING)
- get rid of C compiler warnings, #391
- upgrade OS X FUSE to 3.0.9 on the OS X binary build system
- use python 3.5.1 to build binaries
- docs:
- new mailing list borgbackup@python.org, #468
- readthedocs: color and logo improvements
- load coverage icons over SSL (avoids mixed content)
- more precise binary installation steps
- update release procedure docs about OS X FUSE
- FAQ entry about unexpected 'A' status for unchanged file(s), #403
- add docs about 'E' file status
- add "borg upgrade" docs, #464
- add developer docs about output and logging
- clarify encryption, add note about client-side encryption
- add resources section, with videos, talks, presentations, #149
- Borg moved to Arch Linux [community]
- fix wrong installation instructions for archlinux
Version 0.28.2 (2015-11-15)
---------------------------
New features:
- borg create --exclude-if-present TAGFILE - exclude directories that have the
given file from the backup. You can additionally give --keep-tag-files to
preserve just the directory roots and the tag-files (but not backup other
directory contents), #395, attic #128, attic #142
Other changes:
- do not create docs sources at build time (just have them in the repo),
completely remove have_cython() hack, do not use the "mock" library at build
time, #384
- avoid hidden import, make it easier for PyInstaller, easier fix for #218
- docs:
- add description of item flags / status output, fixes #402
- explain how to regenerate usage and API files (build_api or
build_usage) and when to commit usage files directly into git, #384
- minor install docs improvements
Version 0.28.1 (2015-11-08)
---------------------------
Bug fixes:
- do not try to build api / usage docs for production install,
fixes unexpected "mock" build dependency, #384
Other changes:
- avoid using msgpack.packb at import time
- fix formatting issue in changes.rst
- fix build on readthedocs
Version 0.28.0 (2015-11-08)
---------------------------
Compatibility notes:
- changed return codes (exit codes), see docs. in short:
old: 0 = ok, 1 = error. now: 0 = ok, 1 = warning, 2 = error
New features:
- refactor return codes (exit codes), fixes #61
- add --show-rc option enable "terminating with X status, rc N" output, fixes 58, #351
- borg create backups atime and ctime additionally to mtime, fixes #317
- extract: support atime additionally to mtime
- FUSE: support ctime and atime additionally to mtime
- support borg --version
- emit a warning if we have a slow msgpack installed
- borg list --prefix=thishostname- REPO, fixes #205
- Debug commands (do not use except if you know what you do: debug-get-obj,
debug-put-obj, debug-delete-obj, debug-dump-archive-items.
Bug fixes:
- setup.py: fix bug related to BORG_LZ4_PREFIX processing
- fix "check" for repos that have incomplete chunks, fixes #364
- borg mount: fix unlocking of repository at umount time, fixes #331
- fix reading files without touching their atime, #334
- non-ascii ACL fixes for Linux, FreeBSD and OS X, #277
- fix acl_use_local_uid_gid() and add a test for it, attic #359
- borg upgrade: do not upgrade repositories in place by default, #299
- fix cascading failure with the index conversion code, #269
- borg check: implement 'cmdline' archive metadata value decoding, #311
- fix RobustUnpacker, it missed some metadata keys (new atime and ctime keys
were missing, but also bsdflags). add check for unknown metadata keys.
- create from stdin: also save atime, ctime (cosmetic)
- use default_notty=False for confirmations, fixes #345
- vagrant: fix msgpack installation on centos, fixes #342
- deal with unicode errors for symlinks in same way as for regular files and
have a helpful warning message about how to fix wrong locale setup, fixes #382
- add ACL keys the RobustUnpacker must know about
Other changes:
- improve file size displays, more flexible size formatters
- explicitly commit to the units standard, #289
- archiver: add E status (means that an error occurred when processing this
(single) item
- do binary releases via "github releases", closes #214
- create: use -x and --one-file-system (was: --do-not-cross-mountpoints), #296
- a lot of changes related to using "logging" module and screen output, #233
- show progress display if on a tty, output more progress information, #303
- factor out status output so it is consistent, fix surrogates removal,
maybe fixes #309
- move away from RawConfigParser to ConfigParser
- archive checker: better error logging, give chunk_id and sequence numbers
(can be used together with borg debug-dump-archive-items).
- do not mention the deprecated passphrase mode
- emit a deprecation warning for --compression N (giving a just a number)
- misc .coverragerc fixes (and coverage measurement improvements), fixes #319
- refactor confirmation code, reduce code duplication, add tests
- prettier error messages, fixes #307, #57
- tests:
- add a test to find disk-full issues, #327
- travis: also run tests on Python 3.5
- travis: use tox -r so it rebuilds the tox environments
- test the generated pyinstaller-based binary by archiver unit tests, #215
- vagrant: tests: announce whether fakeroot is used or not
- vagrant: add vagrant user to fuse group for debianoid systems also
- vagrant: llfuse install on darwin needs pkgconfig installed
- vagrant: use pyinstaller from develop branch, fixes #336
- benchmarks: test create, extract, list, delete, info, check, help, fixes #146
- benchmarks: test with both the binary and the python code
- archiver tests: test with both the binary and the python code, fixes #215
- make basic test more robust
- docs:
- moved docs to borgbackup.readthedocs.org, #155
- a lot of fixes and improvements, use mobile-friendly RTD standard theme
- use zlib,6 compression in some examples, fixes #275
- add missing rename usage to docs, closes #279
- include the help offered by borg help in the usage docs, fixes #293
- include a list of major changes compared to attic into README, fixes #224
- add OS X install instructions, #197
- more details about the release process, #260
- fix linux glibc requirement (binaries built on debian7 now)
- build: move usage and API generation to setup.py
- update docs about return codes, #61
- remove api docs (too much breakage on rtd)
- borgbackup install + basics presentation (asciinema)
- describe the current style guide in documentation
- add section about debug commands
- warn about not running out of space
- add example for rename
- improve chunker params docs, fixes #362
- minor development docs update
Version 0.27.0 (2015-10-07)
---------------------------
New features:
- "borg upgrade" command - attic -> borg one time converter / migration, #21
- temporary hack to avoid using lots of disk space for chunks.archive.d, #235:
To use it: rm -rf chunks.archive.d ; touch chunks.archive.d
- respect XDG_CACHE_HOME, attic #181
- add support for arbitrary SSH commands, attic #99
- borg delete --cache-only REPO (only delete cache, not REPO), attic #123
Bug fixes:
- use Debian 7 (wheezy) to build pyinstaller borgbackup binaries, fixes slow
down observed when running the Centos6-built binary on Ubuntu, #222
- do not crash on empty lock.roster, fixes #232
- fix multiple issues with the cache config version check, #234
- fix segment entry header size check, attic #352
plus other error handling improvements / code deduplication there.
- always give segment and offset in repo IntegrityErrors
Other changes:
- stop producing binary wheels, remove docs about it, #147
- docs:
- add warning about prune
- generate usage include files only as needed
- development docs: add Vagrant section
- update / improve / reformat FAQ
- hint to single-file pyinstaller binaries from README
Version 0.26.1 (2015-09-28)
---------------------------
This is a minor update, just docs and new pyinstaller binaries.
- docs update about python and binary requirements
- better docs for --read-special, fix #220
- re-built the binaries, fix #218 and #213 (glibc version issue)
- update web site about single-file pyinstaller binaries
Note: if you did a python-based installation, there is no need to upgrade.
Version 0.26.0 (2015-09-19)
---------------------------
New features:
- Faster cache sync (do all in one pass, remove tar/compression stuff), #163
- BORG_REPO env var to specify the default repo, #168
- read special files as if they were regular files, #79
- implement borg create --dry-run, attic issue #267
- Normalize paths before pattern matching on OS X, #143
- support OpenBSD and NetBSD (except xattrs/ACLs)
- support / run tests on Python 3.5
Bug fixes:
- borg mount repo: use absolute path, attic #200, attic #137
- chunker: use off_t to get 64bit on 32bit platform, #178
- initialize chunker fd to -1, so it's not equal to STDIN_FILENO (0)
- fix reaction to "no" answer at delete repo prompt, #182
- setup.py: detect lz4.h header file location
- to support python < 3.2.4, add less buggy argparse lib from 3.2.6 (#194)
- fix for obtaining ``char *`` from temporary Python value (old code causes
a compile error on Mint 17.2)
- llfuse 0.41 install troubles on some platforms, require < 0.41
(UnicodeDecodeError exception due to non-ascii llfuse setup.py)
- cython code: add some int types to get rid of unspecific python add /
subtract operations (avoid ``undefined symbol FPE_``... error on some platforms)
- fix verbose mode display of stdin backup
- extract: warn if a include pattern never matched, fixes #209,
implement counters for Include/ExcludePatterns
- archive names with slashes are invalid, attic issue #180
- chunker: add a check whether the POSIX_FADV_DONTNEED constant is defined -
fixes building on OpenBSD.
Other changes:
- detect inconsistency / corruption / hash collision, #170
- replace versioneer with setuptools_scm, #106
- docs:
- pkg-config is needed for llfuse installation
- be more clear about pruning, attic issue #132
- unit tests:
- xattr: ignore security.selinux attribute showing up
- ext3 seems to need a bit more space for a sparse file
- do not test lzma level 9 compression (avoid MemoryError)
- work around strange mtime granularity issue on netbsd, fixes #204
- ignore st_rdev if file is not a block/char device, fixes #203
- stay away from the setgid and sticky mode bits
- use Vagrant to do easy cross-platform testing (#196), currently:
- Debian 7 "wheezy" 32bit, Debian 8 "jessie" 64bit
- Ubuntu 12.04 32bit, Ubuntu 14.04 64bit
- Centos 7 64bit
- FreeBSD 10.2 64bit
- OpenBSD 5.7 64bit
- NetBSD 6.1.5 64bit
- Darwin (OS X Yosemite)
Version 0.25.0 (2015-08-29)
---------------------------
Compatibility notes:
- lz4 compression library (liblz4) is a new requirement (#156)
- the new compression code is very compatible: as long as you stay with zlib
compression, older borg releases will still be able to read data from a
repo/archive made with the new code (note: this is not the case for the
default "none" compression, use "zlib,0" if you want a "no compression" mode
that can be read by older borg). Also the new code is able to read repos and
archives made with older borg versions (for all zlib levels 0..9).
Deprecations:
- --compression N (with N being a number, as in 0.24) is deprecated.
We keep the --compression 0..9 for now to not break scripts, but it is
deprecated and will be removed later, so better fix your scripts now:
--compression 0 (as in 0.24) is the same as --compression zlib,0 (now).
BUT: if you do not want compression, you rather want --compression none
(which is the default).
--compression 1 (in 0.24) is the same as --compression zlib,1 (now)
--compression 9 (in 0.24) is the same as --compression zlib,9 (now)
New features:
- create --compression none (default, means: do not compress, just pass through
data "as is". this is more efficient than zlib level 0 as used in borg 0.24)
- create --compression lz4 (super-fast, but not very high compression)
- create --compression zlib,N (slower, higher compression, default for N is 6)
- create --compression lzma,N (slowest, highest compression, default N is 6)
- honor the nodump flag (UF_NODUMP) and do not backup such items
- list --short just outputs a simple list of the files/directories in an archive
Bug fixes:
- fixed --chunker-params parameter order confusion / malfunction, fixes #154
- close fds of segments we delete (during compaction)
- close files which fell out the lrucache
- fadvise DONTNEED now is only called for the byte range actually read, not for
the whole file, fixes #158.
- fix issue with negative "all archives" size, fixes #165
- restore_xattrs: ignore if setxattr fails with EACCES, fixes #162
Other changes:
- remove fakeroot requirement for tests, tests run faster without fakeroot
(test setup does not fail any more without fakeroot, so you can run with or
without fakeroot), fixes #151 and #91.
- more tests for archiver
- recover_segment(): don't assume we have an fd for segment
- lrucache refactoring / cleanup, add dispose function, py.test tests
- generalize hashindex code for any key length (less hardcoding)
- lock roster: catch file not found in remove() method and ignore it
- travis CI: use requirements file
- improved docs:
- replace hack for llfuse with proper solution (install libfuse-dev)
- update docs about compression
- update development docs about fakeroot
- internals: add some words about lock files / locking system
- support: mention BountySource and for what it can be used
- theme: use a lighter green
- add pypi, wheel, dist package based install docs
- split install docs into system-specific preparations and generic instructions
Version 0.24.0 (2015-08-09)
---------------------------
Incompatible changes (compared to 0.23):
- borg now always issues --umask NNN option when invoking another borg via ssh
on the repository server. By that, it's making sure it uses the same umask
for remote repos as for local ones. Because of this, you must upgrade both
server and client(s) to 0.24.
- the default umask is 077 now (if you do not specify via --umask) which might
be a different one as you used previously. The default umask avoids that
you accidentally give access permissions for group and/or others to files
created by borg (e.g. the repository).
Deprecations:
- "--encryption passphrase" mode is deprecated, see #85 and #97.
See the new "--encryption repokey" mode for a replacement.
New features:
- borg create --chunker-params ... to configure the chunker, fixes #16
(attic #302, attic #300, and somehow also #41).
This can be used to reduce memory usage caused by chunk management overhead,
so borg does not create a huge chunks index/repo index and eats all your RAM
if you back up lots of data in huge files (like VM disk images).
See docs/misc/create_chunker-params.txt for more information.
- borg info now reports chunk counts in the chunk index.
- borg create --compression 0..9 to select zlib compression level, fixes #66
(attic #295).
- borg init --encryption repokey (to store the encryption key into the repo),
fixes #85
- improve at-end error logging, always log exceptions and set exit_code=1
- LoggedIO: better error checks / exceptions / exception handling
- implement --remote-path to allow non-default-path borg locations, #125
- implement --umask M and use 077 as default umask for better security, #117
- borg check: give a named single archive to it, fixes #139
- cache sync: show progress indication
- cache sync: reimplement the chunk index merging in C
Bug fixes:
- fix segfault that happened for unreadable files (chunker: n needs to be a
signed size_t), #116
- fix the repair mode, #144
- repo delete: add destroy to allowed rpc methods, fixes issue #114
- more compatible repository locking code (based on mkdir), maybe fixes #92
(attic #317, attic #201).
- better Exception msg if no Borg is installed on the remote repo server, #56
- create a RepositoryCache implementation that can cope with >2GiB,
fixes attic #326.
- fix Traceback when running check --repair, attic #232
- clarify help text, fixes #73.
- add help string for --no-files-cache, fixes #140
Other changes:
- improved docs:
- added docs/misc directory for misc. writeups that won't be included
"as is" into the html docs.
- document environment variables and return codes (attic #324, attic #52)
- web site: add related projects, fix web site url, IRC #borgbackup
- Fedora/Fedora-based install instructions added to docs
- Cygwin-based install instructions added to docs
- updated AUTHORS
- add FAQ entries about redundancy / integrity
- clarify that borg extract uses the cwd as extraction target
- update internals doc about chunker params, memory usage and compression
- added docs about development
- add some words about resource usage in general
- document how to backup a raw disk
- add note about how to run borg from virtual env
- add solutions for (ll)fuse installation problems
- document what borg check does, fixes #138
- reorganize borgbackup.github.io sidebar, prev/next at top
- deduplicate and refactor the docs / README.rst
- use borg-tmp as prefix for temporary files / directories
- short prune options without "keep-" are deprecated, do not suggest them
- improved tox configuration
- remove usage of unittest.mock, always use mock from pypi
- use entrypoints instead of scripts, for better use of the wheel format and
modern installs
- add requirements.d/development.txt and modify tox.ini
- use travis-ci for testing based on Linux and (new) OS X
- use coverage.py, pytest-cov and codecov.io for test coverage support
I forgot to list some stuff already implemented in 0.23.0, here they are:
New features:
- efficient archive list from manifest, meaning a big speedup for slow
repo connections and "list ", "delete ", "prune" (attic #242,
attic #167)
- big speedup for chunks cache sync (esp. for slow repo connections), fixes #18
- hashindex: improve error messages
Other changes:
- explicitly specify binary mode to open binary files
- some easy micro optimizations
Version 0.23.0 (2015-06-11)
---------------------------
Incompatible changes (compared to attic, fork related):
- changed sw name and cli command to "borg", updated docs
- package name (and name in urls) uses "borgbackup" to have fewer collisions
- changed repo / cache internal magic strings from ATTIC* to BORG*,
changed cache location to .cache/borg/ - this means that it currently won't
accept attic repos (see issue #21 about improving that)
Bug fixes:
- avoid defect python-msgpack releases, fixes attic #171, fixes attic #185
- fix traceback when trying to do unsupported passphrase change, fixes attic #189
- datetime does not like the year 10.000, fixes attic #139
- fix "info" all archives stats, fixes attic #183
- fix parsing with missing microseconds, fixes attic #282
- fix misleading hint the fuse ImportError handler gave, fixes attic #237
- check unpacked data from RPC for tuple type and correct length, fixes attic #127
- fix Repository._active_txn state when lock upgrade fails
- give specific path to xattr.is_enabled(), disable symlink setattr call that
always fails
- fix test setup for 32bit platforms, partial fix for attic #196
- upgraded versioneer, PEP440 compliance, fixes attic #257
New features:
- less memory usage: add global option --no-cache-files
- check --last N (only check the last N archives)
- check: sort archives in reverse time order
- rename repo::oldname newname (rename repository)
- create -v output more informative
- create --progress (backup progress indicator)
- create --timestamp (utc string or reference file/dir)
- create: if "-" is given as path, read binary from stdin
- extract: if --stdout is given, write all extracted binary data to stdout
- extract --sparse (simple sparse file support)
- extra debug information for 'fread failed'
- delete (deletes whole repo + local cache)
- FUSE: reflect deduplication in allocated blocks
- only allow whitelisted RPC calls in server mode
- normalize source/exclude paths before matching
- use posix_fadvise to not spoil the OS cache, fixes attic #252
- toplevel error handler: show tracebacks for better error analysis
- sigusr1 / sigint handler to print current file infos - attic PR #286
- RPCError: include the exception args we get from remote
Other changes:
- source: misc. cleanups, pep8, style
- docs and faq improvements, fixes, updates
- cleanup crypto.pyx, make it easier to adapt to other AES modes
- do os.fsync like recommended in the python docs
- source: Let chunker optionally work with os-level file descriptor.
- source: Linux: remove duplicate os.fsencode calls
- source: refactor _open_rb code a bit, so it is more consistent / regular
- source: refactor indicator (status) and item processing
- source: use py.test for better testing, flake8 for code style checks
- source: fix tox >=2.0 compatibility (test runner)
- pypi package: add python version classifiers, add FreeBSD to platforms
Attic Changelog
---------------
Here you can see the full list of changes between each Attic release until Borg
forked from Attic:
Version 0.17
~~~~~~~~~~~~
(bugfix release, released on X)
- Fix hashindex ARM memory alignment issue (#309)
- Improve hashindex error messages (#298)
Version 0.16
~~~~~~~~~~~~
(bugfix release, released on May 16, 2015)
- Fix typo preventing the security confirmation prompt from working (#303)
- Improve handling of systems with improperly configured file system encoding (#289)
- Fix "All archives" output for attic info. (#183)
- More user friendly error message when repository key file is not found (#236)
- Fix parsing of iso 8601 timestamps with zero microseconds (#282)
Version 0.15
~~~~~~~~~~~~
(bugfix release, released on Apr 15, 2015)
- xattr: Be less strict about unknown/unsupported platforms (#239)
- Reduce repository listing memory usage (#163).
- Fix BrokenPipeError for remote repositories (#233)
- Fix incorrect behavior with two character directory names (#265, #268)
- Require approval before accessing relocated/moved repository (#271)
- Require approval before accessing previously unknown unencrypted repositories (#271)
- Fix issue with hash index files larger than 2GB.
- Fix Python 3.2 compatibility issue with noatime open() (#164)
- Include missing pyx files in dist files (#168)
Version 0.14
~~~~~~~~~~~~
(feature release, released on Dec 17, 2014)
- Added support for stripping leading path segments (#95)
"attic extract --strip-segments X"
- Add workaround for old Linux systems without acl_extended_file_no_follow (#96)
- Add MacPorts' path to the default openssl search path (#101)
- HashIndex improvements, eliminates unnecessary IO on low memory systems.
- Fix "Number of files" output for attic info. (#124)
- limit create file permissions so files aren't read while restoring
- Fix issue with empty xattr values (#106)
Version 0.13
~~~~~~~~~~~~
(feature release, released on Jun 29, 2014)
- Fix sporadic "Resource temporarily unavailable" when using remote repositories
- Reduce file cache memory usage (#90)
- Faster AES encryption (utilizing AES-NI when available)
- Experimental Linux, OS X and FreeBSD ACL support (#66)
- Added support for backup and restore of BSDFlags (OSX, FreeBSD) (#56)
- Fix bug where xattrs on symlinks were not correctly restored
- Added cachedir support. CACHEDIR.TAG compatible cache directories
can now be excluded using ``--exclude-caches`` (#74)
- Fix crash on extreme mtime timestamps (year 2400+) (#81)
- Fix Python 3.2 specific lockf issue (EDEADLK)
Version 0.12
~~~~~~~~~~~~
(feature release, released on April 7, 2014)
- Python 3.4 support (#62)
- Various documentation improvements a new style
- ``attic mount`` now supports mounting an entire repository not only
individual archives (#59)
- Added option to restrict remote repository access to specific path(s):
``attic serve --restrict-to-path X`` (#51)
- Include "all archives" size information in "--stats" output. (#54)
- Added ``--stats`` option to ``attic delete`` and ``attic prune``
- Fixed bug where ``attic prune`` used UTC instead of the local time zone
when determining which archives to keep.
- Switch to SI units (Power of 1000 instead 1024) when printing file sizes
Version 0.11
~~~~~~~~~~~~
(feature release, released on March 7, 2014)
- New "check" command for repository consistency checking (#24)
- Documentation improvements
- Fix exception during "attic create" with repeated files (#39)
- New "--exclude-from" option for attic create/extract/verify.
- Improved archive metadata deduplication.
- "attic verify" has been deprecated. Use "attic extract --dry-run" instead.
- "attic prune --hourly|daily|..." has been deprecated.
Use "attic prune --keep-hourly|daily|..." instead.
- Ignore xattr errors during "extract" if not supported by the filesystem. (#46)
Version 0.10
~~~~~~~~~~~~
(bugfix release, released on Jan 30, 2014)
- Fix deadlock when extracting 0 sized files from remote repositories
- "--exclude" wildcard patterns are now properly applied to the full path
not just the file name part (#5).
- Make source code endianness agnostic (#1)
Version 0.9
~~~~~~~~~~~
(feature release, released on Jan 23, 2014)
- Remote repository speed and reliability improvements.
- Fix sorting of segment names to ignore NFS left over files. (#17)
- Fix incorrect display of time (#13)
- Improved error handling / reporting. (#12)
- Use fcntl() instead of flock() when locking repository/cache. (#15)
- Let ssh figure out port/user if not specified so we don't override .ssh/config (#9)
- Improved libcrypto path detection (#23).
Version 0.8.1
~~~~~~~~~~~~~
(bugfix release, released on Oct 4, 2013)
- Fix segmentation fault issue.
Version 0.8
~~~~~~~~~~~
(feature release, released on Oct 3, 2013)
- Fix xattr issue when backing up sshfs filesystems (#4)
- Fix issue with excessive index file size (#6)
- Support access of read only repositories.
- New syntax to enable repository encryption:
attic init --encryption="none|passphrase|keyfile".
- Detect and abort if repository is older than the cache.
Version 0.7
~~~~~~~~~~~
(feature release, released on Aug 5, 2013)
- Ported to FreeBSD
- Improved documentation
- Experimental: Archives mountable as FUSE filesystems.
- The "user." prefix is no longer stripped from xattrs on Linux
Version 0.6.1
~~~~~~~~~~~~~
(bugfix release, released on July 19, 2013)
- Fixed an issue where mtime was not always correctly restored.
Version 0.6
~~~~~~~~~~~
First public release on July 9, 2013
borgbackup-1.1.15/docs/index.rst 0000644 0001750 0001750 00000000536 13771325506 016502 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
.. highlight:: none
Borg Documentation
==================
.. include:: ../README.rst
.. when you add an element here, do not forget to add it to book.rst
.. toctree::
:maxdepth: 2
installation
quickstart
usage
deployment
faq
support
resources
changes
internals
development
authors
borgbackup-1.1.15/docs/resources.rst 0000644 0001750 0001750 00000003053 13771325506 017402 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
.. _resources:
Resources
=========
This is a collection of additional resources that are somehow related to
borgbackup.
Videos, Talks, Presentations
----------------------------
Some of them refer to attic, but you can do the same stuff (and more) with borgbackup.
- `BorgBackup Installation and Basic Usage `_ (english screencast)
- `TW's slides for borgbackup talks / lightning talks `_ (just grab the latest ones)
- `Attic / Borg Backup talk from GPN 2015 (media.ccc.de) `_
- `Attic / Borg Backup talk from GPN 2015 (youtube) `_
- `Attic talk from Easterhegg 2015 (media.ccc.de) `_
- `Attic talk from Easterhegg 2015 (youtube) `_
- `Attic Backup: Mount your encrypted backups over ssh (youtube) `_
- `Evolution of Borg (youtube) `_
.. _software:
Software
--------
- `BorgWeb - a very simple web UI for BorgBackup `_
- some other stuff found at the `BorgBackup Github organisation `_
- `borgmatic `_ - simple wrapper script for BorgBackup that creates and prunes backups
borgbackup-1.1.15/docs/book.rst 0000644 0001750 0001750 00000000637 13771325506 016327 0 ustar user user 0000000 0000000 :orphan:
.. include:: global.rst.inc
Borg documentation
==================
.. when you add an element here, do not forget to add it to index.rst
.. Note: Some things are in appendices (see latex_appendices in conf.py)
.. toctree::
:maxdepth: 2
introduction
installation
quickstart
usage
deployment
faq
support
resources
changes
internals
development
authors
borgbackup-1.1.15/docs/usage.rst 0000644 0001750 0001750 00000003014 13771325506 016471 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
.. highlight:: none
.. _detailed_usage:
Usage
=====
.. raw:: html
Redirecting...
.. toctree::
usage/general
usage/init
usage/create
usage/extract
usage/check
usage/rename
usage/list
usage/diff
usage/delete
usage/prune
usage/info
usage/mount
usage/key
usage/upgrade
usage/recreate
usage/tar
usage/serve
usage/config
usage/lock
usage/benchmark
usage/help
usage/debug
usage/notes
borgbackup-1.1.15/docs/3rd_party/ 0000755 0001750 0001750 00000000000 13771325773 016552 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/3rd_party/blake2/ 0000755 0001750 0001750 00000000000 13771325773 017712 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/3rd_party/blake2/COPYING 0000644 0001750 0001750 00000015611 13771325506 020743 0 ustar user user 0000000 0000000 Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
borgbackup-1.1.15/docs/3rd_party/blake2/README.md 0000644 0001750 0001750 00000000714 13771325506 021165 0 ustar user user 0000000 0000000 # BLAKE2
This is the reference source code package of BLAKE2.
All code is triple-licensed under the [CC0](http://creativecommons.org/publicdomain/zero/1.0),
the [OpenSSL Licence](https://www.openssl.org/source/license.html),
or the [Apache Public License 2.0](https://www.apache.org/licenses/LICENSE-2.0),
at your choosing.
More: [https://blake2.net](https://blake2.net). [GitHub repository](https://github.com/BLAKE2/BLAKE2).
Contact: contact@blake2.net
borgbackup-1.1.15/docs/3rd_party/README 0000644 0001750 0001750 00000000327 13771325506 017426 0 ustar user user 0000000 0000000 Here we store 3rd party documentation, licenses, etc.
Please note that all files inside the "borg" package directory (except the
stuff excluded in setup.py) will be INSTALLED, so don't keep docs or licenses
there.
borgbackup-1.1.15/docs/3rd_party/zstd/ 0000755 0001750 0001750 00000000000 13771325773 017536 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/3rd_party/zstd/LICENSE 0000644 0001750 0001750 00000002772 13771325506 020545 0 ustar user user 0000000 0000000 BSD License
For Zstandard software
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
borgbackup-1.1.15/docs/3rd_party/lz4/ 0000755 0001750 0001750 00000000000 13771325773 017263 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/3rd_party/lz4/LICENSE 0000644 0001750 0001750 00000002437 13771325506 020270 0 ustar user user 0000000 0000000 LZ4 Library
Copyright (c) 2011-2016, Yann Collet
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
borgbackup-1.1.15/docs/3rd_party/msgpack/ 0000755 0001750 0001750 00000000000 13771325773 020177 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/3rd_party/msgpack/COPYING 0000644 0001750 0001750 00000001146 13771325506 021226 0 ustar user user 0000000 0000000 Copyright (C) 2008-2011 INADA Naoki
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
borgbackup-1.1.15/docs/authors.rst 0000644 0001750 0001750 00000000213 13771325506 017050 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
Authors
=======
.. include:: ../AUTHORS
License
=======
.. _license:
.. include:: ../LICENSE
:literal:
borgbackup-1.1.15/docs/deployment.rst 0000644 0001750 0001750 00000000511 13771325506 017544 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
.. highlight:: none
Deployment
==========
This chapter details deployment strategies for the following scenarios.
.. toctree::
:titlesonly:
deployment/central-backup-server
deployment/hosting-repositories
deployment/automated-local
deployment/image-backup
deployment/pull-backup
borgbackup-1.1.15/docs/conf.py 0000644 0001750 0001750 00000020235 13771325506 016136 0 ustar user user 0000000 0000000 # -*- coding: utf-8 -*-
#
# documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 10 18:18:25 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import sys, os
sys.path.insert(0, os.path.abspath('../src'))
from borg import __version__ as sw_version
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Borg - Deduplicating Archiver'
copyright = u'2010-2014 Jonas Borgström, 2015-2020 The Borg Collective (see AUTHORS file)'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
split_char = '+' if '+' in sw_version else '-'
version = sw_version.split(split_char)[0]
# The full version, including alpha/beta/rc tags.
release = version
suppress_warnings = ['image.nonlocal_uri']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%Y-%m-%d'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# The Borg docs contain no or very little Python docs.
# Thus, the primary domain is rst.
primary_domain = 'rst'
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import guzzle_sphinx_theme
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
def set_rst_settings(app):
app.env.settings.update({
'field_name_limit': 0,
'option_limit': 0,
})
def setup(app):
app.add_stylesheet('css/borg.css')
app.connect('builder-inited', set_rst_settings)
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'project_nav_name': 'Borg %s' % version,
}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = ['_themes']
# The name for this set of Sphinx documents. If None, it defaults to
# " v documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '_static/logo.svg'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = '_static/favicon.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['borg_theme']
html_extra_path = ['../src/borg/paperkey.html']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%Y-%m-%d'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'searchbox.html', 'globaltoc.html'],
}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
html_use_index = False
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = False
# If true, an OpenSearch description file will be output, and all pages will
# contain a tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'borgdoc'
# -- Options for LaTeX output --------------------------------------------------
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('book', 'Borg.tex', 'Borg Documentation',
'The Borg Collective', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = '_static/logo.pdf'
latex_elements = {
'papersize': 'a4paper',
'pointsize': '10pt',
'figure_align': 'H',
}
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
latex_show_urls = 'footnote'
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
latex_appendices = [
'support',
'resources',
'changes',
'authors',
]
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('usage', 'borg',
'BorgBackup is a deduplicating backup program with optional compression and authenticated encryption.',
['The Borg Collective (see AUTHORS file)'],
1),
]
extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
]
extlinks = {
'issue': ('https://github.com/borgbackup/borg/issues/%s', '#'),
'targz_url': ('https://pypi.python.org/packages/source/b/borgbackup/%%s-%s.tar.gz' % version, None),
}
borgbackup-1.1.15/docs/quickstart.rst 0000644 0001750 0001750 00000052511 13771325506 017565 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
.. highlight:: bash
.. _quickstart:
Quick Start
===========
This chapter will get you started with |project_name| and covers
various use cases.
A step by step example
----------------------
.. include:: quickstart_example.rst.inc
Archives and repositories
-------------------------
A *Borg archive* is the result of a single backup (``borg create``). An archive
stores a snapshot of the data of the files "inside" it. One can later extract or
mount an archive to restore from a backup.
*Repositories* are filesystem directories acting as self-contained stores of archives.
Repositories can be accessed locally via path or remotely via ssh. Under the hood,
repositories contain data blocks and a manifest tracking which blocks are in each
archive. If some data hasn't changed from one backup to another, Borg can simply
reference an already uploaded data chunk (deduplication).
Important note about free space
-------------------------------
Before you start creating backups, please make sure that there is *always*
a good amount of free space on the filesystem that has your backup repository
(and also on ~/.cache). A few GB should suffice for most hard-drive sized
repositories. See also :ref:`cache-memory-usage`.
Borg doesn't use space reserved for root on repository disks (even when run as root),
on file systems which do not support this mechanism (e.g. XFS) we recommend to reserve
some space in Borg itself just to be safe by adjusting the ``additional_free_space``
setting (a good starting point is ``2G``)::
borg config /path/to/repo additional_free_space 2G
If |project_name| runs out of disk space, it tries to free as much space as it
can while aborting the current operation safely, which allows to free more space
by deleting/pruning archives. This mechanism is not bullet-proof in some
circumstances [1]_.
If you *really* run out of disk space, it can be hard or impossible to free space,
because |project_name| needs free space to operate - even to delete backup
archives.
You can use some monitoring process or just include the free space information
in your backup log files (you check them regularly anyway, right?).
Also helpful:
- create a big file as a "space reserve", that you can delete to free space
- if you use LVM: use a LV + a filesystem that you can resize later and have
some unallocated PEs you can add to the LV.
- consider using quotas
- use `prune` regularly
.. [1] This failsafe can fail in these circumstances:
- The underlying file system doesn't support statvfs(2), or returns incorrect
data, or the repository doesn't reside on a single file system
- Other tasks fill the disk simultaneously
- Hard quotas (which may not be reflected in statvfs(2))
Important note about permissions
--------------------------------
Using root likely will be required if you want to backup files of other users
or the operating system. If you only back up your own files, you neither need
nor want to use root.
Avoid to create a mixup of users and permissions in your repository (or cache).
This can easily happen if you run borg using different user accounts (e.g. your
non-privileged user and root) while accessing the same repo.
Of course, a non-root user will have no permission to work with the files
created by root (or another user) and borg operations will just fail with
`Permission denied`.
The easy way to avoid this is to always access the repo as the same user:
For a local repository just always invoke borg as same user.
For a remote repository: always use e.g. borg@remote_host. You can use this
from different local users, the remote user accessing the repo will always be
borg.
If you need to access a local repository from different users, you can use the
same method by using ssh to borg@localhost.
Important note about files changing during the backup process
-------------------------------------------------------------
Borg does not do anything about the internal consistency of the data
it backs up. It just reads and backs up each file in whatever state
that file is when Borg gets to it. On an active system, this can lead
to two kinds of inconsistency:
- By the time Borg backs up a file, it might have changed since the backup process was initiated
- A file could change while Borg is backing it up, making the file internally inconsistent
If you have a set of files and want to ensure that they are backed up
in a specific or consistent state, you must take steps to prevent
changes to those files during the backup process. There are a few
common techniques to achieve this.
- Avoid running any programs that might change the files.
- Snapshot files, filesystems, container storage volumes, or logical volumes. LVM or ZFS might be useful here.
- Dump databases or stop the database servers.
- Shut down virtual machines before backing up their images.
- Shut down containers before backing up their storage volumes.
For some systems Borg might work well enough without these
precautions. If you are simply backing up the files on a system that
isn't very active (e.g. in a typical home directory), Borg usually
works well enough without further care for consistency. Log files and
caches might not be in a perfect state, but this is rarely a problem.
For databases, virtual machines, and containers, there are specific
techniques for backing them up that do not simply use Borg to backup
the underlying filesystem. For databases, check your database
documentation for techniques that will save the database state between
transactions. For virtual machines, consider running the backup on
the VM itself or mounting the filesystem while the VM is shut down.
For Docker containers, perhaps docker's "save" command can help.
Automating backups
------------------
The following example script is meant to be run daily by the ``root`` user on
different local machines. It backs up a machine's important files (but not the
complete operating system) to a repository ``~/backup/main`` on a remote server.
Some files which aren't necessarily needed in this backup are excluded. See
:ref:`borg_patterns` on how to add more exclude options.
After the backup this script also uses the :ref:`borg_prune` subcommand to keep
only a certain number of old archives and deletes the others in order to preserve
disk space.
Before running, make sure that the repository is initialized as documented in
:ref:`remote_repos` and that the script has the correct permissions to be executable
by the root user, but not executable or readable by anyone else, i.e. root:root 0700.
You can use this script as a starting point and modify it where it's necessary to fit
your setup.
Do not forget to test your created backups to make sure everything you need is being
backed up and that the ``prune`` command is keeping and deleting the correct backups.
.. note::
Please see the :ref:`software` section for related tooling for automating
backups.
::
#!/bin/sh
# Setting this, so the repo does not need to be given on the commandline:
export BORG_REPO=ssh://username@example.com:2022/~/backup/main
# See the section "Passphrase notes" for more infos.
export BORG_PASSPHRASE='XYZl0ngandsecurepa_55_phrasea&&123'
# some helpers and error handling:
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
info "Starting backup"
# Backup the most important directories into an archive named after
# the machine this script is currently running on:
borg create \
--verbose \
--filter AME \
--list \
--stats \
--show-rc \
--compression lz4 \
--exclude-caches \
--exclude '/home/*/.cache/*' \
--exclude '/var/cache/*' \
--exclude '/var/tmp/*' \
\
::'{hostname}-{now}' \
/etc \
/home \
/root \
/var \
backup_exit=$?
info "Pruning repository"
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
# archives of THIS machine. The '{hostname}-' prefix is very important to
# limit prune's operation to this machine's archives and not apply to
# other machines' archives also:
borg prune \
--list \
--prefix '{hostname}-' \
--show-rc \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 6 \
prune_exit=$?
# use highest exit code as global exit code
global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))
if [ ${global_exit} -eq 0 ]; then
info "Backup and Prune finished successfully"
elif [ ${global_exit} -eq 1 ]; then
info "Backup and/or Prune finished with warnings"
else
info "Backup and/or Prune finished with errors"
fi
exit ${global_exit}
Pitfalls with shell variables and environment variables
-------------------------------------------------------
This applies to all environment variables you want borg to see, not just
``BORG_PASSPHRASE``. The short explanation is: always ``export`` your variable,
and use single quotes if you're unsure of the details of your shell's expansion
behavior. E.g.::
export BORG_PASSPHRASE='complicated & long'
This is because ``export`` exposes variables to subprocesses, which borg may be
one of. More on ``export`` can be found in the "ENVIRONMENT" section of the
bash(1) man page.
Beware of how ``sudo`` interacts with environment variables. For example, you
may be surprised that the following ``export`` has no effect on your command::
export BORG_PASSPHRASE='complicated & long'
sudo ./yourborgwrapper.sh # still prompts for password
For more information, refer to the sudo(8) man page and ``env_keep`` in
the sudoers(5) man page.
.. Tip::
To debug what your borg process is actually seeing, find its PID
(``ps aux|grep borg``) and then look into ``/proc//environ``.
.. passphrase_notes:
Passphrase notes
----------------
If you use encryption (or authentication), Borg will interactively ask you
for a passphrase to encrypt/decrypt the keyfile / repokey.
A passphrase should be a single line of text, a trailing linefeed will be
stripped.
For your own safety, you maybe want to avoid empty passphrases as well
extremely long passphrase (much more than 256 bits of entropy).
Also avoid passphrases containing non-ASCII characters.
Borg is technically able to process all unicode text, but you might get into
trouble reproducing the same encoded utf-8 bytes or with keyboard layouts,
so better just avoid non-ASCII stuff.
If you want to automate, you can alternatively supply the passphrase
directly or indirectly using some environment variables.
You can directly give a passphrase::
# use this passphrase (use safe permissions on the script!):
export BORG_PASSPHRASE='my super secret passphrase'
Or ask an external program to supply the passphrase::
# use the "pass" password manager to get the passphrase:
export BORG_PASSCOMMAND='pass show backup'
# use GPG to get the passphrase contained in a gpg-encrypted file:
export BORG_PASSCOMMAND='gpg --decrypt borg-passphrase.gpg'
Or read the passphrase from an open file descriptor::
export BORG_PASSPHRASE_FD=42
Using hardware crypto devices (like Nitrokey, Yubikey and others) is not
directly supported by borg, but you can use these indirectly.
E.g. if your crypto device supports GPG and borg calls ``gpg`` via
``BORG_PASSCOMMAND``, it should just work.
.. backup_compression:
Backup compression
------------------
The default is lz4 (very fast, but low compression ratio), but other methods are
supported for different situations.
You can use zstd for a wide range from high speed (and relatively low
compression) using N=1 to high compression (and lower speed) using N=22.
zstd is a modern compression algorithm and might be preferable over zlib and
lzma, except if you need compatibility to older borg versions (< 1.1.4) that
did not yet offer zstd.::
$ borg create --compression zstd,N /path/to/repo::arch ~
Other options are:
If you have a fast repo storage and you want minimum CPU usage, no compression::
$ borg create --compression none /path/to/repo::arch ~
If you have a less fast repo storage and you want a bit more compression (N=0..9,
0 means no compression, 9 means high compression):
::
$ borg create --compression zlib,N /path/to/repo::arch ~
If you have a very slow repo storage and you want high compression (N=0..9, 0 means
low compression, 9 means high compression):
::
$ borg create --compression lzma,N /path/to/repo::arch ~
You'll need to experiment a bit to find the best compression for your use case.
Keep an eye on CPU load and throughput.
.. _encrypted_repos:
Repository encryption
---------------------
You can choose the repository encryption mode at repository creation time::
$ borg init --encryption=MODE PATH
For a list of available encryption MODEs and their descriptions, please refer
to :ref:`borg_init`.
If you use encryption, all data is encrypted on the client before being written
to the repository.
This means that an attacker who manages to compromise the host containing an
encrypted repository will not be able to access any of the data, even while the
backup is being made.
Key material is stored in encrypted form and can be only decrypted by providing
the correct passphrase.
For automated backups the passphrase can be specified using the
`BORG_PASSPHRASE` environment variable.
.. note:: Be careful about how you set that environment, see
:ref:`this note about password environments `
for more information.
.. warning:: The repository data is totally inaccessible without the key
and the key passphrase.
Make a backup copy of the key file (``keyfile`` mode) or repo config
file (``repokey`` mode) and keep it at a safe place, so you still have
the key in case it gets corrupted or lost. Also keep your passphrase
at a safe place.
You can make backups using :ref:`borg_key_export` subcommand.
If you want to print a backup of your key to paper use the ``--paper``
option of this command and print the result, or this print `template`_
if you need a version with QR-Code.
A backup inside of the backup that is encrypted with that key/passphrase
won't help you with that, of course.
.. _template: paperkey.html
.. _remote_repos:
Remote repositories
-------------------
|project_name| can initialize and access repositories on remote hosts if the
host is accessible using SSH. This is fastest and easiest when |project_name|
is installed on the remote host, in which case the following syntax is used::
$ borg init user@hostname:/path/to/repo
Note: please see the usage chapter for a full documentation of repo URLs.
Remote operations over SSH can be automated with SSH keys. You can restrict the
use of the SSH keypair by prepending a forced command to the SSH public key in
the remote server's `authorized_keys` file. This example will start |project_name|
in server mode and limit it to a specific filesystem path::
command="borg serve --restrict-to-path /path/to/repo",restrict ssh-rsa AAAAB3[...]
If it is not possible to install |project_name| on the remote host,
it is still possible to use the remote host to store a repository by
mounting the remote filesystem, for example, using sshfs::
$ sshfs user@hostname:/path/to /path/to
$ borg init /path/to/repo
$ fusermount -u /path/to
You can also use other remote filesystems in a similar way. Just be careful,
not all filesystems out there are really stable and working good enough to
be acceptable for backup usage.
Restoring a backup
------------------
Please note that we are only describing the most basic commands and options
here - please refer to the command reference to see more.
For restoring, you usually want to work **on the same machine as the same user**
that was also used to create the backups of the wanted files. Doing it like
that avoids quite some issues:
- no confusion relating to paths
- same mapping of user/group names to user/group IDs
- no permission issues
- you likely already have a working borg setup there,
- maybe including a environment variable for the key passphrase (for encrypted repos),
- maybe including a keyfile for the repo (not needed for repokey mode),
- maybe including a ssh key for the repo server (not needed for locally mounted repos),
- maybe including a valid borg cache for that repo (quicker than cache rebuild).
The **user** might be:
- root (if full backups, backups including system stuff or multiple
users' files were made)
- some specific user using sudo to execute borg as root
- some specific user (if backups of that user's files were made)
A borg **backup repository** can be either:
- in a local directory (like e.g. a locally mounted USB disk)
- on a remote backup server machine that is reachable via ssh (client/server)
If the repository is encrypted, you will also need the **key** and the **passphrase**
(which is protecting the key).
The **key** can be located:
- in the repository (**repokey** mode).
Easy, this will usually "just work".
- in the home directory of the user who did the backup (**keyfile** mode).
This may cause a bit more effort:
- if you have just lost that home directory and you first need to restore the
borg key (e.g. from the separate backup you have made of it or from another
user or machine accessing the same repository).
- if you first must find out the correct machine / user / home directory
(where the borg client was run to make the backups).
The **passphrase** for the key has been either:
- entered interactively at backup time
(not practical if backup is automated / unattended).
- acquired via some environment variable driven mechanism in the backup script
(look there for BORG_PASSPHRASE, BORG_PASSCOMMAND, etc. and just do it like
that).
There are **2 ways to restore** files from a borg backup repository:
- **borg mount** - use this if:
- you don't precisely know what files you want to restore
- you don't know which archive contains the files (in the state) you want
- you need to look into files / directories before deciding what you want
- you need a relatively low volume of data restored
- you don't care for restoring stuff that the FUSE mount is not implementing yet
(like special fs flags, ACLs)
- you have a client with good resources (RAM, CPU, temp. disk space)
- you want to rather use some filemanager to restore (copy) files than borg
extract shell commands
- **borg extract** - use this if:
- you precisely know what you want (repo, archive, path)
- you need a high volume of files restored (best speed)
- you want a as-complete-as-it-gets reproduction of file metadata
(like special fs flags, ACLs)
- you have a client with low resources (RAM, CPU, temp. disk space)
Example with **borg mount**:
::
# open a new, separate terminal (this terminal will be blocked until umount)
# now we find out the archive names we have in the repo:
borg list /mnt/backup/borg_repo
# mount one archive from a borg repo:
borg mount /mnt/backup/borg_repo::myserver-system-2019-08-11 /mnt/borg
# alternatively, mount all archives from a borg repo (slower):
borg mount /mnt/backup/borg_repo /mnt/borg
# it may take a while until you will see stuff in /mnt/borg.
# now use another terminal or file browser and look into /mnt/borg.
# when finished, umount to unlock the repo and unblock the terminal:
borg umount /mnt/borg
Example with **borg extract**:
::
# borg extract always extracts into current directory and that directory
# should be empty (borg does not support transforming a non-empty dir to
# the state as present in your backup archive).
mkdir borg_restore
cd borg_restore
# now we find out the archive names we have in the repo:
borg list /mnt/backup/borg_repo
# we could find out the archive contents, esp. the path layout:
borg list /mnt/backup/borg_repo::myserver-system-2019-08-11
# we extract only some specific path (note: no leading / !):
borg extract /mnt/backup/borg_repo::myserver-system-2019-08-11 path/to/extract
# alternatively, we could fully extract the archive:
borg extract /mnt/backup/borg_repo::myserver-system-2019-08-11
# now move the files to the correct place...
Difference when using a **remote borg backup server**:
It is basically all the same as with the local repository, but you need to
refer to the repo using a ``ssh://`` URL.
In the given example, ``borg`` is the user name used to log into the machine
``backup.example.org`` which runs ssh on port ``2222`` and has the borg repo
in ``/path/to/repo``.
Instead of giving a FQDN or a hostname, you can also give an IP address.
As usual, you either need a password to log in or the backup server might
have authentication set up via ssh ``authorized_keys`` (which is likely the
case if unattended, automated backups were done).
::
borg mount ssh://borg@backup.example.org:2222/path/to/repo /mnt/borg
# or
borg extract ssh://borg@backup.example.org:2222/path/to/repo
borgbackup-1.1.15/docs/faq.rst 0000644 0001750 0001750 00000145150 13771325506 016144 0 ustar user user 0000000 0000000 .. include:: global.rst.inc
.. highlight:: none
.. _faq:
Frequently asked questions
==========================
Usage & Limitations
###################
What is the difference between a repo on an external hard drive vs. repo on a server?
-------------------------------------------------------------------------------------
If Borg is running in client/server mode, the client uses SSH as a transport to
talk to the remote agent, which is another Borg process (Borg is installed on
the server, too). The Borg server is doing storage-related low-level repo
operations (get, put, commit, check, compact), while the Borg client does the
high-level stuff: deduplication, encryption, compression, dealing with
archives, backups, restores, etc., which reduces the amount of data that goes
over the network.
When Borg is writing to a repo on a locally mounted remote file system, e.g.
SSHFS, the Borg client only can do file system operations and has no agent
running on the remote side, so *every* operation needs to go over the network,
which is slower.
Can I backup from multiple servers into a single repository?
------------------------------------------------------------
Yes, this is *possible* from the technical standpoint, but it is
*not recommended* from the security perspective. |project_name| is
built upon a defined :ref:`attack_model` that cannot provide its
guarantees for multiple clients using the same repository. See
:ref:`borg_security_critique` for a detailed explanation.
Also, in order for the deduplication used by |project_name| to work, it
needs to keep a local cache containing checksums of all file
chunks already stored in the repository. This cache is stored in
``~/.cache/borg/``. If |project_name| detects that a repository has been
modified since the local cache was updated it will need to rebuild
the cache. This rebuild can be quite time consuming.
So, yes it's possible. But it will be most efficient if a single
repository is only modified from one place. Also keep in mind that
|project_name| will keep an exclusive lock on the repository while creating
or deleting archives, which may make *simultaneous* backups fail.
Can I copy or synchronize my repo to another location?
------------------------------------------------------
If you want to have redundant backup repositories (preferably at separate
locations), the recommended way to do that is like this:
- ``borg init repo1``
- ``borg init repo2``
- client machine ---borg create---> repo1
- client machine ---borg create---> repo2
This will create distinct repositories (separate repo ID, separate
keys) and nothing bad happening in repo1 will influence repo2.
Some people decide against above recommendation and create identical
copies of a repo (using some copy / sync / clone tool).
While this might be better than having no redundancy at all, you have
to be very careful about how you do that and what you may / must not
do with the result (if you decide against our recommendation).
What you would get with this is:
- client machine ---borg create---> repo
- repo ---copy/sync---> copy-of-repo
There is no special borg command to do the copying, you could just
use any reliable tool that creates an identical copy (cp, rsync, rclone
might be options).
But think about whether that is really what you want. If something goes
wrong in repo, you will have the same issue in copy-of-repo.
Make sure you do the copy/sync while no backup is running, see
:ref:`borg_with-lock` about how to do that.
Also, you must not run borg against multiple instances of the same repo
(like repo and copy-of-repo) as that would create severe issues:
- Data loss: they have the same repository ID, so the borg client will
think they are identical and e.g. use the same local cache for them
(which is an issue if they happen to be not the same).
See :issue:`4272` for an example.
- Encryption security issues if you would update repo and copy-of-repo
independently, due to AES counter reuse.
There is also a similar encryption security issue for the disaster case:
If you lose repo and the borg client-side config/cache and you restore
the repo from an older copy-of-repo, you also run into AES counter reuse.
Which file types, attributes, etc. are *not* preserved?
-------------------------------------------------------
* UNIX domain sockets (because it does not make sense - they are
meaningless without the running process that created them and the process
needs to recreate them in any case). So, don't panic if your backup
misses a UDS!
* The precise on-disk (or rather: not-on-disk) representation of the holes
in a sparse file.
Archive creation has no special support for sparse files, holes are
backed up as (deduplicated and compressed) runs of zero bytes.
Archive extraction has optional support to extract all-zero chunks as
holes in a sparse file.
* Some filesystem specific attributes, like btrfs NOCOW, see :ref:`platforms`.
* For hardlinked symlinks, the hardlinking can not be archived (and thus,
the hardlinking will not be done at extraction time). The symlinks will
be archived and extracted as non-hardlinked symlinks, see :issue:`2379`.
Are there other known limitations?
----------------------------------
- A single archive can only reference a limited volume of file/dir metadata,
usually corresponding to tens or hundreds of millions of files/dirs.
When trying to go beyond that limit, you will get a fatal IntegrityError
exception telling that the (archive) object is too big.
An easy workaround is to create multiple archives with fewer items each.
See also the :ref:`archive_limitation` and :issue:`1452`.
:ref:`borg_info` shows how large (relative to the maximum size) existing
archives are.
- borg extract only supports restoring into an empty destination. After that,
the destination will exactly have the contents of the extracted archive.
If you extract into a non-empty destination, borg will (for example) not
remove files which are in the destination, but not in the archive.
See :issue:`4598` for a workaround and more details.
.. _checkpoints_parts:
If a backup stops mid-way, does the already-backed-up data stay there?
----------------------------------------------------------------------
Yes, |project_name| supports resuming backups.
During a backup a special checkpoint archive named ``.checkpoint``
is saved every checkpoint interval (the default value for this is 30
minutes) containing all the data backed-up until that point.
This checkpoint archive is a valid archive,
but it is only a partial backup (not all files that you wanted to backup are
contained in it). Having it in the repo until a successful, full backup is
completed is useful because it references all the transmitted chunks up
to the checkpoint. This means that in case of an interruption, you only need to
retransfer the data since the last checkpoint.
If a backup was interrupted, you normally do not need to do anything special,
just invoke ``borg create`` as you always do. If the repository is still locked,
you may need to run ``borg break-lock`` before the next backup. You may use the
same archive name as in previous attempt or a different one (e.g. if you always
include the current datetime), it does not matter.
|project_name| always does full single-pass backups, so it will start again
from the beginning - but it will be much faster, because some of the data was
already stored into the repo (and is still referenced by the checkpoint
archive), so it does not need to get transmitted and stored again.
Once your backup has finished successfully, you can delete all
``.checkpoint`` archives. If you run ``borg prune``, it will
also care for deleting unneeded checkpoints.
Note: the checkpointing mechanism creates hidden, partial files in an archive,
so that checkpoints even work while a big file is being processed.
They are named ``.borg_part_`` and all operations usually ignore
these files, but you can make them considered by giving the option
``--consider-part-files``. You usually only need that option if you are
really desperate (e.g. if you have no completed backup of that file and you'ld
rather get a partial file extracted than nothing). You do **not** want to give
that option under any normal circumstances.
Note that checkpoints inside files are created only since version 1.1, make
sure you have an up-to-date version of borgbackup if you want to continue
instead of retransferring a huge file. In some cases, there is only an outdated
version shipped with your distribution (e.g. Debian). See :ref:`installation`.
How can I backup huge file(s) over a unstable connection?
---------------------------------------------------------
This is not a problem anymore.
For more details, see :ref:`checkpoints_parts`.
How can I switch append-only mode on and off?
-----------------------------------------------------------------------------------------------------------------------------------
You could do that (via borg config REPO append_only 0/1), but using different
ssh keys and different entries in ``authorized_keys`` is much easier and also
maybe has less potential of things going wrong somehow.
My machine goes to sleep causing `Broken pipe`
----------------------------------------------
When backing up your data over the network, your machine should not go to sleep.
On macOS you can use `caffeinate` to avoid that.
How can I restore huge file(s) over an unstable connection?
-----------------------------------------------------------
If you cannot manage to extract the whole big file in one go, you can extract
all the part files and manually concatenate them together.
For more details, see :ref:`checkpoints_parts`.
Can |project_name| add redundancy to the backup data to deal with hardware malfunction?
---------------------------------------------------------------------------------------
No, it can't. While that at first sounds like a good idea to defend against
some defect HDD sectors or SSD flash blocks, dealing with this in a
reliable way needs a lot of low-level storage layout information and
control which we do not have (and also can't get, even if we wanted).
So, if you need that, consider RAID or a filesystem that offers redundant
storage or just make backups to different locations / different hardware.
See also :issue:`225`.
Can |project_name| verify data integrity of a backup archive?
-------------------------------------------------------------
Yes, if you want to detect accidental data damage (like bit rot), use the
``check`` operation. It will notice corruption using CRCs and hashes.
If you want to be able to detect malicious tampering also, use an encrypted
repo. It will then be able to check using CRCs and HMACs.
Can I use Borg on SMR hard drives?
----------------------------------
SMR (shingled magnetic recording) hard drives are very different from
regular hard drives. Applications have to behave in certain ways or
performance will be heavily degraded.
Borg 1.1 ships with default settings suitable for SMR drives,
and has been successfully tested on *Seagate Archive v2* drives
using the ext4 file system.
Some Linux kernel versions between 3.19 and 4.5 had various bugs
handling device-managed SMR drives, leading to IO errors, unresponsive
drives and unreliable operation in general.
For more details, refer to :issue:`2252`.
.. _faq-integrityerror:
I get an IntegrityError or similar - what now?
----------------------------------------------
A single error does not necessarily indicate bad hardware or a Borg
bug. All hardware exhibits a bit error rate (BER). Hard drives are typically
specified as exhibiting fewer than one error every 12 to 120 TB
(one bit error in 10e14 to 10e15 bits). The specification is often called
*unrecoverable read error rate* (URE rate).
Apart from these very rare errors there are two main causes of errors:
(i) Defective hardware: described below.
(ii) Bugs in software (Borg, operating system, libraries):
Ensure software is up to date.
Check whether the issue is caused by any fixed bugs described in :ref:`important_notes`.
.. rubric:: Finding defective hardware
.. note::
Hardware diagnostics are operating system dependent and do not
apply universally. The commands shown apply for popular Unix-like
systems. Refer to your operating system's manual.
Checking hard drives
Find the drive containing the repository and use *findmnt*, *mount* or *lsblk*
to learn the device path (typically */dev/...*) of the drive.
Then, smartmontools can retrieve self-diagnostics of the drive in question::
# smartctl -a /dev/sdSomething
The *Offline_Uncorrectable*, *Current_Pending_Sector* and *Reported_Uncorrect*
attributes indicate data corruption. A high *UDMA_CRC_Error_Count* usually
indicates a bad cable.
I/O errors logged by the system (refer to the system journal or
dmesg) can point to issues as well. I/O errors only affecting the
file system easily go unnoticed, since they are not reported to
applications (e.g. Borg), while these errors can still corrupt data.
Drives can corrupt some sectors in one event, while remaining
reliable otherwise. Conversely, drives can fail completely with no
advance warning. If in doubt, copy all data from the drive in
question to another drive -- just in case it fails completely.
If any of these are suspicious, a self-test is recommended::
# smartctl -t long /dev/sdSomething
Running ``fsck`` if not done already might yield further insights.
Checking memory
Intermittent issues, such as ``borg check`` finding errors
inconsistently between runs, are frequently caused by bad memory.
Run memtest86+ (or an equivalent memory tester) to verify that
the memory subsystem is operating correctly.
Checking processors
Processors rarely cause errors. If they do, they are usually overclocked
or otherwise operated outside their specifications. We do not recommend to
operate hardware outside its specifications for productive use.
Tools to verify correct processor operation include Prime95 (mprime), linpack,
and the `Intel Processor Diagnostic Tool
`_
(applies only to Intel processors).
.. rubric:: Repairing a damaged repository
With any defective hardware found and replaced, the damage done to the repository
needs to be ascertained and fixed.
:ref:`borg_check` provides diagnostics and ``--repair`` options for repositories with
issues. We recommend to first run without ``--repair`` to assess the situation.
If the found issues and proposed repairs seem right, re-run "check" with ``--repair`` enabled.
Why is the time elapsed in the archive stats different from wall clock time?
----------------------------------------------------------------------------
Borg needs to write the time elapsed into the archive metadata before finalizing
the archive, compacting the segments, and committing the repo & cache. This means
when Borg is run with e.g. the ``time`` command, the duration shown in the archive
stats may be shorter than the full time the command runs for.
How do I configure different prune policies for different directories?
----------------------------------------------------------------------
Say you want to prune ``/var/log`` faster than the rest of
``/``. How do we implement that? The answer is to backup to different
archive *names* and then implement different prune policies for
different prefixes. For example, you could have a script that does::
borg create --exclude /var/log $REPOSITORY:main-$(date +%Y-%m-%d) /
borg create $REPOSITORY:logs-$(date +%Y-%m-%d) /var/log
Then you would have two different prune calls with different policies::
borg prune --verbose --list -d 30 --prefix main- "$REPOSITORY"
borg prune --verbose --list -d 7 --prefix logs- "$REPOSITORY"
This will keep 7 days of logs and 30 days of everything else. Borg 1.1
also supports the ``--glob-archives`` parameter.
How do I remove files from an existing backup?
----------------------------------------------
Say you now want to remove old logfiles because you changed your
backup policy as described above. The only way to do this is to use
the :ref:`borg_recreate` command to rewrite all archives with a
different ``--exclude`` pattern. See the examples in the
:ref:`borg_recreate` manpage for more information.
Can I safely change the compression level or algorithm?
--------------------------------------------------------
The compression level and algorithm don't affect deduplication. Chunk ID hashes
are calculated *before* compression. New compression settings
will only be applied to new chunks, not existing chunks. So it's safe
to change them.
Security
########
.. _borg_security_critique:
Isn't BorgBackup's AES-CTR crypto broken?
-----------------------------------------
If a nonce (counter) value is reused, AES-CTR mode crypto is broken.
To exploit the AES counter management issue, an attacker would need to have
access to the borg repository.
By tampering with the repo, the attacker could bring the repo into a state so
that it reports a lower "highest used counter value" than the one that actually
was used. The client would usually notice that, because it rather trusts the
clientside stored "highest used counter value" than trusting the server.
But there are situations, where this is simply not possible:
- If clients A and B used the repo, the client A can only know its own highest
CTR value, but not the one produced by B. That is only known to (B and) the
server (the repo) and thus the client A needs to trust the server about the
value produced by B in that situation. You can't do much about this except
not having multiple clients per repo.
- Even if there is only one client, if client-side information is completely
lost (e.g. due to disk defect), the client also needs to trust the value from
server side. You can avoid this by not continuing to write to the repository
after you have lost clientside borg information.
.. _home_config_borg:
How important is the $HOME/.config/borg directory?
--------------------------------------------------
The Borg config directory has content that you should take care of:
``security`` subdirectory
Each directory here represents one Borg repository by its ID and contains the last known status.
If a repository's status is different from this information at the beginning of BorgBackup
operation, Borg outputs warning messages and asks for confirmation, so make sure you do not lose
or manipulate these files. However, apart from those warnings, a loss of these files can be
recovered.
``keys`` subdirectory
In this directory all your repository keyfiles are stored. You MUST make sure to have an
independent backup of these keyfiles, otherwise you cannot access your backups anymore if you lose
them. You also MUST keep these files secret; everyone who gains access to your repository and has
the corresponding keyfile (and the key passphrase) can extract it.
Make sure that only you have access to the Borg config directory.
.. _cache_security:
Do I need to take security precautions regarding the cache?
-----------------------------------------------------------
The cache contains a lot of metadata information about the files in
your repositories and it is not encrypted.
However, the assumption is that the cache is being stored on the very
same system which also contains the original files which are being
backed up. So someone with access to the cache files would also have
access the the original files anyway.
The Internals section contains more details about :ref:`cache`. If you ever need to move the cache
to a different location, this can be achieved by using the appropriate :ref:`env_vars`.
How can I specify the encryption passphrase programmatically?
-------------------------------------------------------------
There are several ways to specify a passphrase without human intervention:
Setting ``BORG_PASSPHRASE``
The passphrase can be specified using the ``BORG_PASSPHRASE`` enviroment variable.
This is often the simplest option, but can be insecure if the script that sets it
is world-readable.
.. _password_env:
.. note:: Be careful how you set the environment; using the ``env``
command, a ``system()`` call or using inline shell scripts
(e.g. ``BORG_PASSPHRASE=hunter2 borg ...``)
might expose the credentials in the process list directly
and they will be readable to all users on a system. Using
``export`` in a shell script file should be safe, however, as
the environment of a process is `accessible only to that
user
`_.
Using ``BORG_PASSCOMMAND`` with a properly permissioned file
Another option is to create a file with a password in it in your home
directory and use permissions to keep anyone else from reading it. For
example, first create a key::
head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase
chmod 400 ~/.borg-passphrase
Then in an automated script one can put::
export BORG_PASSCOMMAND="cat $HOME/.borg-passphrase"
and Borg will automatically use that passphrase.
Using keyfile-based encryption with a blank passphrase
It is possible to encrypt your repository in ``keyfile`` mode instead of the default
``repokey`` mode and use a blank passphrase for the key file (simply press Enter twice
when ``borg init`` asks for the password). See :ref:`encrypted_repos`
for more details.
Using ``BORG_PASSCOMMAND`` with macOS Keychain
macOS has a native manager for secrets (such as passphrases) which is safer
than just using a file as it is encrypted at rest and unlocked manually
(fortunately, the login keyring automatically unlocks when you login). With
the built-in ``security`` command, you can access it from the command line,
making it useful for ``BORG_PASSCOMMAND``.
First generate a passphrase and use ``security`` to save it to your login
(default) keychain::
security add-generic-password -D secret -U -a $USER -s borg-passphrase -w $(head -c 32 /dev/urandom | base64 -w 0)
In your backup script retrieve it in the ``BORG_PASSCOMMAND``::
export BORG_PASSCOMMAND="security find-generic-password -a $USER -s borg-passphrase -w"
Using ``BORG_PASSCOMMAND`` with GNOME Keyring
GNOME also has a keyring daemon that can be used to store a Borg passphrase.
First ensure ``libsecret-tools``, ``gnome-keyring`` and ``libpam-gnome-keyring``
are installed. If ``libpam-gnome-keyring`` wasn't already installed, ensure it
runs on login::
sudo sh -c "echo session optional pam_gnome_keyring.so auto_start >> /etc/pam.d/login"
sudo sh -c "echo password optional pam_gnome_keyring.so >> /etc/pam.d/passwd"
# you may need to relogin afterwards to activate the login keyring
Then add a secret to the login keyring::
head -c 32 /dev/urandom | base64 -w 0 | secret-tool store borg-repository repo-name --label="Borg Passphrase"
If a dialog box pops up prompting you to pick a password for a new keychain, use your
login password. If there is a checkbox for automatically unlocking on login, check it
to allow backups without any user intervention whatsoever.
Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``::
export BORG_PASSCOMMAND="secret-tool lookup borg-repository repo-name"
.. note:: For this to automatically unlock the keychain it must be run
in the ``dbus`` session of an unlocked terminal; for example, running a backup
script as a ``cron`` job might not work unless you also ``export DISPLAY=:0``
so ``secret-tool`` can pick up your open session. `It gets even more complicated`__
when you are running the tool as a different user (e.g. running a backup as root
with the password stored in the user keyring).
__ https://github.com/borgbackup/borg/pull/2837#discussion_r127641330
Using ``BORG_PASSCOMMAND`` with KWallet
KDE also has a keychain feature in the form of KWallet. The command-line tool
``kwalletcli`` can be used to store and retrieve secrets. Ensure ``kwalletcli``
is installed, generate a passphrase, and store it in your "wallet"::
head -c 32 /dev/urandom | base64 -w 0 | kwalletcli -Pe borg-passphrase -f Passwords
Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``::
export BORG_PASSCOMMAND="kwalletcli -e borg-passphrase -f Passwords"
When backing up to remote encrypted repos, is encryption done locally?
----------------------------------------------------------------------
Yes, file and directory metadata and data is locally encrypted, before
leaving the local machine. We do not mean the transport layer encryption
by that, but the data/metadata itself. Transport layer encryption (e.g.
when ssh is used as a transport) applies additionally.
When backing up to remote servers, do I have to trust the remote server?
------------------------------------------------------------------------
Yes and No.
No, as far as data confidentiality is concerned - if you use encryption,
all your files/dirs data and metadata are stored in their encrypted form
into the repository.
Yes, as an attacker with access to the remote server could delete (or
otherwise make unavailable) all your backups.
How can I protect against a hacked backup client?
-------------------------------------------------
Assume you backup your backup client machine C to the backup server S and
C gets hacked. In a simple push setup, the attacker could then use borg on
C to delete all backups residing on S.
These are your options to protect against that:
- Do not allow to permanently delete data from the repo, see :ref:`append_only_mode`.
- Use a pull-mode setup using ``ssh -R``, see :issue:`900`.
- Mount C's filesystem on another machine and then create a backup of it.
- Do not give C filesystem-level access to S.
See :ref:`hosting_repositories` for a detailed protection guide.
How can I protect against a hacked backup server?
-------------------------------------------------
Just in case you got the impression that pull-mode backups are way more safe
than push-mode, you also need to consider the case that your backup server S
gets hacked. In case S has access to a lot of clients C, that might bring you
into even bigger trouble than a hacked backup client in the previous FAQ entry.
These are your options to protect against that:
- Use the standard push-mode setup (see also previous FAQ entry).
- Mount (the repo part of) S's filesystem on C.
- Do not give S file-system level access to C.
- Have your backup server at a well protected place (maybe not reachable from
the internet), configure it safely, apply security updates, monitor it, ...
How can I protect against theft, sabotage, lightning, fire, ...?
----------------------------------------------------------------
In general: if your only backup medium is nearby the backupped machine and
always connected, you can easily get into trouble: they likely share the same
fate if something goes really wrong.
Thus:
- have multiple backup media
- have media disconnected from network, power, computer
- have media at another place
- have a relatively recent backup on your media
How do I report a security issue with Borg?
-------------------------------------------
Send a private email to the :ref:`security contact `
if you think you have discovered a security issue.
Please disclose security issues responsibly.
Common issues
#############
Why does Borg extract hang after some time?
-------------------------------------------
When I do a ``borg extract``, after a while all activity stops, no cpu usage,
no downloads.
This may happen when the SSH connection is stuck on server side. You can
configure SSH on client side to prevent this by sending keep-alive requests,
for example in ~/.ssh/config:
::
Host borg.example.com
# Client kills connection after 3*30 seconds without server response:
ServerAliveInterval 30
ServerAliveCountMax 3
You can also do the opposite and configure SSH on server side in
/etc/ssh/sshd_config, to make the server send keep-alive requests to the client:
::
# Server kills connection after 3*30 seconds without client response:
ClientAliveInterval 30
ClientAliveCountMax 3
How can I deal with my very unstable SSH connection?
----------------------------------------------------
If you have issues with lost connections during long-running borg commands, you
could try to work around:
- Make partial extracts like ``borg extract REPO PATTERN`` to do multiple
smaller extraction runs that complete before your connection has issues.
- Try using ``borg mount REPO MOUNTPOINT`` and ``rsync -avH`` from
``MOUNTPOINT`` to your desired extraction directory. If the connection breaks
down, just repeat that over and over again until rsync does not find anything
to do any more. Due to the way borg mount works, this might be less efficient
than borg extract for bigger volumes of data.
Why do I get "connection closed by remote" after a while?
---------------------------------------------------------
When doing a backup to a remote server (using a ssh: repo URL), it sometimes
stops after a while (some minutes, hours, ... - not immediately) with
"connection closed by remote" error message. Why?
That's a good question and we are trying to find a good answer in :issue:`636`.
Why am I seeing idle borg serve processes on the repo server?
-------------------------------------------------------------
Maybe the ssh connection between client and server broke down and that was not
yet noticed on the server. Try these settings:
::
# /etc/ssh/sshd_config on borg repo server - kill connection to client
# after ClientAliveCountMax * ClientAliveInterval seconds with no response
ClientAliveInterval 20
ClientAliveCountMax 3
If you have multiple borg create ... ; borg create ... commands in a already
serialized way in a single script, you need to give them ``--lock-wait N`` (with N
being a bit more than the time the server needs to terminate broken down
connections and release the lock).
.. _disable_archive_chunks:
The borg cache eats way too much disk space, what can I do?
-----------------------------------------------------------
This may especially happen if borg needs to rebuild the local "chunks" index -
either because it was removed, or because it was not coherent with the
repository state any more (e.g. because another borg instance changed the
repository).
To optimize this rebuild process, borg caches per-archive information in the
``chunks.archive.d/`` directory. It won't help the first time it happens, but it
will make the subsequent rebuilds faster (because it needs to transfer less data
from the repository). While being faster, the cache needs quite some disk space,
which might be unwanted.
There is a temporary (but maybe long lived) hack to avoid using lots of disk
space for chunks.archive.d (see :issue:`235` for details):
::
# this assumes you are working with the same user as the backup.
cd ~/.cache/borg/$(borg config /path/to/repo id)
rm -rf chunks.archive.d ; touch chunks.archive.d
This deletes all the cached archive chunk indexes and replaces the directory
that kept them with a file, so borg won't be able to store anything "in" there
in future.
This has some pros and cons, though:
- much less disk space needs for ~/.cache/borg.
- chunk cache resyncs will be slower as it will have to transfer chunk usage
metadata for all archives from the repository (which might be slow if your
repo connection is slow) and it will also have to build the hashtables from
that data.
chunk cache resyncs happen e.g. if your repo was written to by another
machine (if you share same backup repo between multiple machines) or if
your local chunks cache was lost somehow.
The long term plan to improve this is called "borgception", see :issue:`474`.
Can I backup my root partition (/) with Borg?
---------------------------------------------
Backing up your entire root partition works just fine, but remember to
exclude directories that make no sense to backup, such as /dev, /proc,
/sys, /tmp and /run, and to use ``--one-file-system`` if you only want to
backup the root partition (and not any mounted devices e.g.).
If it crashes with a UnicodeError, what can I do?
-------------------------------------------------
Check if your encoding is set correctly. For most POSIX-like systems, try::
export LANG=en_US.UTF-8 # or similar, important is correct charset
I can't extract non-ascii filenames by giving them on the commandline!?
-----------------------------------------------------------------------
This might be due to different ways to represent some characters in unicode
or due to other non-ascii encoding issues.
If you run into that, try this:
- avoid the non-ascii characters on the commandline by e.g. extracting
the parent directory (or even everything)
- mount the repo using FUSE and use some file manager
.. _expected_performance:
What's the expected backup performance?
---------------------------------------
A first backup will usually be somehow "slow" because there is a lot of data
to process. Performance here depends on a lot of factors, so it is hard to
give specific numbers.
Subsequent backups are usually very fast if most files are unchanged and only
a few are new or modified. The high performance on unchanged files primarily depends
only on a few factors (like fs recursion + metadata reading performance and the
files cache working as expected) and much less on other factors.
E.g., for this setup:
- server grade machine (4C/8T 2013 Xeon, 64GB RAM, 2x good 7200RPM disks)
- local zfs filesystem (mirrored) containing the backup source data
- repository is remote (does not matter much for unchanged files)
- backup job runs while machine is otherwise idle
The observed performance is that |project_name| can process about
**1 million unchanged files (and a few small changed ones) in 4 minutes!**
If you are seeing much less than that in similar circumstances, read the next
few FAQ entries below.
.. _slow_backup:
Why is backup slow for me?
--------------------------
So, if you feel your |project_name| backup is too slow somehow, you should find out why.
The usual way to approach this is to add ``--list --filter=AME --stats`` to your
``borg create`` call to produce more log output, including a file list (with file status
characters) and also some statistics at the end of the backup.
Then you do the backup and look at the log output:
- stats: Do you really have little changes or are there more changes than you thought?
In the stats you can see the overall volume of changed data, which needed to be
added to the repo. If that is a lot, that can be the reason why it is slow.
- ``A`` status ("added") in the file list:
If you see that often, you have a lot of new files (files that |project_name| did not find
in the files cache). If you think there is something wrong with that (the file was there
already in the previous backup), please read the FAQ entries below.
- ``M`` status ("modified") in the file list:
If you see that often, |project_name| thinks that a lot of your files might be modified
(|project_name| found them in the files cache, but the metadata read from the filesystem did
not match the metadata stored in the files cache).
In such a case, |project_name| will need to process the files' contents completely, which is
much slower than processing unmodified files (|project_name| does not read their contents!).
The metadata values used in this comparison are determined by the ``--files-cache`` option
and could be e.g. size, ctime and inode number (see the ``borg create`` docs for more
details and potential issues).
You can use the ``stat`` command on files to manually look at fs metadata to debug if
there is any unexpected change triggering the ``M`` status.
See also the next few FAQ entries for more details.
.. _a_status_oddity:
I am seeing 'A' (added) status for an unchanged file!?
------------------------------------------------------
The files cache is used to determine whether |project_name| already
"knows" / has backed up a file and if so, to skip the file from
chunking. It does intentionally *not* contain files that have a timestamp
same as the newest timestamp in the created archive.
So, if you see an 'A' status for unchanged file(s), they are likely the files
with the most recent timestamp in that archive.
This is expected: it is to avoid data loss with files that are backed up from
a snapshot and that are immediately changed after the snapshot (but within
timestamp granularity time, so the timestamp would not change). Without the code that
removes these files from the files cache, the change that happened right after
the snapshot would not be contained in the next backup as |project_name| would
think the file is unchanged.
This does not affect deduplication, the file will be chunked, but as the chunks
will often be the same and already stored in the repo (except in the above
mentioned rare condition), it will just re-use them as usual and not store new
data chunks.
If you want to avoid unnecessary chunking, just create or touch a small or
empty file in your backup source file set (so that one has the latest timestamp,
not your 50GB VM disk image) and, if you do snapshots, do the snapshot after
that.
Since only the files cache is used in the display of files status,
those files are reported as being added when, really, chunks are
already used.
By default, ctime (change time) is used for the timestamps to have a rather
safe change detection (see also the --files-cache option).
Furthermore, pathnames recorded in files cache are always absolute, even if you specify
source directories with relative pathname. If relative pathnames are stable, but absolute are
not (for example if you mount a filesystem without stable mount points for each backup or
if you are running the backup from a filesystem snapshot whose name is not stable), borg
will assume that files are different and will report them as 'added', even though no new
chunks will be actually recorded for them. To avoid this, you could bind mount your source
directory in a directory with the stable path.
.. _always_chunking:
It always chunks all my files, even unchanged ones!
---------------------------------------------------
|project_name| maintains a files cache where it remembers the timestamp, size
and inode of files. When |project_name| does a new backup and starts processing
a file, it first looks whether the file has changed (compared to the values
stored in the files cache). If the values are the same, the file is assumed
unchanged and thus its contents won't get chunked (again).
|project_name| can't keep an infinite history of files of course, thus entries
in the files cache have a "maximum time to live" which is set via the
environment variable BORG_FILES_CACHE_TTL (and defaults to 20).
Every time you do a backup (on the same machine, using the same user), the
cache entries' ttl values of files that were not "seen" are incremented by 1
and if they reach BORG_FILES_CACHE_TTL, the entry is removed from the cache.
So, for example, if you do daily backups of 26 different data sets A, B,
C, ..., Z on one machine (using the default TTL), the files from A will be
already forgotten when you repeat the same backups on the next day and it
will be slow because it would chunk all the files each time. If you set
BORG_FILES_CACHE_TTL to at least 26 (or maybe even a small multiple of that),
it would be much faster.
Another possible reason is that files don't always have the same path, for
example if you mount a filesystem without stable mount points for each backup or if you are running the backup from a filesystem snapshot whose name is not stable.
If the directory where you mount a filesystem is different every time,
|project_name| assumes they are different files. This is true even if you backup these files with relative pathnames - borg uses full
pathnames in files cache regardless.
Is there a way to limit bandwidth with |project_name|?
------------------------------------------------------
To limit upload (i.e. :ref:`borg_create`) bandwidth, use the
``--remote-ratelimit`` option.
There is no built-in way to limit *download*
(i.e. :ref:`borg_extract`) bandwidth, but limiting download bandwidth
can be accomplished with pipeviewer_:
Create a wrapper script: /usr/local/bin/pv-wrapper
::
#!/bin/sh
## -q, --quiet do not output any transfer information at all
## -L, --rate-limit RATE limit transfer to RATE bytes per second
RATE=307200
pv -q -L $RATE | "$@"
Add BORG_RSH environment variable to use pipeviewer wrapper script with ssh.
::
export BORG_RSH='/usr/local/bin/pv-wrapper ssh'
Now |project_name| will be bandwidth limited. Nice thing about pv is that you can change rate-limit on the fly:
::
pv -R $(pidof pv) -L 102400
.. _pipeviewer: http://www.ivarch.com/programs/pv.shtml
How can I avoid unwanted base directories getting stored into archives?
-----------------------------------------------------------------------
Possible use cases:
- Another file system is mounted and you want to backup it with original paths.
- You have created a BTRFS snapshot in a ``/.snapshots`` directory for backup.
To achieve this, run ``borg create`` within the mountpoint/snapshot directory:
::
# Example: Some file system mounted in /mnt/rootfs.
cd /mnt/rootfs
borg create /path/to/repo::rootfs_backup .
I am having troubles with some network/FUSE/special filesystem, why?
--------------------------------------------------------------------
|project_name| is doing nothing special in the filesystem, it only uses very
common and compatible operations (even the locking is just "mkdir").
So, if you are encountering issues like slowness, corruption or malfunction
when using a specific filesystem, please try if you can reproduce the issues
with a local (non-network) and proven filesystem (like ext4 on Linux).
If you can't reproduce the issue then, you maybe have found an issue within
the filesystem code you used (not with |project_name|). For this case, it is
recommended that you talk to the developers / support of the network fs and
maybe open an issue in their issue tracker. Do not file an issue in the
|project_name| issue tracker.
If you can reproduce the issue with the proven filesystem, please file an
issue in the |project_name| issue tracker about that.
Why does running 'borg check --repair' warn about data loss?
------------------------------------------------------------
Repair usually works for recovering data in a corrupted archive. However,
it's impossible to predict all modes of corruption. In some very rare
instances, such as malfunctioning storage hardware, additional repo
corruption may occur. If you can't afford to lose the repo, it's strongly
recommended that you perform repair on a copy of the repo.
In other words, the warning is there to emphasize that |project_name|:
- Will perform automated routines that modify your backup repository
- Might not actually fix the problem you are experiencing
- Might, in very rare cases, further corrupt your repository
In the case of malfunctioning hardware, such as a drive or USB hub
corrupting data when read or written, it's best to diagnose and fix the
cause of the initial corruption before attempting to repair the repo. If
the corruption is caused by a one time event such as a power outage,
running `borg check --repair` will fix most problems.
Why isn't there more progress / ETA information displayed?
----------------------------------------------------------
Some borg runs take quite a bit, so it would be nice to see a progress display,
maybe even including a ETA (expected time of "arrival" [here rather "completion"]).
For some functionality, this can be done: if the total amount of work is more or
less known, we can display progress. So check if there is a ``--progress`` option.
But sometimes, the total amount is unknown (e.g. for ``borg create`` we just do
a single pass over the filesystem, so we do not know the total file count or data
volume before reaching the end). Adding another pass just to determine that would
take additional time and could be incorrect, if the filesystem is changing.
Even if the fs does not change and we knew count and size of all files, we still
could not compute the ``borg create`` ETA as we do not know the amount of changed
chunks, how the bandwidth of source and destination or system performance might
fluctuate.
You see, trying to display ETA would be futile. The borg developers prefer to
rather not implement progress / ETA display than doing futile attempts.
See also: https://xkcd.com/612/
Why am I getting 'Operation not permitted' errors when backing up on sshfs?
---------------------------------------------------------------------------
By default, ``sshfs`` is not entirely POSIX-compliant when renaming files due to
a technicality in the SFTP protocol. Fortunately, it also provides a workaround_
to make it behave correctly::
sshfs -o workaround=rename user@host:dir /mnt/dir
.. _workaround: https://unix.stackexchange.com/a/123236
Can I disable checking for free disk space?
-------------------------------------------
In some cases, the free disk space of the target volume is reported incorrectly.
This can happen for CIFS- or FUSE shares. If you are sure that your target volume
will always have enough disk space, you can use the following workaround to disable
checking for free disk space::
borg config -- $REPO_LOCATION additional_free_space -2T
Miscellaneous
#############
Requirements for the borg single-file binary, esp. (g)libc?
-----------------------------------------------------------
We try to build the binary on old, but still supported systems - to keep the
minimum requirement for the (g)libc low. The (g)libc can't be bundled into
the binary as it needs to fit your kernel and OS, but Python and all other
required libraries will be bundled into the binary.
If your system fulfills the minimum (g)libc requirement (see the README that
is released with the binary), there should be no problem. If you are slightly
below the required version, maybe just try. Due to the dynamic loading (or not
loading) of some shared libraries, it might still work depending on what
libraries are actually loaded and used.
In the borg git repository, there is scripts/glibc_check.py that can determine
(based on the symbols' versions they want to link to) whether a set of given
(Linux) binaries works with a given glibc version.
Why was Borg forked from Attic?
-------------------------------
Borg was created in May 2015 in response to the difficulty of getting new
code or larger changes incorporated into Attic and establishing a bigger
developer community / more open development.
More details can be found in `ticket 217
`_ that led to the fork.
Borg intends to be:
* simple:
* as simple as possible, but no simpler
* do the right thing by default, but offer options
* open:
* welcome feature requests
* accept pull requests of good quality and coding style
* give feedback on PRs that can't be accepted "as is"
* discuss openly, don't work in the dark
* changing:
* Borg is not compatible with Attic
* do not break compatibility accidentally, without a good reason
or without warning. allow compatibility breaking for other cases.
* if major version number changes, it may have incompatible changes
Migrating from Attic
####################
What are the differences between Attic and Borg?
------------------------------------------------
Borg is a fork of `Attic`_ and maintained by "`The Borg collective`_".
.. _Attic: https://github.com/jborg/attic
.. _The Borg collective: https://borgbackup.readthedocs.org/en/latest/authors.html
Here's a (incomplete) list of some major changes:
* lots of attic issues fixed (see `issue #5 `_),
including critical data corruption bugs and security issues.
* more open, faster paced development (see `issue #1 `_)
* less chunk management overhead (less memory and disk usage for chunks index)
* faster remote cache resync (useful when backing up multiple machines into same repo)
* compression: no, lz4, zstd, zlib or lzma compression, adjustable compression levels
* repokey replaces problematic passphrase mode (you can't change the passphrase nor the pbkdf2 iteration count in "passphrase" mode)
* simple sparse file support, great for virtual machine disk files
* can read special files (e.g. block devices) or from stdin, write to stdout
* mkdir-based locking is more compatible than attic's posix locking
* uses fadvise to not spoil / blow up the fs cache
* better error messages / exception handling
* better logging, screen output, progress indication
* tested on misc. Linux systems, 32 and 64bit, FreeBSD, OpenBSD, NetBSD, macOS
Please read the :ref:`changelog` (or ``docs/changes.rst`` in the source distribution) for more
information.
Borg is not compatible with original Attic (but there is a one-way conversion).
How do I migrate from Attic to Borg?
------------------------------------
Use :ref:`borg_upgrade`. This is a one-way process that cannot be reversed.
There are some caveats:
- The upgrade can only be performed on local repositories.
It cannot be performed on remote repositories.
- If the repository is in "keyfile" encryption mode, the keyfile must
exist locally or it must be manually moved after performing the upgrade:
1. Get the repository ID with ``borg config /path/to/repo id``.
2. Locate the attic key file at ``~/.attic/keys/``. The correct key for the
repository starts with the line ``ATTIC_KEY ``.
3. Copy the attic key file to ``~/.config/borg/keys/``
4. Change the first line from ``ATTIC_KEY ...`` to ``BORG_KEY ...``.
5. Verify that the repository is now accessible (e.g. ``borg list ``).
- Attic and Borg use different :ref:`"chunker params" `.
This means that data added by Borg won't deduplicate with the existing data
stored by Attic. The effect is lessened if the files cache is used with Borg.
- Repositories in "passphrase" mode *must* be migrated to "repokey" mode using
:ref:`borg_key_migrate-to-repokey`. Borg does not support the "passphrase" mode
any other way.
Why is my backup bigger than with attic?
----------------------------------------
Attic was rather unflexible when it comes to compression, it always
compressed using zlib level 6 (no way to switch compression off or
adjust the level or algorithm).
The default in Borg is lz4, which is fast enough to not use significant CPU time
in most cases, but can only achieve modest compression. It still compresses
easily compressed data fairly well.
Borg also offers zstd, zlib and lzma compression, choose wisely.
Which choice is the best option depends on a number of factors, like
bandwidth to the repository, how well the data compresses, available CPU
power and so on.
borgbackup-1.1.15/docs/introduction.rst 0000644 0001750 0001750 00000000350 13771325506 020106 0 ustar user user 0000000 0000000 Introduction
============
.. this shim is here to fix the structure in the PDF
rendering. without this stub, the elements in the toctree of
index.rst show up a level below the README file included
.. include:: ../README.rst
borgbackup-1.1.15/docs/borg_theme/ 0000755 0001750 0001750 00000000000 13771325773 016756 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/borg_theme/css/ 0000755 0001750 0001750 00000000000 13771325773 017546 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/borg_theme/css/borg.css 0000644 0001750 0001750 00000010464 13771325506 021210 0 ustar user user 0000000 0000000 @import url("theme.css");
/* The Return of the Borg.
*
* Have a bit green and grey and darkness (and if only in the upper left corner).
*/
.wy-side-nav-search {
background-color: #000000 !important;
}
.wy-side-nav-search input[type="text"] {
border-color: #000000;
}
.wy-side-nav-search > a {
color: rgba(255, 255, 255, 0.5);
}
.wy-side-nav-search > div.version {
color: rgba(255, 255, 255, 0.5);
}
dt code {
font-weight: normal;
}
#internals .toctree-wrapper > ul {
column-count: 3;
-webkit-column-count: 3;
}
#internals .toctree-wrapper > ul > li {
display: inline-block;
font-weight: bold;
}
#internals .toctree-wrapper > ul > li > ul {
font-weight: normal;
}
/* bootstrap has a .container class which clashes with docutils' container class. */
.docutils.container {
width: auto;
margin: 0;
padding: 0;
}
/* the default (38px) produces a jumpy baseline in Firefox on Linux. */
h1 {
font-size: 36px;
}
.text-logo {
background-color: #000200;
color: #00dd00;
}
.text-logo:hover,
.text-logo:active,
.text-logo:focus {
color: #5afe57;
}
/* by default the top and bottom margins are unequal which looks a bit unbalanced. */
.sidebar-block {
padding: 0;
margin: 14px 0 24px 0;
}
#borg-documentation h1 + p .external img {
width: 100%;
}
.container.experimental,
#debugging-facilities,
#borg-recreate {
/* don't change text dimensions */
margin: 0 -30px; /* padding below + border width */
padding: 0 10px; /* 10 px visual margin between edge of text and the border */
/* fallback for browsers that don't have repeating-linear-gradient: thick, red lines */
border-left: 20px solid red;
border-right: 20px solid red;
/* fancy red stripes */
border-image: repeating-linear-gradient(
-45deg,rgba(255,0,0,0.1) 0,rgba(255,0,0,0.75) 10px,rgba(0,0,0,0) 10px,rgba(0,0,0,0) 20px,rgba(255,0,0,0.75) 20px) 0 20 repeat;
}
.topic {
margin: 0 1em;
padding: 0 1em;
/* #4e4a4a = background of the ToC sidebar */
border-left: 2px solid #4e4a4a;;
border-right: 2px solid #4e4a4a;;
}
table.docutils:not(.footnote) td,
table.docutils:not(.footnote) th {
padding: .2em;
}
table.docutils:not(.footnote) {
border-collapse: collapse;
border: none;
}
table.docutils:not(.footnote) td,
table.docutils:not(.footnote) th {
border: 1px solid #ddd;
}
table.docutils:not(.footnote) tr:first-child th,
table.docutils:not(.footnote) tr:first-child td {
border-top: 0;
}
table.docutils:not(.footnote) tr:last-child td {
border-bottom: 0;
}
table.docutils:not(.footnote) tr td:first-child,
table.docutils:not(.footnote) tr th:first-child {
border-left: 0;
}
table.docutils:not(.footnote) tr td:last-child,
table.docutils:not(.footnote) tr th:last-child,
table.docutils.borg-options-table tr td {
border-right: 0;
}
table.docutils.option-list tr td,
table.docutils.borg-options-table tr td {
border-left: 0;
border-right: 0;
}
table.docutils.borg-options-table tr td:first-child:not([colspan="3"]) {
border-top: 0;
border-bottom: 0;
}
.borg-options-table td[colspan="3"] p {
margin: 0;
}
.borg-options-table {
width: 100%;
}
kbd, /* used in usage pages for options */
code,
.rst-content tt.literal,
.rst-content tt.literal,
.rst-content code.literal,
.rst-content tt,
.rst-content code,
p .literal,
p .literal span {
border: none;
padding: 0;
color: black; /* slight contrast with #404040 of regular text */
background: none;
}
kbd {
box-shadow: none;
line-height: 23px;
word-wrap: normal;
font-size: 15px;
font-family: Consolas, monospace;
}
.borg-options-table tr td:nth-child(2) .pre {
white-space: nowrap;
}
.borg-options-table tr td:first-child {
width: 2em;
}
cite {
white-space: nowrap;
color: black; /* slight contrast with #404040 of regular text */
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter",
"DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
font-style: normal;
text-decoration: underline;
}
.borg-common-opt-ref {
font-weight: bold;
}
.sidebar-toc ul li.toctree-l2 a,
.sidebar-toc ul li.toctree-l3 a {
padding-right: 25px;
}
#common-options .option {
white-space: nowrap;
}
borgbackup-1.1.15/docs/_static/ 0000755 0001750 0001750 00000000000 13771325773 016271 5 ustar user user 0000000 0000000 borgbackup-1.1.15/docs/_static/logo_font.txt 0000644 0001750 0001750 00000000157 13771325506 021015 0 ustar user user 0000000 0000000 Black Ops One
James Grieshaber
SIL Open Font License, 1.1
https://www.google.com/fonts/specimen/Black+Ops+One
borgbackup-1.1.15/docs/_static/favicon.ico 0000644 0001750 0001750 00000114016 13771325506 020407 0 ustar user user 0000000 0000000 RR m 6 RR Fm RR " &u