Compare commits

...

3168 commits

Author SHA1 Message Date
TW
3f6282c3bc
Merge pull request #9366 from mr-raj12/fix-benchmark-compact-warnings
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
benchmark crud: suppress compact warnings during benchmark runs, fixes #9365
2026-02-17 20:55:16 +01:00
Mrityunjay Raj
c7261ae5aa benchmark crud: suppress compact warnings during benchmark runs, fixes #9365 2026-02-18 00:45:36 +05:30
Mrityunjay Raj
1c0bf36275
remove handwritten bash/zsh shell completions, fixes #9178
Remove the handwritten bash and zsh shell completion scripts now that
auto-generated completions via borg completion bash/zsh (powered by
shtab, #9172) are tested and working. Fish completions are kept as
shtab does not yet support fish.

Replace string-matching tests with focused behavior tests: script size
sanity, shell syntax validation (bash -n / zsh -n), and tests that
invoke the custom preamble functions in bash (sortby key dedup,
filescachemode mutual exclusivity, archive name and aid: prefix
completion against a real repository).
2026-02-17 19:33:54 +01:00
TW
a4bfc185df
Merge pull request #9335 from mr-raj12/enhance-pr-template
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
github: enhance pull request template, fixes #9334
2026-02-17 15:25:02 +01:00
TW
4e3352ed58
Merge pull request #9327 from ThomasWaldmann/fixes-master
Misc. fixes (master)
2026-02-17 15:16:02 +01:00
TW
60928f380a
Merge pull request #9333 from ThomasWaldmann/pw-env-var-ambiguity-master
passphrase: fail if multiple passphrase env vars are set, fixes #8834
2026-02-17 15:13:41 +01:00
TW
786a27519f
Merge pull request #9354 from mr-raj12/benchmark-crud-json-lines
benchmark crud: add --json-lines output option, fixes #9165
2026-02-17 10:13:43 +01:00
Mrityunjay Raj
1150b8d8f7 benchmark crud: add --json-lines output option, fixes #9165
Add --json-lines flag to 'borg benchmark crud' that outputs
each measurement as a JSON object (one per line) for easy
machine parsing. Also improve test coverage to validate both
human-readable and JSON-lines output formats.
2026-02-17 14:08:10 +05:30
TW
6e1fd9e0ec
Merge pull request #9360 from borgbackup/dependabot/pip/requirements.d/pip-dependencies-a5918913ce
build(deps-dev): bump the pip-dependencies group across 1 directory with 13 updates
2026-02-17 08:43:52 +01:00
dependabot[bot]
f3c5d5bb02
build(deps-dev): bump the pip-dependencies group across 1 directory with 13 updates
Bumps the pip-dependencies group with 13 updates in the /requirements.d directory:

| Package | From | To |
| --- | --- | --- |
| [setuptools](https://github.com/pypa/setuptools) | `78.1.1` | `80.9.0` |
| [setuptools-scm](https://github.com/pypa/setuptools-scm) | `8.3.1` | `9.2.2` |
| [pip](https://github.com/pypa/pip) | `26.0` | `26.0.1` |
| [wheel](https://github.com/pypa/wheel) | `0.46.2` | `0.46.3` |
| [build](https://github.com/pypa/build) | `1.2.2.post1` | `1.4.0` |
| [tox](https://github.com/tox-dev/tox) | `4.27.0` | `4.34.1` |
| [pytest](https://github.com/pytest-dev/pytest) | `8.4.1` | `9.0.1` |
| [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) | `3.7.0` | `3.8.0` |
| [coverage[toml]](https://github.com/coveragepy/coveragepy) | `7.9.1` | `7.13.1` |
| [pytest-cov](https://github.com/pytest-dev/pytest-cov) | `6.2.1` | `7.0.0` |
| [pytest-benchmark](https://github.com/ionelmc/pytest-benchmark) | `5.1.0` | `5.2.3` |
| [cython](https://github.com/cython/cython) | `3.2.3` | `3.2.4` |
| [pre-commit](https://github.com/pre-commit/pre-commit) | `4.2.0` | `4.5.1` |



Updates `setuptools` from 78.1.1 to 80.9.0
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v78.1.1...v80.9.0)

Updates `setuptools-scm` from 8.3.1 to 9.2.2
- [Release notes](https://github.com/pypa/setuptools-scm/releases)
- [Changelog](https://github.com/pypa/setuptools-scm/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pypa/setuptools-scm/compare/v8.3.1...v9.2.2)

Updates `pip` from 26.0 to 26.0.1
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/26.0...26.0.1)

Updates `wheel` from 0.46.2 to 0.46.3
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.46.2...0.46.3)

Updates `build` from 1.2.2.post1 to 1.4.0
- [Release notes](https://github.com/pypa/build/releases)
- [Changelog](https://github.com/pypa/build/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/build/compare/1.2.2.post1...1.4.0)

Updates `tox` from 4.27.0 to 4.34.1
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.27.0...4.34.1)

Updates `pytest` from 8.4.1 to 9.0.1
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.1...9.0.1)

Updates `pytest-xdist` from 3.7.0 to 3.8.0
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.7.0...v3.8.0)

Updates `coverage[toml]` from 7.9.1 to 7.13.1
- [Release notes](https://github.com/coveragepy/coveragepy/releases)
- [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst)
- [Commits](https://github.com/coveragepy/coveragepy/compare/7.9.1...7.13.1)

Updates `pytest-cov` from 6.2.1 to 7.0.0
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.2.1...v7.0.0)

Updates `pytest-benchmark` from 5.1.0 to 5.2.3
- [Changelog](https://github.com/ionelmc/pytest-benchmark/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/ionelmc/pytest-benchmark/compare/v5.1.0...v5.2.3)

Updates `cython` from 3.2.3 to 3.2.4
- [Release notes](https://github.com/cython/cython/releases)
- [Changelog](https://github.com/cython/cython/blob/master/CHANGES.rst)
- [Commits](https://github.com/cython/cython/compare/3.2.3...3.2.4)

Updates `pre-commit` from 4.2.0 to 4.5.1
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v4.2.0...v4.5.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.9.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: pip-dependencies
- dependency-name: setuptools-scm
  dependency-version: 9.2.2
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: pip-dependencies
- dependency-name: pip
  dependency-version: 26.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: pip-dependencies
- dependency-name: wheel
  dependency-version: 0.46.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: pip-dependencies
- dependency-name: build
  dependency-version: 1.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
- dependency-name: tox
  dependency-version: 4.34.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
- dependency-name: pytest
  dependency-version: 9.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: pip-dependencies
- dependency-name: pytest-xdist
  dependency-version: 3.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
- dependency-name: coverage[toml]
  dependency-version: 7.13.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
- dependency-name: pytest-cov
  dependency-version: 7.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: pip-dependencies
- dependency-name: pytest-benchmark
  dependency-version: 5.2.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
- dependency-name: cython
  dependency-version: 3.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: pip-dependencies
- dependency-name: pre-commit
  dependency-version: 4.5.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 07:37:52 +00:00
TW
119e517645
Merge pull request #9359 from ThomasWaldmann/dependabot-config
improve dependabot configuration: more stability
2026-02-17 08:36:12 +01:00
Thomas Waldmann
ee569784de
improve dependabot configuration: more stability 2026-02-17 08:35:45 +01:00
TW
13b010c4ec
Merge pull request #9353 from mr-raj12/benchmark-cpu-json
benchmark cpu: add --json output option, fixes #9166
2026-02-17 08:22:36 +01:00
TW
045701558e
Merge pull request #9343 from mr-raj12/fix-http-urls-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
upgrade http:// URLs to https:// and remove dead librelist.com link, fixes #9342
2026-02-16 18:40:51 +01:00
TW
2489109fdd
Merge pull request #9357 from mr-raj12/fix-man-pages-broken-refs
docs: fix broken :ref: references in man pages, fixes #7239
2026-02-16 18:38:51 +01:00
Mrityunjay Raj
4fcde8ad0f benchmark cpu: add --json output option, fixes #9166
Add --json flag to 'borg benchmark cpu' that outputs all benchmark
results as a single JSON object for easy machine parsing. Size values
use integers (bytes) in JSON and format_file_size() for human-readable
text output. Also add tests for both plain-text and JSON output formats.
2026-02-16 22:51:32 +05:30
Mrityunjay Raj
f1ed09965f docs: fix broken :ref: references in man pages, fixes #7239 2026-02-16 22:36:07 +05:30
TW
eb7502ee50
Merge pull request #9350 from mr-raj12/ci-expand-dependabot-pip
Some checks are pending
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
ci: expand Dependabot config to monitor pip dependencies, fixes #9349
2026-02-16 07:25:17 +01:00
TW
6f49bfd766
Merge pull request #9347 from mr-raj12/docs-update-security-md-version-table
docs: update SECURITY.md version table, fixes #9346
2026-02-16 07:24:10 +01:00
Mrityunjay Raj
ca2a5ac1ff docs: update SECURITY.md version table, fixes #9346
- 2.0.x: mark as beta (not yet stable release)
- 1.2.x: no new releases, critical fixes may still be backported
- Keep 1.4.x as supported, 1.1.x and below as unsupported
2026-02-16 02:20:18 +05:30
Mrityunjay Raj
7189954a56 ci: expand Dependabot config to monitor pip dependencies, fixes #9349 2026-02-16 02:10:34 +05:30
Mrityunjay Raj
fc89a66dc7 upgrade http:// URLs to https:// and remove dead librelist.com link, fixes #9342 2026-02-16 01:42:09 +05:30
TW
e43800bcc3
Merge pull request #9345 from mr-raj12/ci-add-top-level-permissions
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
ci: add top-level permissions for least-privilege security, fixes #9344
2026-02-15 20:55:54 +01:00
Mrityunjay Raj
3349cdcc1e ci: add top-level permissions for least-privilege security, fixes #9344 2026-02-16 00:38:44 +05:30
TW
e7ad8ef54b
Merge pull request #9338 from mr-raj12/fix-pypi-urls-master
docs: update deprecated pypi.python.org URLs to pypi.org, fixes #9337
2026-02-15 17:51:41 +01:00
Mrityunjay Raj
44693da753 docs: remove unused targz_url extlink from Sphinx config 2026-02-15 21:42:36 +05:30
Mrityunjay Raj
c7d62c0ebd docs: update deprecated pypi.python.org URLs to pypi.org, fixes #9337 2026-02-15 16:53:42 +05:30
Mrityunjay Raj
1212c9c828 github: enhance pull request template, fixes #9334 2026-02-15 03:05:33 +05:30
Thomas Waldmann
a963011004
passphrase: fail if multiple passphrase env vars are set, fixes #8834
If multiple environment variables for the same passphrase context are
provided (e.g., both BORG_PASSPHRASE and BORG_PASSCOMMAND), Borg now
terminates with an error instead of silently choosing one.

This prevents the issue where an old BORG_PASSPHRASE in the environment
could override a newly intended BORG_PASSCOMMAND or BORG_PASSPHRASE_FD.
2026-02-14 22:16:55 +01:00
TW
079aebb26c
Merge pull request #9331 from ThomasWaldmann/fix-cockpit-commandline
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
cockpit: fix subprocess invocation in frozen binaries
2026-02-14 22:06:34 +01:00
TW
feb81cf292
Merge pull request #9330 from ThomasWaldmann/remove-check-python-master
Remove some checks (master)
2026-02-14 21:27:45 +01:00
Thomas Waldmann
054194f4cb
cockpit: fix subprocess invocation in frozen binaries
When running as a Pyinstaller-made binary, sys.executable points to the
borg binary itself. Invoking it with "-m borg" resulted in an incorrect
command line (e.g., "borg -m borg ..."), which confused the argument
parser in the subprocess.

This change checks sys.frozen to determine the correct invocation:
- If frozen: [sys.executable, ...args]
- If not frozen: [sys.executable, "-m", "borg", ...args]
2026-02-14 21:22:30 +01:00
TW
4e35c373ee
Merge pull request #9329 from mr-raj12/add-workflow-path-filters
ci: add path filters to lint and codeql workflows, fixes #9328
2026-02-14 20:54:55 +01:00
Thomas Waldmann
391252476d
remove API_VERSION check
we now have better build tools and these exceptions have
not been seen since long.
2026-02-14 20:45:09 +01:00
Thomas Waldmann
013edcd558 cleanup: remove check_python() compatibility shim
The check_python() function verified that the Python runtime supported
'follow_symlinks' for os.stat, os.utime, and os.chown. This check is no
longer necessary because:

1. Borg now requires Python >= 3.10.
2. On POSIX systems (Linux, macOS, *BSD, Haiku, OmniOS), support for these
   operations relies on the *at syscalls (fstatat, etc.), which have been
   implemented in standard libc for well over a decade (e.g., FreeBSD 8.0+,
   NetBSD 6.0+, Solaris 11+).
3. On Windows (MSYS2/MinGW), Python has supported follow_symlinks for
   os.stat since Python 3.2. The removed check specifically inspected only
   os.stat on Windows, avoiding the problematic os.utime/os.chown checks.

Any platform capable of running Python 3.10 will inherently support these
standard file operations.
2026-02-14 20:25:56 +01:00
Mrityunjay Raj
802ec2f980 ci: include workflow files in their own path filters 2026-02-15 00:50:49 +05:30
Thomas Waldmann
d537f0d80d
CI: build linux binaries with pyfuse3 2026-02-14 19:32:40 +01:00
Thomas Waldmann
de51d24464
pyinstaller binary: do not exclude ssl, needed for pyfuse3/trio, fixes #9196 2026-02-14 19:32:38 +01:00
Thomas Waldmann
d73a88ebbe
rename Dockerfile to match script name 2026-02-14 19:32:32 +01:00
TW
40dcfe4d99
Merge pull request #9276 from ThomasWaldmann/fix-build-master
binary build: install cockpit,s3,sftp extras
2026-02-14 19:31:10 +01:00
Thomas Waldmann
94d56e1c89
pyinstaller: cockpit: add tcss file, add unicode data 2026-02-14 19:05:37 +01:00
Thomas Waldmann
92ebb97ecb
CI: add borg.exe to PATH 2026-02-14 19:03:33 +01:00
Thomas Waldmann
ce7d3ee843
binary build: install cockpit,s3,sftp extras 2026-02-14 19:03:31 +01:00
Mrityunjay Raj
7ca00c0f70 ci: add path filters to lint and codeql workflows, fixes #9328 2026-02-14 23:26:41 +05:30
TW
e60874ecbd
Merge pull request #9313 from trxvorr/fix-9279-drive-letters
windows: normalize drive letters fixes #9279
2026-02-14 18:55:44 +01:00
trxvorr
6430564adb Fix #9279: normalize drive letters on Windows 2026-02-14 20:22:42 +05:30
TW
b9d636934b
Merge pull request #9322 from ThomasWaldmann/linux-container-testing-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
linux-run: run commands (e.g. tox) in a podman linux container
2026-02-14 12:26:03 +01:00
Thomas Waldmann
40a2bb7032
linux-run: run commands (e.g. tox) in a podman linux container
this is useful to run the linux tests on a mac, e.g. to test fuse stuff.
2026-02-14 12:19:32 +01:00
TW
632893ba36
Merge pull request #9320 from ThomasWaldmann/windows-fixes-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
cygwin: skip ~root base dir test
2026-02-13 23:53:16 +01:00
TW
0c989a0e38
Merge pull request #9318 from mr-raj12/pin-black-action-sha
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
ci: pin psf/black action to commit SHA, fixes #9317
2026-02-13 19:57:36 +01:00
Mrityunjay Raj
943627131a ci: pin psf/black action to commit SHA, fixes #9317 2026-02-13 23:24:29 +05:30
Thomas Waldmann
2b5bca41aa
cygwin: skip ~root base dir test 2026-02-13 15:58:40 +01:00
TW
5070066c3b
Merge pull request #9316 from ThomasWaldmann/fix-ci-codecov-master
CI: codecov: nothing to do for mypy and docs envs
2026-02-13 14:31:21 +01:00
Thomas Waldmann
64b81b7a8c
CI: codecov: nothing to do for mypy and docs envs 2026-02-13 14:02:58 +01:00
TW
dde092b667
Merge pull request #9315 from ThomasWaldmann/fix-ci-netbsd-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
CI: fix tmpdir check on netbsd
2026-02-13 08:45:04 +01:00
Thomas Waldmann
e8f867072c
CI: fix tmpdir check on netbsd 2026-02-13 08:08:11 +01:00
TW
ab007a3cb5
Merge pull request #9314 from ThomasWaldmann/ci-omnios
CI: add omniOS
2026-02-13 07:05:59 +01:00
Thomas Waldmann
627d16ac80
CI: add testing on omniOS ("OpenSolaris") 2026-02-13 06:26:47 +01:00
TW
ffc150439b
Merge pull request #9312 from borgbackup/dependabot/github_actions/actions-d6802a00fb
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
build(deps): bump the actions group with 7 updates
2026-02-13 04:51:13 +01:00
dependabot[bot]
30ba0b1225
build(deps): bump the actions group with 7 updates
Bumps the actions group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4` | `6` |
| [korthout/backport-action](https://github.com/korthout/backport-action) | `3` | `4` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5` | `6` |
| [actions/cache](https://github.com/actions/cache) | `4` | `5` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4` | `6` |
| [cross-platform-actions/action](https://github.com/cross-platform-actions/action) | `0.29.0` | `0.32.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3` | `4` |


Updates `actions/checkout` from 4 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

Updates `korthout/backport-action` from 3 to 4
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](https://github.com/korthout/backport-action/compare/v3...v4)

Updates `actions/setup-python` from 5 to 6
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

Updates `actions/cache` from 4 to 5
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

Updates `actions/upload-artifact` from 4 to 6
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v6)

Updates `cross-platform-actions/action` from 0.29.0 to 0.32.0
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.29.0...v0.32.0)

Updates `github/codeql-action` from 3 to 4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: korthout/backport-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: cross-platform-actions/action
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 03:22:48 +00:00
TW
e4d94cb40d
Merge pull request #9311 from mr-raj12/add-concurrency-groups
ci: add concurrency groups to cancel stale workflow runs, fixes #9310
2026-02-13 04:20:43 +01:00
TW
487d803fa8
Merge pull request #9307 from mr-raj12/bump-ruff-v0.15.0
ruff: bump to v0.15.0, migrate config to tool.ruff.lint, fixes #9305
2026-02-13 04:18:19 +01:00
TW
74a9cb0ae6
Merge pull request #9299 from mr-raj12/add-workflow-timeouts
ci: add missing timeout-minutes to codeql, backport, and lint workflows
2026-02-13 04:14:10 +01:00
TW
9202b57e83
Merge pull request #9309 from mr-raj12/add-dependabot-config
ci: add dependabot config for github actions, fixes  #9308
2026-02-13 04:13:35 +01:00
TW
c60b67f01d
Merge pull request #9303 from mr-raj12/fix-insecure-http-links
docs: replace insecure http:// links with https://, fixes #9302
2026-02-13 04:09:07 +01:00
TW
0267d0107f
Merge pull request #9301 from mr-raj12/fix-deprecated-gitio-shortlink
CI: replace deprecated git.io shortlink in CodeQL workflow, fixes #9300
2026-02-13 04:08:04 +01:00
Mrityunjay Raj
cf20f8c5bc ci: add concurrency groups to cancel stale workflow runs, fixes #9310 2026-02-13 04:18:20 +05:30
Mrityunjay Raj
665a0be186 ci: add dependabot config for github actions, fixes #9308 2026-02-13 03:06:21 +05:30
Mrityunjay Raj
48ca497996 ruff: bump to v0.15.0, migrate config to tool.ruff.lint, fixes #9305 2026-02-13 02:36:43 +05:30
Mrityunjay Raj
d712776b42 docs: replace insecure http:// links with https://, fixes #9302 2026-02-13 01:59:19 +05:30
Mrityunjay Raj
51c376f500 CI: replace deprecated git.io shortlink in CodeQL workflow, fixes #9300 2026-02-13 01:42:50 +05:30
TW
9531510f2d
Merge pull request #9296 from mr-raj12/fix/codespell-typos
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
fix typos found by codespell
2026-02-12 20:57:26 +01:00
Mrityunjay Raj
2b83e0e0f0 ci: add missing timeout-minutes to codeql, backport, and lint workflows
ci.yml already has timeout-minutes on every job, but these three
workflows had no timeout configured. Without an explicit timeout,
GitHub Actions defaults to 6 hours, wasting CI minutes if a job
gets stuck.

Added timeouts consistent with ci.yml:
- codeql-analysis.yml: 20 min (builds from source + analysis)
- backport.yml: 5 min (simple checkout + PR creation)
- black.yaml: 5 min (matches ci.yml ruff lint job)

Fixes #9298
2026-02-13 01:15:28 +05:30
Mrityunjay Raj
ffe360a2ec fix typos found by codespell
- backupped → backed-up (docs/faq.rst)
- splitted → expected (src/borg/testsuite/xattr_test.py)
- uptodate → up-to-date (docs/development.rst, src/borg/repository.py)

Closes #9295
2026-02-13 00:16:54 +05:30
TW
8da5de3670
Merge pull request #9288 from ThomasWaldmann/directory-extraction-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
extract: do not delete existing directory if possible, fixes #4233
2026-02-11 13:57:53 +01:00
TW
b1e2c29002
Merge pull request #9294 from ai-man-codes/cleanup/remove-deprecated-test-code
testsuite: remove deprecated manual cleanup in create_cmd_test
2026-02-11 13:50:33 +01:00
Thomas Waldmann
b85ad47fda
extract --continue: optimize processing of already existing dirs
if an already existing fs directory has the correct (as archived) mtime,
we have already extracted it in a previous borg extract run and we do not
need and should not call restore_attrs for it again.

if the directory exists, but does not have the correct mtime, restore_attrs
will be called and its attributes will be extracted (and mtime set to
correct value).
2026-02-11 12:11:26 +01:00
Aiman
e19a2213a3 testsuite: remove deprecated manual cleanup in create_cmd_test 2026-02-11 16:10:21 +05:30
TW
b802cfd496
Merge pull request #9292 from ThomasWaldmann/list-fingerprint-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
list --format: add fingerprint placeholder
2026-02-11 09:12:55 +01:00
TW
7b3b297486
Merge pull request #9293 from ThomasWaldmann/codecov-test-analytics-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
CI: enable Codecov Test Analytics
2026-02-10 17:44:04 +01:00
Thomas Waldmann
7ef2c258bb
CI: enable Codecov Test Analytics
Enable JUnit XML generation for `native_tests` and `windows_tests` to allow Codecov to process test analytics.

Upload the generated `test-results.xml` using `codecov/codecov-action`.

The upload step uses `if: !cancelled()` to ensure results are uploaded even if tests fail (to analyze failures), but skipped if the workflow is explicitly cancelled.

Originally brought up in PR #8752 by @katia-sentry, but missed the !cancelled() check.

Also: upgrade to codecov-action@v5.
2026-02-10 17:08:54 +01:00
TW
26bde193b6
Merge pull request #9290 from MultisampledNight/fix-padme-ui
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
Fix padme UI
2026-02-10 08:55:05 +01:00
Thomas Waldmann
baed0bc5d0
list --format: add fingerprint placeholder
This allows users to compare file content efficiently without reading the
full file data, by exposing a hash of the chunk IDs and the relevant
conditions for valid comparisons, like chunker params, chunker seed/key,
id key, key type, etc.

This is based on PR #5167 by @hrehfeld, code + discussion, with some changes:
- the conditions hash now includes more relevant input params
- returning a single value that is composed of 2 parts
- tests (including new buzhash64)

Example output (different files in same archive):

1e88bfb02d0a5320-a539587200c33b857f9827d01fcb7dabacf30501c83929e7308668d43f4a6302 file1
1e88bfb02d0a5320-9ed78a4c14d0506d9ae75d914cca90db64655ddea22647dd1c89f19e2fc080ae file2

The fingerprint has 2 parts:

First part: same hash, indicates same chunking / chunk id generation params,
            meaning that the second part is valid to be compared.

Second part: different hash, because file content is different.
             same hash here would mean same content.
2026-02-10 08:45:42 +01:00
MultisampledNight
245a46842d
test(compress): roundtrip through UI parsing 2026-02-09 23:59:38 +01:00
MultisampledNight
74f5faba96
compress: expose Padmé size obfuscation via UI
Fixes #9286.
Tested manually via:

 = export BORG_REPO=repo
 = alias b='python -m borg'
 = echo meow > file
 = b create ::test ./file -C obfuscate,250,none
 = b info
Archive name: ::test
Archive fingerprint: 2c67ba6c04faa6d911b5dd02b99593ea2cf6ebe7c38e2e6fca90afad47a7095e
[...]
Command line: /home/user/c/d0/software/backup/borg/src/borg/__main__.py create ::test ./file -C obfuscate,250,none
[...]
Number of files: 1
Original size: 40 B
 = rm file
 = b list ::test
-rw-r--r-- user   users         5 Mon, 2026-02-09 22:41:54 +0100 file
 = b extract ::test file
 = cat file
meow
 = # Yup, all good. Let's go for something nontrivial to make sure it's stripped accordingly.
 = dd if=/dev/urandom of=file bs=1M count=4
 = b create ::test ./file -C obfuscate,250,zstd
 = mv file original
 = b info
Archive name: ::test
Archive fingerprint: 2c67ba6c04faa6d911b5dd02b99593ea2cf6ebe7c38e2e6fca90afad47a7095e
[...]
Command line: /home/user/c/d0/software/backup/borg/src/borg/__main__.py create ::test ./file -C obfuscate,250,none
Working Directory: /home/user/l/bug/borg
Number of files: 1
Original size: 40 B

Archive name: ::test
Archive fingerprint: 01014345dd1187f014f19ac59a2313a4e6d644532b287d806fe87882ca47ea0d
[...]
Command line: /home/user/c/d0/software/backup/borg/src/borg/__main__.py create ::test ./file -C obfuscate,250,zstd
Working Directory: /home/user/l/bug/borg
Number of files: 1
Original size: 4.19 MB
 = b extract aid:01014345dd1187f014f19ac59a2313a4e6d644532b287d806fe87882ca47ea0d 
 = sha256sum file original
d74be01406764ef11f5aa3ee27033bdced2c9573c0b3ed980fcfb2116c7d84de  file
d74be01406764ef11f5aa3ee27033bdced2c9573c0b3ed980fcfb2116c7d84de  original
 =
2026-02-09 23:23:29 +01:00
Thomas Waldmann
98d189d088
extract: do not delete existing directory if possible, fixes #4233
A pre-existing directory might be a btrfs subvolume that was created by
the user ahead of time when restoring several nested subvolumes from a
single archive.

If the archive item to be extracted is a directory and there is already
a directory at the destination path, do not remove (and recreate) it,
but just use it.

That way, btrfs subvolumes (which look like directories) are not deleted.

Fix originally contributed by @intelfx in #7866, but needed more work,
so I thought more about the implications and added a test.

Note:

In the past, we first removed (empty) directories, then created a fresh
one, then called restore_attrs for that. That produced correct metadata,
but only for the case of an EMPTY exisiting directory. If the existing
directory was not empty, the simply os.rmdir we tried did not work
anyway and did not remove the existing directory.

Usually we extract to an empty base directory, thus encountering this
edge case is mostly limited to continuing a previous extraction.
In that case, calling restore_attrs again on a directory that already has
existing attrs should be harmless, because they are identical.
2026-02-09 22:27:42 +01:00
TW
d680ee0feb
Merge pull request #9283 from ThomasWaldmann/swidth-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
swidth: use cross platform implementation, fixes #7493
2026-02-09 22:25:45 +01:00
Thomas Waldmann
37fbe3f40b
swidth: use cross platform implementation, fixes #7493
This implementation should be good enough for our usecase (paths) and has no external dependencies.

There is also a wcwidth library which might be even better, but would add another dependency.
2026-02-09 22:01:49 +01:00
TW
6ab08b895e
Merge pull request #9264 from ThomasWaldmann/path-sep-windows
path sep and windows related changes
2026-02-09 21:59:44 +01:00
Thomas Waldmann
50f4e54462
map_chars: deal invalid chars in paths on windows 2026-02-09 21:32:08 +01:00
Thomas Waldmann
d6d5ce5cb0
use pyinstaller 6.18.0
CI: the windows runner installs Python 3.14 now and thus we need a more recent pyinstaller to be compatible with that.
2026-02-09 20:02:24 +01:00
Thomas Waldmann
4c6e8c6b08
remove the AI agent plan 2026-02-09 20:02:23 +01:00
Thomas Waldmann
88581d1bb8
Improve Windows path handling with forward slash standardization
This commit implements a comprehensive approach to Windows path compatibility
by standardizing on forward slashes (/) for all internal path representations
while maintaining cross-platform archive compatibility.

Core Strategy:
- All internal paths now use forward slashes as separators on all platforms
- Boundary normalization: backslashes converted to forward slashes at entry
  points on Windows (filesystem paths only, not user patterns)
- Literal backslashes from POSIX archives replaced with % on Windows extraction

Key Changes:

Path Handling (helpers/fs.py):
- Added slashify(): converts backslashes to forward slashes on Windows
- Added percentify(): replaces backslashes with % for POSIX-to-Windows extraction
- Updated make_path_safe() to check for Windows-style .. patterns
- Changed get_strip_prefix() to use posixpath.normpath instead of os.path.normpath
- Updated remove_dotdot_prefixes() to use forward slashes consistently

Pattern Matching (patterns.py):
- Replaced os.path with posixpath throughout for consistent separator handling
- Updated PathFullPattern, PathPrefixPattern, FnmatchPattern, ShellPattern
- All pattern matching now uses / as separator regardless of platform
- Removed platform-specific os.sep usage

Archive Operations (archive.py, item.pyx):
- Applied slashify() to paths during archive creation on Windows
- Added percentify/slashify encoding/decoding for symlink targets
- Ensures archived paths always use forward slashes

Command Line (archiver/create_cmd.py, extract_cmd.py):
- Replaced os.path.join/normpath with posixpath equivalents
- Added slashify() for stdin-provided paths on Windows
- Updated strip_components to use / separator
- Changed PathSpec to FilesystemPathSpec for proper path handling

Repository (repository.py, legacyrepository.py):
- Replaced custom _local_abspath_to_file_url() with Path.as_uri()

Documentation (archiver/help_cmd.py):
- Clarified that all archived paths use forward slashes
- Added note about Windows absolute paths in archives (e.g., C/Windows/System32)
- Documented backslash-to-percent replacement for POSIX archives on Windows

Impact:
- Windows users can now create and extract archives with consistent path handling
- Cross-platform archives remain compatible
- Pattern matching works identically on all platforms
2026-02-09 20:02:21 +01:00
Thomas Waldmann
0feb1da03f
AI agent plan for path sep and windows related changes 2026-02-09 20:02:20 +01:00
Thomas Waldmann
ae4b9521f8
fix issues found by linter 2026-02-09 20:02:13 +01:00
TW
880e41c132
Merge pull request #9289 from ThomasWaldmann/fix-ci-master
fix CI (master)
2026-02-09 14:03:39 +01:00
Thomas Waldmann
d870d9517f
CI: cache needs to consider runner.arch
Seen this on the macOS arm64 runner:

ImportError: dlopen(/Users/runner/work/borg/borg/.tox/py311-none/lib/python3.11/site-packages/_argon2_cffi_bindings/_ffi.abi3.so, 0x0002): tried: '/Users/runner/work/borg/borg/.tox/py311-none/lib/python3.11/site-packages/_argon2_cffi_bindings/_ffi.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/borg/borg/.tox/py311-none/lib/python3.11/site-packages/_argon2_cffi_bindings/_ffi.abi3.so' (no such file), '/Users/runner/work/borg/borg/.tox/py311-none/lib/python3.11/site-packages/_argon2_cffi_bindings/_ffi.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
2026-02-09 12:14:08 +01:00
TW
fb70eda065
Merge pull request #9287 from ThomasWaldmann/fix-6204-master
docs: consolidate key backup info in borg key export, fixes #6204
2026-02-08 14:16:48 +01:00
Thomas Waldmann
f646d2c4d0
docs: consolidate key backup info in borg key export, fixes #6204
Consolidate key backup documentation into `borg key export` and reference
it from Quickstart and FAQ to avoid duplication and inconsistency.

Clarify that while `repokey` or `authenticated` mode stores the key in the
repo, a separate backup is still recommended to protect against repository
corruption or data loss.
2026-02-08 11:50:31 +01:00
TW
32c9ce87dd
Merge pull request #9284 from borgbackup/dependabot/pip/requirements.d/pip-26.0
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
build(deps-dev): bump pip from 25.3 to 26.0 in /requirements.d
2026-02-03 09:06:15 +01:00
dependabot[bot]
a7ffc624d7
build(deps-dev): bump pip from 25.3 to 26.0 in /requirements.d
Bumps [pip](https://github.com/pypa/pip) from 25.3 to 26.0.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/25.3...26.0)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: '26.0'
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 00:33:24 +00:00
TW
df081ca219
Merge pull request #9282 from ThomasWaldmann/optimize-ci-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
Optimize CI (master)
2026-01-31 13:48:50 +01:00
Thomas Waldmann
a2b47c7439
CI: cache tox environments 2026-01-31 08:06:11 +01:00
Thomas Waldmann
e78c299e71
CI: remove redundant tox runs
Some tox envs are run when opening a PR, so we
do not need to run them again at merge time.
2026-01-31 07:31:09 +01:00
Thomas Waldmann
33a63fa924
CI: parallelize better, avoid unnecessary steps 2026-01-31 07:21:48 +01:00
TW
ff0756c1e4
Merge pull request #9278 from ThomasWaldmann/fix-cockpit
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
cockpit: start the Borg runner after all widgets are mounted
2026-01-29 18:43:48 +01:00
Thomas Waldmann
dfa9308dca
cockpit: start the Borg runner after all widgets are mounted 2026-01-29 17:43:48 +01:00
TW
d6b7a722f3
Merge pull request #9275 from ThomasWaldmann/update-changes-master
update CHANGES
2026-01-29 17:15:47 +01:00
Thomas Waldmann
d75604b293
update CHANGES 2026-01-28 15:05:25 +01:00
TW
33ee04fd3d
Merge pull request #9274 from ThomasWaldmann/s3-urls
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
fix S3 url description, fixes #9249
2026-01-28 14:23:01 +01:00
Thomas Waldmann
4073bb263f
fix S3 url description, fixes #9249
- profile also must be followed by @
- in URL specs, it is "scheme", not "schema"
- note that the scheme is usually https
2026-01-28 12:12:26 +01:00
TW
6a72b12b1e
Merge pull request #9272 from ThomasWaldmann/windows-ci
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
windows CI
2026-01-28 03:29:03 +01:00
Thomas Waldmann
85b2ca284e
CI: enable windows testing 2026-01-27 22:35:23 +01:00
Thomas Waldmann
618a401b48
fix or skip tests on windows 2026-01-27 22:09:25 +01:00
Thomas Waldmann
9eaf7df3f0
fix file: URL parsing for windows
Linux: /abs/path -> file:///abs/path
Windows: c:/abs/path -> file:///c:/abs/path
2026-01-27 22:09:24 +01:00
Thomas Waldmann
0f0566ea63
correctly construct file: URL on windows 2026-01-27 22:09:22 +01:00
Thomas Waldmann
ee3373c5e3
build borg.exe in dist/binary 2026-01-27 22:09:20 +01:00
Fabian Fröhlich
c7073ca06d
Add a note that you need to install boto3 if you want to use s3/b2 URLs in the docs (#9273)
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
2026-01-25 21:08:22 +01:00
TW
3358ba910e
Merge pull request #9269 from borgbackup/dependabot/pip/requirements.d/wheel-0.46.2
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
build(deps-dev): bump wheel from 0.45.1 to 0.46.2 in /requirements.d
2026-01-22 20:29:57 +01:00
dependabot[bot]
383097ac03
build(deps-dev): bump wheel from 0.45.1 to 0.46.2 in /requirements.d
Bumps [wheel](https://github.com/pypa/wheel) from 0.45.1 to 0.46.2.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.45.1...0.46.2)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.46.2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-22 19:06:47 +00:00
TW
ef45731d12
Merge pull request #9268 from ThomasWaldmann/borg-version-master
Version: do not access private attributes, fixes #9263
2026-01-22 18:47:21 +01:00
Thomas Waldmann
3bddee22d4
Version: do not access private attributes, fixes #9263
DeprecationWarning: Version._version is private and will be removed soon
2026-01-22 17:23:45 +01:00
MartinKurtz
4827521f9c
mount: warn about symlinks pointing outside of the mountpoint, see #9254
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
2026-01-20 03:21:34 +01:00
TW
5112caba32
Merge pull request #9257 from borgbackup/dependabot/pip/requirements.d/virtualenv-20.36.1
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
build(deps-dev): bump virtualenv from 20.31.2 to 20.36.1 in /requirements.d
2026-01-14 14:09:59 +01:00
dependabot[bot]
832143fc64
build(deps-dev): bump virtualenv in /requirements.d
Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.31.2 to 20.36.1.
- [Release notes](https://github.com/pypa/virtualenv/releases)
- [Changelog](https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/virtualenv/compare/20.31.2...20.36.1)

---
updated-dependencies:
- dependency-name: virtualenv
  dependency-version: 20.36.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-13 20:00:56 +00:00
TW
a8f1ed97e0
Merge pull request #9243 from ThomasWaldmann/ci-borg-dir-exe-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
CI: faster with borg-dir/borg.exe, fixes #9236
2025-12-26 20:56:20 +01:00
Thomas Waldmann
d602cf23a5
CI: faster with borg-dir/borg.exe, fixes #9236
The single-file borg.exe needs unpacking each time it is invoked.
borg-dir/borg.exe is alread unpacked.

Also, macOS is slow when a "new" binary is first invoked, so
this should help there even more.
2025-12-26 20:22:52 +01:00
TW
3e5c3538e1
Merge pull request #9240 from ThomasWaldmann/fix-b20
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
Fix b20
2025-12-24 02:20:53 +01:00
Thomas Waldmann
ed6e5db168
remove mfusepym dependency from pyproject.toml, fixes #9239 2025-12-24 02:19:07 +01:00
Thomas Waldmann
e671234942
fix mismatch in xattr test, fixes #9238 2025-12-24 02:17:07 +01:00
TW
160f84d026
Merge pull request #9235 from ThomasWaldmann/rel200b20
Release 2.0.0b20
2025-12-24 01:51:58 +01:00
Thomas Waldmann
fef9d63111
pyinstaller missing module workaround 2025-12-23 18:53:15 +01:00
Thomas Waldmann
98aa125386
add requirements file for pyinstaller
make it easy to change pyinstaller version.
2025-12-23 18:52:22 +01:00
Thomas Waldmann
461f78b2b0
update release date 2025-12-23 18:01:59 +01:00
Thomas Waldmann
fcbf7f3572
build_usage build_man 2025-12-23 18:00:09 +01:00
TW
42ea1d056a
Merge pull request #9234 from ThomasWaldmann/update-changes-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
update changes (master)
2025-12-23 17:26:32 +01:00
Thomas Waldmann
f4a2ff13d2
update CHANGES 2025-12-23 16:47:31 +01:00
Thomas Waldmann
b003a9ffaf
development.lock.txt: upgrade Cython to latest release 2025-12-23 16:47:29 +01:00
TW
4a1d0ebe54
Merge pull request #9213 from ThomasWaldmann/mfusepy
integrate highlevel fuse lib mfusepy
2025-12-23 16:44:53 +01:00
Thomas Waldmann
661d2b6c5d
docs: mfusepy >= 3.1.0 is required 2025-12-23 16:13:50 +01:00
Thomas Waldmann
ee2fcefcb8
hlfuse: fix getxattr, raise ENOATTR 2025-12-23 16:13:49 +01:00
Thomas Waldmann
7278a1d5fc
ENOATTR import cleanups 2025-12-23 16:13:47 +01:00
Thomas Waldmann
c9ebeba933
make mypy happy 2025-12-23 16:13:46 +01:00
Thomas Waldmann
2e9ebe4d95
docs: add missing link definition for mfusepy 2025-12-23 16:13:45 +01:00
Thomas Waldmann
23bbc195e1
pyproject.toml: add comments to fuse options 2025-12-23 16:13:41 +01:00
Thomas Waldmann
0053bcb6b6
mfusepy: add alternative extra to install from project's master branch 2025-12-23 15:10:59 +01:00
Thomas Waldmann
7ccbb33f84
rename tox envs after fuse lib name
Also: on freebsd, run tox env py311-mfusepy
2025-12-20 19:47:36 +01:00
Thomas Waldmann
334f73df08
use hlfuse similar to llfuse, move import 2025-12-20 19:47:30 +01:00
Thomas Waldmann
cc18e3f171
rename fuse2 -> hlfuse
fuse2 was a bit misleading. it meant "our 2nd fuse implementation",
but could be misunderstood to refer to fuse v2.

hlfuse.py now means highlevel fuse, as opposed to the lowlevel fuse in fuse.py.
2025-12-20 19:46:29 +01:00
Thomas Waldmann
2e567d9785
fuse_impl.ENOATTR (import from borg.platform) 2025-12-20 19:46:04 +01:00
Thomas Waldmann
562bb27368
fix hardlink inode issue 2025-12-20 19:31:55 +01:00
Thomas Waldmann
7590d1eed4
add has_any_fuse flag 2025-12-20 19:31:54 +01:00
Thomas Waldmann
3e676e95c1
pytest report header: report llfuse/pyfuse3/mfusepy 2025-12-20 19:31:53 +01:00
Thomas Waldmann
43c7878a56
docs: update installation requirements and BORG_FUSE_IMPL about mfusepy 2025-12-20 19:31:51 +01:00
Thomas Waldmann
176dec80f3
integrate mount2_cmds_test into mount_cmds_test
Updated mount_cmds_test.py to work with both llfuse/pyfuse3 and mfusepy
by checking for either implementation in skip conditions.

mfusepy: 2 test fails due to hardlink implementation differences
2025-12-20 19:31:50 +01:00
Thomas Waldmann
ead93b6d12
integrate mount2/umount2 into mount/umount, use BORG_FUSE_IMPL 2025-12-20 19:31:49 +01:00
Thomas Waldmann
71416d76f4
fuse2: getattr: prefer fh lookup if possible 2025-12-20 19:31:47 +01:00
Thomas Waldmann
0aa7c16749
fuse2: improve comments 2025-12-20 19:31:46 +01:00
Thomas Waldmann
3393c0f2b7
fuse2: implement lazy children dict allocation for DirEntry 2025-12-20 19:31:45 +01:00
Thomas Waldmann
8eb676b047
fuse2: remove path from packed inodes to save memory 2025-12-20 19:31:43 +01:00
Thomas Waldmann
a842234843
fuse2: add __slots__ to DirEntry for memory optimization 2025-12-20 19:31:42 +01:00
Thomas Waldmann
72befa1bcf
fuse2: rename Node -> DirEntry, inode_count -> current_ino 2025-12-20 19:31:41 +01:00
Thomas Waldmann
9651b083df
Optimize fuse2 memory usage with centralized packed item storage 2025-12-20 19:31:39 +01:00
Thomas Waldmann
6632b1187a
fuse2: remove unused fuse_main 2025-12-20 19:31:38 +01:00
Thomas Waldmann
f545ebbf0d
fuse2: optimize/generalize debug and test logging 2025-12-20 19:31:37 +01:00
Thomas Waldmann
2d1772f919
fuse2: versions view + test 2025-12-20 19:31:35 +01:00
Thomas Waldmann
c21c42b1a9
mount2/umount2: mfusepy-based alternative FUSE fs implementation 2025-12-20 19:31:33 +01:00
TW
a0e250df0a
Merge pull request #9231 from ThomasWaldmann/enoattr
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
move ENOATTR to borg.platform
2025-12-20 19:30:07 +01:00
Thomas Waldmann
9ae6da88aa
import ENOATTR from borg.platform 2025-12-20 19:00:38 +01:00
Thomas Waldmann
663732c8bd
move ENOATTR definition to borg.platform.base
That also gets imported into borg.platform, so
it is easily available from there.
2025-12-20 18:55:28 +01:00
TW
42e645e6a2
Merge pull request #9229 from ThomasWaldmann/haiku-fixes
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
Haiku fixes
2025-12-17 22:16:57 +01:00
Thomas Waldmann
dcdc91c1cc
improve fs_test 2025-12-17 18:59:36 +01:00
Thomas Waldmann
6be6b1d942
test_with_lock: skip on Haiku OS 2025-12-17 18:55:43 +01:00
Thomas Waldmann
4df1a534de
tests: refactor expected item_count 2025-12-17 18:44:42 +01:00
Thomas Waldmann
4a701b65ea
add debug prints for sys.path and PATH 2025-12-17 17:59:05 +01:00
Thomas Waldmann
87ff42ee27
add debug print to display archive contents 2025-12-17 17:32:01 +01:00
Thomas Waldmann
1721d1b080
fs_test: exclude Haiku OS from "~root" expansion check 2025-12-17 17:26:14 +01:00
TW
841ed3afad
Merge pull request #9227 from ThomasWaldmann/fix-macos-ci-platforms
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
CI: use macos-15-intel to build the x86_64 binary
2025-12-16 21:17:24 +01:00
TW
7a1c1b41c0
Merge pull request #9226 from ThomasWaldmann/update-changes-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
update CHANGES
2025-12-16 20:28:02 +01:00
Thomas Waldmann
d27cb58faf
CI: use macos-15-intel to build the x86_64 binary 2025-12-16 20:15:52 +01:00
Thomas Waldmann
28de075535
update CHANGES 2025-12-16 13:51:27 +01:00
TW
2c15eda7ac
Merge pull request #9225 from ThomasWaldmann/archive-cwd-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
info: show cwd at the time of backup creation, fixes #6191
2025-12-16 03:24:57 +01:00
Thomas Waldmann
3c2afeb943
info: show cwd at the time of backup creation, fixes #6191
Useful if one archives relative paths. Together with the cwd
one can know the full path of the files.
2025-12-15 21:28:34 +01:00
TW
d819cd3ba8
Merge pull request #9224 from ThomasWaldmann/fix-binary-build-gh-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
CI: FUSE related fixes/improvements (master)
2025-12-15 19:07:08 +01:00
Thomas Waldmann
ac73be4b09
CI: use macOS 15 for binary builds
Github EOLed all other macOS Intel action runners.

As Apple Silicon users tend to have more
recent OSes, we bump that to macOS 15 also.
2025-12-15 17:40:51 +01:00
Thomas Waldmann
4db56e3f71
update binary readme 2025-12-15 17:37:14 +01:00
Thomas Waldmann
ddcf61b5db
CI: increase timeout 2025-12-15 17:35:12 +01:00
Thomas Waldmann
fefb4dfd8e
freebsd: fix upload name for artifact zip 2025-12-15 17:33:19 +01:00
Thomas Waldmann
c8f5d6219d
CI: FUSE related fixes/improvements (master)
fixes #9182

- install OS fuse support packages as indicated by the tox env.
  on the macOS runners, we do not have any fuse support.
  on the linux runners, we may have fuse2 or fuse3.
  on FreeBSD, we have fuse2.
- install fuse python library for binary build
- first build/upload binaries, then run tests (including binary tests).
  early uploading makes inspection of a malfunctioning binary possible.
- for now, use llfuse, as there is an issue with pyinstaller and pyfuse3.

Also:
- remove || true - this just hides errors, not what we want.
2025-12-15 17:29:11 +01:00
TW
9aa66a0f75
Merge pull request #9223 from ThomasWaldmann/cockpit
borg --cockpit: show TUI based on Textual
2025-12-15 17:24:26 +01:00
Thomas Waldmann
2af8de5800
borg --cockpit: show TUI based on Textual 2025-12-15 16:10:21 +01:00
TW
2152e1e3a9
Merge pull request #9209 from ThomasWaldmann/fix-9208
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
Fix misc. borg transfer issues
2025-12-08 01:33:38 +01:00
Thomas Waldmann
b43c3adabb
transfer: create a chunks list entry for missing chunks, see #9208 2025-12-06 17:21:41 +01:00
Thomas Waldmann
3bda2f10d9
HardLinkManager: allow NoneType for contentless hardlinks, see #9208
Some hardlinks have content and thus a chunks list,
but e.g. block or char device hardlinks do not have a chunks list.
2025-12-06 17:21:38 +01:00
Thomas Waldmann
352f982393
old archives might not have a comment in metadata, see #9208
guess the default is only needed when transferring
very old archives from borg1 repos.
2025-12-06 16:04:46 +01:00
TW
425fa1c77a
fix pynacl/libsodium build on freebsd (#9214)
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
2025-12-06 15:30:26 +01:00
TW
70f6c0122a
Merge pull request #9212 from ThomasWaldmann/filter-xattrs-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
no_selinux -> filter_xattrs
2025-12-05 19:18:47 +01:00
Thomas Waldmann
fefb27e732
no_selinux -> filter_xattrs
Originally, we only wanted to get rid of selinux xattrs,
but macOS also uses some xattr keys that disturb our test results,
so we filter them also.
2025-12-05 18:37:11 +01:00
TW
231bf26552
Merge pull request #9200 from ThomasWaldmann/fix-9199-legacyremote-raise-missing
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
transfer and legacyremote fixes
2025-12-04 01:59:31 +01:00
Thomas Waldmann
7d4c05d2a3
transfer: fix AttributeError with --dry-run, see #9199 2025-12-02 03:00:32 +01:00
Thomas Waldmann
017dfec4ff
transfer: add --dry-run test 2025-12-02 03:00:30 +01:00
Thomas Waldmann
11ad58d3ca
legacyremote: accept raise_missing in get/get_many to avoid TypeError with callers that pass it; no behavior change on legacy protocol (fixes #9199) 2025-12-02 02:33:01 +01:00
TW
a38d87b21f
Merge pull request #9205 from ThomasWaldmann/fix-compact-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
compact: fix dealing with mismatching hints (master)
2025-12-02 02:31:14 +01:00
Thomas Waldmann
d676ef7b3f
compact: also fix segments hints data for lost segment files
The code used to remove the missing segment only from "compact" hints,
but we need to also remove it from "segments" hints.
2025-12-02 01:37:35 +01:00
Thomas Waldmann
b1bb3830fb
compact_segments: replace AssertionError by warning, fixes #8535
emit only a warning, but let compaction complete.
after that, borg check --repair can fix the hints successfully.

likely this code won't be used in master branch as we only read from
legacy repos, but I ported this fix from 1.4-maint nevertheless.

This is the result of a longer discussion with Antigravity AI and me:

Detailed Explanation: Why Converting AssertionError to Warning is Correct
=========================================================================

PROBLEM OVERVIEW
----------------
The assertion `assert segments[segment] == 0` in compact_segments() was causing
borg compact to crash when segment reference counts in the hints file didn't
match the actual repository state. This typically occurred after index corruption
or repository recovery scenarios.

ROOT CAUSE ANALYSIS
-------------------
The crash happens due to a fundamental mismatch between two data structures:

1. self.segments (loaded from hints file)
   - Contains reference counts for each segment
   - Persisted to disk in the hints file
   - Represents the "last known state"

2. self.index (loaded from index file)
   - Contains mappings of object IDs to (segment, offset) pairs
   - Can be corrupted or lost
   - When corrupted, triggers auto-recovery

The Problem Scenario:
1. Repository has valid data with consistent hints.N and index.N
2. Index file gets corrupted (crash, disk error, etc.)
3. Borg detects corruption and auto-recovers:
   - Loads hints.N (with old reference counts)
   - Rebuilds index by replaying segments
   - Commits the rebuilt index
4. State is now inconsistent IF segments were deleted/lost:
   - self.segments[X] = 10 (from old hints, assumes segment X exists)
   - Segment X was actually deleted/lost
   - self.index has 0 entries for segment X (rebuilt from remaining segments)
5. During compact_segments():
   - Tries to iterate objects in segment X
   - Segment X doesn't exist (was deleted/lost)
   - OR: segment X exists but objects aren't in index (superseded)
   - segments[X] is never decremented
   - segments[X] remains 10 instead of becoming 0
   - Assertion fails!

WHY THE FIX IS CORRECT
----------------------

1. Hints are Advisory, Not Authoritative
   The hints file is an optimization to avoid scanning all segments. It's
   explicitly designed to be rebuildable from scratch by scanning segments.
   Therefore, incorrect hints should not cause a fatal error.

2. Self-Healing Behavior
   By converting the assertion to a warning and allowing compaction to proceed:
   - Compaction completes successfully
   - New hints are written with correct reference counts
   - Repository is automatically healed
   - No manual intervention required

3. Data Safety is Preserved
   The fix does NOT compromise data integrity because:
   - Compaction first copies all live data from segments to new segments
   - Only after all live data is safely copied are segments marked for deletion
   - The index determines what's "live" (authoritative source of truth)
   - Segments are deleted only when they contain no live data (per index)
   - The refcount warning indicates stale hints, not actual data loss risk
   - After compaction, new hints are written with correct counts

4. Consistent with Design Philosophy
   Borg already handles many corruption scenarios gracefully:
   - Missing hints → regenerated from segments
   - Corrupted index → rebuilt from segments
   - Missing segments → detected and handled
   This fix extends that philosophy to hint/index mismatches.

5. Alternative Solutions are Worse
   Other approaches considered:
   a) Crash and require manual intervention
      - Current behavior, user-hostile
      - Requires expert knowledge to fix
   b) Automatically run check --repair
      - Too aggressive, may hide real problems
      - User should decide when to repair
   c) Refuse to compact
      - Leaves repository in degraded state
      - Prevents normal operations

VERIFICATION
------------
The fix has been verified with test cases that reproduce both scenarios:

1. test_missing_segment_in_hints
   - Simulates missing segment files
   - Verifies compact succeeds and updates hints correctly

2. test_index_corruption_with_old_hints
   - Simulates the root cause: corrupted index with old hints
   - Verifies compact succeeds despite reference count mismatch

3. test_subtly_corrupted_hints_without_integrity
   - Existing test updated to expect warning instead of crash
   - Verifies repository remains consistent after compaction

OPERATIONAL IMPACT
------------------
After this fix:
1. Users experiencing this crash can now run `borg compact` successfully
2. The warning message alerts them to the inconsistency
3. They can optionally run `borg check --repair` for peace of mind
4. Repository continues to function normally

The warning message provides enough information for debugging while not
blocking normal operations.

CONCLUSION
----------
Converting the assertion to a warning is the correct fix because:
- It aligns with Borg's design philosophy of graceful degradation
- It enables self-healing behavior
- It preserves data safety
- It improves user experience
- It's consistent with how other corruption scenarios are handled

The assertion was overly strict for a data structure (hints) that is
explicitly designed to be advisory and rebuildable.
2025-12-02 01:35:38 +01:00
TW
f6ac5c4715
Merge pull request #9188 from ThomasWaldmann/update-faq-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
docs: some fixes/update to the FAQ
2025-11-21 17:29:06 +01:00
Thomas Waldmann
3642c7903b
docs: some fixes/update to the FAQ 2025-11-21 17:16:35 +01:00
TW
1ede79bdec
Merge pull request #9143 from ThomasWaldmann/feature/8753-linux-acl-any-text
linux ACL: use acl_to_any_text to avoid libacl name lookups, fixes #8753
2025-11-21 17:05:19 +01:00
Thomas Waldmann
3419d93a17
how to speed up the freebsd ACL code 2025-11-21 13:42:30 +01:00
Thomas Waldmann
e385103a1b
cosmetic: move new acl helper functions closer to other acl code 2025-11-21 13:42:29 +01:00
Thomas Waldmann
964aa8998d
better names 2025-11-21 13:42:27 +01:00
Thomas Waldmann
7e7ea5b289
remove unused acl code (linux) 2025-11-21 13:42:25 +01:00
Thomas Waldmann
798bd9ed0d
refactor id <-> name lookup for monkeypatching
we can't monkeypatch stuff in Cython/C code, so we
go over python module attribute lookup.

that way, we can more easily test some functions that
internally do id<->name lookups.
2025-11-21 13:42:11 +01:00
Thomas Waldmann
6808809818
linux ACL: use acl_to_any_text to avoid libacl name lookups, fixes #8753
Use LRU caches in borg to avoid gazillions of id -> name lookups
(they can be slow, especially for network filesystems).
2025-11-21 13:38:31 +01:00
TW
753ac7088b
Merge pull request #9169 from ThomasWaldmann/netbsd-xattr-support
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
netbsd: xattr support
2025-11-21 13:35:38 +01:00
Thomas Waldmann
bcf3316308
NetBSD: xattr.get_all: catch also errno.EOPNOTSUPP 2025-11-21 12:42:06 +01:00
Thomas Waldmann
0286fb6dc4
NetBSD: copy xattr implementation of FreeBSD, fixes #1332 2025-11-21 12:42:05 +01:00
Thomas Waldmann
9a0122995c
CI: netbsd: enable xattrs on TMPDIR 2025-11-21 12:41:59 +01:00
TW
2c2b0343b2
Merge pull request #9185 from ThomasWaldmann/tests-fs-cleanup-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
Tests fs cleanup (master)
2025-11-21 03:17:59 +01:00
TW
ce9a4826b0
Merge pull request #9186 from ThomasWaldmann/fixes-master
misc small fixes (master)
2025-11-21 03:02:46 +01:00
Thomas Waldmann
1244e0d23a
conftest.py: clean up directly after tests 2025-11-21 02:54:08 +01:00
Thomas Waldmann
4aa63a7866
tests: add some ctx managers for better cleanup 2025-11-21 02:54:06 +01:00
TW
d6c334c4ec
Merge pull request #9184 from ThomasWaldmann/shtab2-master
more shell completion work
2025-11-21 02:52:29 +01:00
Thomas Waldmann
311a5c7e6b
fix rst syntax in changelog 2025-11-21 02:40:29 +01:00
Thomas Waldmann
211bb3225c
lrucache: remove unneeded move_to_end call, already at end 2025-11-21 02:01:46 +01:00
Thomas Waldmann
9b89f3ebd4
crypto: add low_level.pyi stub file 2025-11-21 02:01:43 +01:00
Thomas Waldmann
870f414690
buzhash/buzhash64: initialise all-zero memory more efficiently 2025-11-20 01:35:03 +01:00
Thomas Waldmann
631ef99e3f
chunkers.failing: fix docstring 2025-11-20 01:29:21 +01:00
Thomas Waldmann
bb38a63596
reader.pyi: fix types 2025-11-20 01:26:49 +01:00
Thomas Waldmann
4eb19d9e14
update CHANGES 2025-11-19 17:42:11 +01:00
Thomas Waldmann
895feaa71a
completion: blacken 2025-11-19 17:26:29 +01:00
Thomas Waldmann
5968382c9b
completion: support parse_file_size 2025-11-19 17:21:48 +01:00
Thomas Waldmann
12395967ea
completion: support timestamp 2025-11-19 17:21:47 +01:00
Thomas Waldmann
813585b428
completion: support relative_time_marker_validator 2025-11-19 17:21:46 +01:00
Thomas Waldmann
f787f4bfa5
completion: complete tags with already present ones in repo 2025-11-19 17:21:44 +01:00
Thomas Waldmann
91d0153f90
completion: module docstring 2025-11-19 17:21:43 +01:00
Thomas Waldmann
2b86db8343
completion: archive id descriptions for zsh 2025-11-19 17:21:41 +01:00
Thomas Waldmann
5b5c06b80f
completion: support archive name and id completion 2025-11-19 17:21:40 +01:00
Thomas Waldmann
271a3f2466
completion: support ChunkerParams 2025-11-19 03:07:24 +01:00
Thomas Waldmann
0a0e4e18fd
completion: support PathSpec 2025-11-19 02:59:34 +01:00
Thomas Waldmann
7bfc1bea2e
completion: remove _FN_NAME constants 2025-11-19 02:36:47 +01:00
Thomas Waldmann
9e1d71d517
completion: consolidate funcs into generic _attach_completion 2025-11-19 02:32:26 +01:00
Thomas Waldmann
562a08dda1
completion: support CompressionSpec 2025-11-19 02:22:07 +01:00
Thomas Waldmann
03b0cf0b9b
completion: add support for borg help 2025-11-19 01:46:35 +01:00
Thomas Waldmann
7e5651ad8b
completion: use partial_format 2025-11-18 22:15:17 +01:00
Thomas Waldmann
4dddc43b85
completion: add support for "borg transfer --upgrader" 2025-11-18 21:56:47 +01:00
Thomas Waldmann
3aa7f53b09
completion: support FilesCacheMode type options 2025-11-18 21:47:06 +01:00
Thomas Waldmann
e376d8910c
completion: support SortBySpec type options 2025-11-18 21:36:36 +01:00
Thomas Waldmann
8646c4e045
shtab: require >= 1.8.0
in 1.7.x, zsh completions were still broken, 1.8.0 fixed that.
2025-11-18 17:58:41 +01:00
TW
1b9779b4f3
Merge pull request #9162 from ThomasWaldmann/docs/archive-series-note-8955
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
docs: highlight archive series naming for fast incrementals (fixes #8955)
2025-11-18 02:11:46 +01:00
TW
fd88da0c32
Merge pull request #9179 from ThomasWaldmann/update-changes
update CHANGES
2025-11-18 01:43:27 +01:00
Thomas Waldmann
7548f523e6
update CHANGES 2025-11-17 20:28:50 +01:00
TW
45fbc2f0e3
Merge pull request #9174 from ThomasWaldmann/shtab-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
completion: generate completion scripts for supported shells, fixes #9172
2025-11-17 19:26:04 +01:00
Thomas Waldmann
15f59233b5
completion: borg can now generate completion scripts for supported shells, fixes #9172
Added `shtab` dependency for shell completion functionality:
- bash completion (works).
- zsh completion (known-broken due to iterative/shtab#183).
2025-11-17 18:47:00 +01:00
Thomas Waldmann
71ca0ac6a7
docs: add prominent note to borg create about archive series and files cache; recommend stable NAME per series for performance (#8955) 2025-11-10 02:37:55 +01:00
TW
1373b30ba8
Merge pull request #9161 from ThomasWaldmann/fix-freebsd-tests
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
netbsd/freebsd: work around test issues
2025-11-10 00:57:15 +01:00
Thomas Waldmann
1589489bda
netbsd: work around failure in test_basic_functionality, #8703
I could not find the root cause of this issue, but it is likely a minor
problem with ctime and doesn't affect borg usage much.

So I rather like to have CI on netbsd not failing because of this.
2025-11-09 19:48:10 +01:00
Thomas Waldmann
b929e0c5af
freebsd/netbsd: skip test_hard_link_deletion_and_replacement, #9147, #9153
The test fails on these platforms.

I could not find the root cause of this issue, but it is likely a minor
problem with ctime and doesn't affect borg usage much.

So I rather like to have CI on freebsd/netbsd not failing because of this.

Also: add is_netbsd and is_openbsd to platformflags.
2025-11-09 19:47:32 +01:00
TW
d423dd4acd
Merge pull request #9157 from ThomasWaldmann/ci-tox-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
CI: use  tox (master)
2025-11-09 15:50:54 +01:00
Thomas Waldmann
9f0b3c4ff3
CI: remove "|| true" 2025-11-09 15:12:23 +01:00
Thomas Waldmann
b0ddb15733
CI: rather use tox as test runner
so that pytest options are centrally managed in tox configuration.

let tox build venv and install requirements.

tox does this anyway, so we save some time if we
do not need the venv for other purposes also
(like e.g. building binaries).

Also:
- default XDISTN to "auto". XDISTN is still used by Vagrantfile.
- some other optimisations, like less package manager calls.
- use XDISTN=1 for haiku
- fix freebsd binary build condition
2025-11-08 00:07:19 +01:00
TW
11c880bd76
Merge pull request #9154 from ThomasWaldmann/unify-ci-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
Integrate CI (master)
2025-11-07 19:45:44 +01:00
Thomas Waldmann
a3e6f63e2a
CI: integrate all OSes into ci.yml 2025-11-07 18:59:15 +01:00
TW
eca12e101e
Merge pull request #9151 from ThomasWaldmann/granularity_sleep-master
add granularity_sleep, fixes #9150
2025-11-07 17:49:50 +01:00
Thomas Waldmann
199f708b4f
add granularity_sleep, fixes #9150 2025-11-07 17:17:26 +01:00
TW
4e22bd595d
Merge pull request #9149 from ThomasWaldmann/ci-bsd-master
CI: add *BSD and Haiku OS
2025-11-07 17:15:47 +01:00
Thomas Waldmann
7d43398a17
testsuite: improve haiku compatibility
haiku does not have os.mknod.
and it looks like it does not have hardlinks either.
2025-11-07 15:25:05 +01:00
Thomas Waldmann
63e582be6a
CI: add Haiku workflow in haiku.yml 2025-11-07 12:59:04 +01:00
Thomas Waldmann
6dee31c968
CI: add NetBSD workflow in netbsd.yml 2025-11-06 22:35:09 +01:00
Thomas Waldmann
13d6e774a0
CI: add OpenBSD workflow in openbsd.yml 2025-11-06 22:35:08 +01:00
Thomas Waldmann
5855ca4135
CI: add FreeBSD workflow in freebsd.yml 2025-11-06 22:34:59 +01:00
TW
c9484a9f3e
Merge pull request #9142 from ThomasWaldmann/py310-improvements-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / posix_tests (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
refactor: update type hints to use Python 3.10+ syntax
2025-11-03 23:44:38 +01:00
TW
1b4a380454
Merge pull request #9062 from ThomasWaldmann/port-8998-master
diff: --sort-by=field[,field,...], fixes #8998
2025-11-03 23:42:29 +01:00
Thomas Waldmann
dec2eb745b
refactor: update type hints to use Python 3.10+ syntax 2025-11-03 23:28:08 +01:00
TW
9c8340597b
Merge pull request #9141 from ThomasWaldmann/py39-news-master
py39 news (master)
2025-11-03 22:52:49 +01:00
Thomas Waldmann
6157c4b968
refactor: use .remove(prefix|suffix) str methods (py39) 2025-11-03 22:35:37 +01:00
Thomas Waldmann
8f40baa34b
refactor: use |= operator for dictionary updates (py39) 2025-11-03 22:18:26 +01:00
TW
3bad2de41f
Merge pull request #9139 from ThomasWaldmann/dynamic-code-analysis-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / posix_tests (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
CI: do dynamic code analysis, #6819
2025-11-03 21:19:48 +01:00
Thomas Waldmann
68590e35f0
tests: use context manager when opening files in patterns_test 2025-11-03 20:54:09 +01:00
Thomas Waldmann
add19da678
CI: do dynamic code analysis, #6819
Use:
- AddressSanitizer ASan
- UndefinedBehaviorSanitizer UBSan
2025-11-03 20:42:13 +01:00
Thomas Waldmann
5c44dad125
diff --sort-by: enhanced sorting, fixes #8998
use borg diff --sort-by=spec1,spec2,spec2 for enhanced sorting.

remove legacy --sort behaviour (sort by path), this was deprecated
since 1.4.2.

Co-authored-by: Daniel Rudolf <github.com@daniel-rudolf.de>

This is a port of #9005 to master branch.
2025-11-03 19:25:02 +01:00
Thomas Waldmann
51ddfaf9c1
preprocess_args: fix option name matching
previously, it also matched on --sort-by when it only should have matched on --sort.
2025-11-03 17:51:05 +01:00
TW
d15e8ca6c5
Merge pull request #9138 from ThomasWaldmann/update-changes
update CHANGES
2025-11-03 17:42:30 +01:00
Thomas Waldmann
352cf7bdcc
update CHANGES 2025-11-03 17:33:19 +01:00
TW
30fb8266a0
Merge pull request #9136 from ThomasWaldmann/issue-9134-attestations2
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / posix_tests (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
do binary build and gh attestation based on a tag push
2025-11-02 19:27:12 +01:00
Thomas Waldmann
eba3f8cfb0
docs: update attestation instructions in binary readme 2025-11-02 18:48:08 +01:00
Thomas Waldmann
4be4609445
CI: run also for tag pushes
Simplifies tag-based binary building and attestation.
2025-11-02 18:45:35 +01:00
TW
f24adf5484
Merge pull request #9135 from ThomasWaldmann/issue-9134-attestations
CI: add GitHub artifact attestations for release binaries, fixes #9134 (master)
2025-11-02 17:27:25 +01:00
Thomas Waldmann
a5c8aed7cf
CI: add GitHub artifact attestations for release binaries (fixes #9134)
- grant id-token and attestations permissions to posix_tests job
- add actions/attest-build-provenance@v1 step for built artifacts

This publishes SLSA-style provenance for our tag builds (only when binaries
are produced) so users can verify the origin of downloaded borg binaries.
2025-11-02 17:17:23 +01:00
TW
b9508a8f55
Merge pull request #9133 from f-froehlich/master
Bugfix: local path regex should not match s3 and b2 urls
2025-11-02 15:52:43 +01:00
Fabian Fröhlich
9a5d2bc3ce Bugfix: local path regex should not match s3 and b2 urls 2025-11-02 14:40:46 +01:00
TW
4cffced692
Merge pull request #9131 from ThomasWaldmann/port-9122-to-master-openindiana-doclinks-3.10
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / posix_tests (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
drop python 3.9, more work was needed
2025-11-01 20:49:14 +01:00
Thomas Waldmann
c41d1b1fe2
drop python 3.9, more work was needed 2025-11-01 20:32:59 +01:00
TW
bcbff56bde
Merge pull request #9130 from ThomasWaldmann/port-9121-to-master
Release process updates (master)
2025-11-01 20:11:54 +01:00
Thomas Waldmann
3fe9102b29
update binary readme 2025-11-01 20:02:22 +01:00
Thomas Waldmann
943e68b20e
docs: release binaries are built on GitHub now
bad:
- no *BSD testing and FreeBSD binary building on gh
- binaries not signed by me, because they are built on gh

good:
- for linux intel/amd64 and arm64, built on ubuntu
- for macOS intel and arm64, built on a relatively recent macOS
- I can get rid of that ancient macOS VM I used for building.
- the source code distribution (sdist) is still made locally on
  my machine and thus signed with my signature (*.asc).
2025-11-01 20:02:20 +01:00
Thomas Waldmann
471e302024
upload-pypi: use borg-specific repository names
so it finds the right api token in .pypirc
2025-11-01 19:57:26 +01:00
TW
df17837a58
Merge pull request #9129 from ThomasWaldmann/vagrant-updates-master-port-9117
Vagrant updates (master port of #9117)
2025-11-01 19:44:56 +01:00
TW
47b3611bcb
Merge pull request #9128 from ThomasWaldmann/port/9116-to-master
extract: fs flags: use get/set to influence only specific flags, #9039, FreeBSD only (master)
2025-11-01 19:37:19 +01:00
Thomas Waldmann
da724102c1
vagrant: fix openindiana box
- working nameserver
- run pkg update and reboot, otherwise it does not let us
  install gcc-13 and git.
2025-11-01 19:35:49 +01:00
Thomas Waldmann
17d7a0a110
vagrant: add a OpenBSD 7.7 box
The base box has an invalid hostname and no comp package installed,
so we need to fix that.
2025-11-01 19:35:36 +01:00
Thomas Waldmann
ecfdc76eee
extract: fs flags: use get/set to influence only specific flags, #9039, FreeBSD only. 2025-11-01 19:09:36 +01:00
TW
c3506c3063
Merge pull request #9127 from ThomasWaldmann/port/9115-to-master
extract: fs flags: use get/set to influence only specific flags, #9039, macOS only (master)
2025-11-01 18:44:07 +01:00
Thomas Waldmann
44ac21ff29
extract: fs flags: use get/set to influence only specific flags, #9039, macOS only.
preserve UF_COMPRESSED and SF_DATALESS when restoring flags,
get-modify-set in macOS set_flags, keeping system-managed read-only flags.

(cherry picked from commit 83571aa00d)
2025-11-01 18:11:42 +01:00
TW
ad89feb0ce
Merge pull request #9125 from ThomasWaldmann/port-9111-to-master
BORG_MSGPACK_VERSION_CHECK=no to disable the version check, fixes #9109
2025-11-01 17:30:00 +01:00
Thomas Waldmann
7e6dea9408
BORG_MSGPACK_VERSION_CHECK=no to disable the version check, fixes #9109
(cherry picked from commit 2d63dc9a4f)
2025-11-01 16:48:00 +01:00
TW
2a57c90109
Merge pull request #9113 from borgbackup/dependabot/pip/requirements.d/pip-25.3
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / posix_tests (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
build(deps-dev): bump pip from 25.2 to 25.3 in /requirements.d
2025-10-30 11:19:50 +01:00
dependabot[bot]
a4b576914c
build(deps-dev): bump pip from 25.2 to 25.3 in /requirements.d
Bumps [pip](https://github.com/pypa/pip) from 25.2 to 25.3.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/25.2...25.3)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: '25.3'
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-30 09:53:42 +00:00
TW
50b50e4ba4
Merge pull request #9107 from ThomasWaldmann/port-9096-to-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / posix_tests (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
json: include archive keys in JSON lines when requested via --format, fixes #9095
2025-10-28 00:16:56 +01:00
Thomas Waldmann
5fef3f0118
json: include archive keys in JSON lines when requested via --format, fixes #9095
Add a test to ensure correct behavior.

(cherry picked from commit 0c27bd3047)
2025-10-27 23:48:48 +01:00
TW
736f2bf4ca
Merge pull request #9108 from ThomasWaldmann/fix-src-formatting-master
cosmetic fix: black format src
2025-10-27 23:47:38 +01:00
Thomas Waldmann
9e2d8492e1
cosmetic fix: black format src 2025-10-27 23:08:21 +01:00
TW
8c1d919095
Merge pull request #9097 from valtron/fix-win-fileurl
Fix windows file URLs
2025-10-27 21:18:36 +01:00
valtron
1f76b6a21e linter 2025-10-26 23:20:49 -06:00
valtron
fcc5a5beff ensure valid file urls are created from windows paths 2025-10-25 12:24:30 -06:00
TW
ca706652d4
Merge pull request #9093 from ThomasWaldmann/port/master-9089-set_flags
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / posix_tests (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
extract: misc. fixes for restoring linux fs flags, port to master
2025-10-25 03:32:56 +02:00
valtron
cea7744276 add missing guards around preexec_fn=ignore_sigint 2025-10-23 20:28:28 -06:00
Thomas Waldmann
aea883b700
set_flags: remove compression flag
This flag needs to be set BEFORE writing to the file.
But "borg extract" sets the flags last (to support IMMUTABLE),
thus the compression flag would not work as expected.

(cherry picked from commit 56dda84162)
2025-10-21 03:02:35 +02:00
Thomas Waldmann
a6b6d35b30
set_flags: use get/set to only influence specific flags, fixes #9039
Linux platform only.

(cherry picked from commit 9214197a2c)

set_flags: if getting the flags fails, better give up than
corrupting them.

Thanks to Earnestly for the feedback on IRC.

(cherry picked from commit 9c600a9571)
2025-10-21 03:01:10 +02:00
TW
d0dabe69a8
Merge pull request #9087 from ThomasWaldmann/update-changes-master
Some checks failed
Lint / lint (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
update CHANGES
2025-10-16 17:46:29 +02:00
Thomas Waldmann
73e2543b53
update CHANGES 2025-10-16 13:34:27 +02:00
TW
0277d8b635
Merge pull request #9086 from ThomasWaldmann/patterns-style-master
Some checks failed
Lint / lint (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CI / posix_tests (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
patterns: clarify scope of default pattern style, fixes #9004
2025-10-16 11:17:50 +02:00
TW
5df6021bc2
Merge pull request #9084 from ThomasWaldmann/non-tty-progress-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / posix_tests (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
improved tty-less progress reporting (master)
2025-10-16 03:21:17 +02:00
TW
140ff56135
Merge pull request #9085 from ThomasWaldmann/mount-show-rc-master
mount --show-rc: display main process rc, fixes #8308
2025-10-16 03:20:37 +02:00
Thomas Waldmann
a32989071b
do_show_rc: suppress bandit warning
see the comment in line 201.
2025-10-16 02:46:08 +02:00
Thomas Waldmann
3a9088f501
patterns: clarify scope of default pattern style, fixes #9004 2025-10-16 02:39:42 +02:00
Thomas Waldmann
a775517f08
mount --show-rc: display main process rc, fixes #8308
when borg mount is used without -f/--foreground (so that the FUSE
borg process was started daemonized in the background), it did not
display the rc of the main process, even when --show-rc was used.

now it does display the rc of the main process.

note that this is rather a consistency fix than being super useful,
because the main "action" happens in the background daemon process,
not in the main process.
2025-10-16 02:26:06 +02:00
Thomas Waldmann
8cbe4b8d48
improved tty-less progress reporting
Previously when running borg in a systemd service (and similar when piping to
a file and co.), these problems occurred:

- The carriage return both made it so that journald interpreted the output as
  binary, therefore not printing the text, while also not buffering
  correctly, so that log output was only available every once in a while
  in the form [40k blob data]. This can partially be worked around by
  using `journalctl -a` to view the logs, which at least prints the text,
  though only sporadically.

- The path was getting truncated to a short length, since the default
  get_terminal_size returns a column width of 80, which isn't relevant
  when printing to e.g. journald.

This commit fixes this by introducing a new code path for when stream is
not a tty, which always prints the full paths and ends lines with a linefeed.

This is based on unfinished PR #8939 by @infinisil, thanks for your suggestion!

Forward port of PR #9055 to master.
2025-10-16 01:59:43 +02:00
TW
4b28cfdae8
Merge pull request #9083 from ThomasWaldmann/fix-7144-master
docs: improve borg help patterns (port of #9054 to master)
2025-10-16 01:12:08 +02:00
TW
9c98ab5943
Merge pull request #9082 from ThomasWaldmann/build-binaries-on-gh-master
build binaries on github
2025-10-16 00:53:48 +02:00
Thomas Waldmann
2dd80e1ee9
docs: improve borg help patterns (port of #9054 to master); fixes #7144 2025-10-16 00:47:15 +02:00
Thomas Waldmann
c4a9582fdf
build binaries on github
also:

- speed up CI for PRs
- update README for binaries
2025-10-16 00:37:46 +02:00
TW
160a966044
Merge pull request #9081 from ThomasWaldmann/chunker-fuzzing-master
add fuzzing tests for chunkers
2025-10-16 00:26:23 +02:00
TW
20d6b1060b
Merge pull request #9080 from ThomasWaldmann/drop-macos-vm-master
vagrant: drop macOS 10.12 VM
2025-10-15 23:55:00 +02:00
TW
8bc39e7aac
Merge pull request #9079 from ThomasWaldmann/brewfile-master
Brewfile: use openssl@3
2025-10-15 23:54:42 +02:00
Thomas Waldmann
084750ad48
add fuzzing tests for chunkers 2025-10-15 23:48:13 +02:00
Thomas Waldmann
48640e78d0
vagrant: drop macOS 10.12 VM
The VM was used for local macOS testing and
also for building a macOS intel fat binary.

We also do macOS CI testing on GitHub and I
recently added binary building on GitHub for
Apple Silicon and Intel.

The macOS 10 VM was very outdated, super slow
and a pain to use. I didn't succeed in building
a recent macOS vagrant VM, so we'll just use
GitHub from now on...
2025-10-15 22:47:25 +02:00
Thomas Waldmann
0c37c387dc
Brewfile: use openssl@3
@3.0 is old, @3 installs something recent (or
even that is installed already).
2025-10-15 22:44:41 +02:00
Thomas Waldmann
f401ca00f9
backport action: remove debugging step
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.10, mypy) (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.10, py310-fuse2) (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.11, docs) (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.11, py311-fuse3) (push) Has been cancelled
CI / linux (ubuntu-24.04, 3.12, py312-fuse3) (push) Has been cancelled
CI / linux (ubuntu-24.04, 3.13, py313-fuse3) (push) Has been cancelled
CI / linux (ubuntu-24.04, 3.14, py314-fuse3) (push) Has been cancelled
CI / macOS (macos-14, 3.11, py311-none) (push) Has been cancelled
CI / windows (push) Has been cancelled
2025-10-12 16:24:36 +02:00
TW
e4e62c964d
Merge pull request #9060 from ThomasWaldmann/fix-backport-action
backport action: fix label_pattern
2025-10-12 16:19:56 +02:00
Thomas Waldmann
ee4083eaa7
backport action: fix label_pattern 2025-10-12 16:19:19 +02:00
TW
cb8f6ad775
Merge pull request #9059 from ThomasWaldmann/backport-action-debugging
debug backport action
2025-10-12 16:07:09 +02:00
Thomas Waldmann
126dc4974a
debug backport action 2025-10-12 16:06:25 +02:00
TW
b988f9c3a2
Merge pull request #9050 from ThomasWaldmann/keyfile-same-repo-path-master
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.10, mypy) (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.10, py310-fuse2) (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.11, docs) (push) Has been cancelled
CI / linux (ubuntu-22.04, 3.11, py311-fuse3) (push) Has been cancelled
CI / linux (ubuntu-24.04, 3.12, py312-fuse3) (push) Has been cancelled
CI / linux (ubuntu-24.04, 3.13, py313-fuse3) (push) Has been cancelled
CI / linux (ubuntu-24.04, 3.14, py314-fuse3) (push) Has been cancelled
CI / macOS (macos-14, 3.11, py311-none) (push) Has been cancelled
CI / windows (push) Has been cancelled
docs: What happens when a new keyfile repo is created at the same path?
2025-10-10 20:24:54 +02:00
TW
dbf321a2b2
Merge pull request #9051 from ThomasWaldmann/borg-mount-debugging
docs: how to debug borg mount, fixes #5461
2025-10-10 20:19:29 +02:00
Thomas Waldmann
0031b73b2b
docs: how to debug borg mount, fixes #5461 2025-10-10 14:52:10 +02:00
Thomas Waldmann
d0dab94c07
docs: What happens when a new keyfile repo is created at the same path?, fixes #6230
Also add a test.
2025-10-10 14:24:05 +02:00
TW
0e45c9dc06
Merge pull request #8590 from Atemu/document-extract-wildcard
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / linux (ubuntu-22.04, 3.10, mypy) (push) Blocked by required conditions
CI / linux (ubuntu-22.04, 3.10, py310-fuse2) (push) Blocked by required conditions
CI / linux (ubuntu-22.04, 3.11, docs) (push) Blocked by required conditions
CI / linux (ubuntu-22.04, 3.11, py311-fuse3) (push) Blocked by required conditions
CI / linux (ubuntu-24.04, 3.12, py312-fuse3) (push) Blocked by required conditions
CI / linux (ubuntu-24.04, 3.13, py313-fuse3) (push) Blocked by required conditions
CI / linux (ubuntu-24.04, 3.14, py314-fuse3) (push) Blocked by required conditions
CI / macOS (macos-14, 3.11, py311-none) (push) Blocked by required conditions
CI / windows (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
extract: document how to use wildcards in PATHs, fixes #8589
2025-10-10 13:28:17 +02:00
Atemu
fdabbd7633
extract: document how to use wildcards in PATHs
Fixes https://github.com/borgbackup/borg/issues/8589
2025-10-10 11:20:08 +02:00
TW
3ebae359ae
Merge pull request #9045 from ThomasWaldmann/fix-9042-setuptools-min
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / linux (ubuntu-22.04, 3.10, mypy) (push) Blocked by required conditions
CI / linux (ubuntu-22.04, 3.10, py310-fuse2) (push) Blocked by required conditions
CI / linux (ubuntu-22.04, 3.11, docs) (push) Blocked by required conditions
CI / linux (ubuntu-22.04, 3.11, py311-fuse3) (push) Blocked by required conditions
CI / linux (ubuntu-24.04, 3.12, py312-fuse3) (push) Blocked by required conditions
CI / linux (ubuntu-24.04, 3.13, py313-fuse3) (push) Blocked by required conditions
CI / linux (ubuntu-24.04, 3.14, py314-fuse3) (push) Blocked by required conditions
CI / macOS (macos-14, 3.11, py311-none) (push) Blocked by required conditions
CI / windows (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
build: require setuptools>=78.1.1 (fixes #9042)
2025-10-09 18:47:02 +02:00
Thomas Waldmann
16e7039dbe
build: require setuptools>=78.1.1 to address GHSA-5rjg-fvgr-3xxf (closes #9042) 2025-10-09 17:47:03 +02:00
TW
46d139da81
Merge pull request #9043 from ThomasWaldmann/py314
Python 3.14 release support, use latest msgpack and cython
2025-10-09 14:30:51 +02:00
Thomas Waldmann
7a7f0a8279
vagrant: use py 3.13.8 to build the binary 2025-10-09 13:19:28 +02:00
Thomas Waldmann
4b33f5412e
Cython 3.1.4 2025-10-09 13:19:26 +02:00
Thomas Waldmann
da58d92aa6
allow msgpack 1.1.2
1.1.2 provides wheels for py 3.14.
2025-10-09 13:16:54 +02:00
Thomas Waldmann
947007c567
test on Python 3.14 (w/o -dev) 2025-10-09 12:43:16 +02:00
TW
1c6ef7a200
Merge pull request #9031 from cr1901/relax-hl-main
Add tests for diff output of archives with hard links.
2025-10-02 18:10:21 +02:00
TW
6176019550
Merge pull request #9033 from ThomasWaldmann/fix-9032
create: add exception handler for NODUMP excluded dirs, fixes #9032
2025-10-02 13:49:33 +02:00
TW
a8e10c4a5c
Merge pull request #9034 from ThomasWaldmann/format-inode
list --format: add "inode" support to formatter, add tests
2025-10-02 12:33:06 +02:00
William D. Jones
4951e1001a Modify hard-link tests based on upstream feedback. 2025-09-30 20:50:31 -04:00
Thomas Waldmann
b2798ecd3a
create: add exception handler for NODUMP excluded dirs, fixes #9032 2025-10-01 00:59:43 +02:00
Thomas Waldmann
0f861d5a91
list --format: add "inode" support to formatter, add tests 2025-10-01 00:43:31 +02:00
Thomas Waldmann
b27dba670c
add test for #9032 2025-09-30 19:32:22 +02:00
William D. Jones
a396e7db2b Add tests for diff output of archives with hard links. 2025-09-30 12:56:15 -04:00
TW
0ee5d6f018
Merge pull request #9028 from borgbackup/dependabot/pip/requirements.d/pip-25.2
build(deps-dev): bump pip from 25.1.1 to 25.2 in /requirements.d
2025-09-25 04:45:54 +02:00
dependabot[bot]
9736c72941
build(deps-dev): bump pip from 25.1.1 to 25.2 in /requirements.d
Bumps [pip](https://github.com/pypa/pip) from 25.1.1 to 25.2.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/25.1.1...25.2)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: '25.2'
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-24 22:43:44 +00:00
TW
9f18b7dad5
Merge pull request #9026 from ThomasWaldmann/backport-action
github actions: use korthout/backport-action
2025-09-23 19:39:54 +02:00
Thomas Waldmann
d27409784e
github actions: use korthout/backport-action 2025-09-23 18:53:08 +02:00
TW
07183f1d2a
Merge pull request #8999 from ThomasWaldmann/typos-grammar-master
fix typos and grammar (master)
2025-09-23 17:31:06 +02:00
Thomas Waldmann
5aa536df4c
spelling: hard link(s) 2025-09-23 15:17:35 +02:00
Thomas Waldmann
2c7bec0149
manual corrections/reverts 2025-09-23 14:56:35 +02:00
Thomas Waldmann
3120f9cd1c
fixed typos and grammar (AI)
this was done by Junie AI.
2025-09-23 14:56:23 +02:00
Thomas Waldmann
ff7f2ab2ab
binary readme: fix typos and grammar 2025-09-23 14:53:56 +02:00
Thomas Waldmann
dd06c07789
paperkey.html: fix typos, grammar, html structure
The original markup included a paragraph element wrapping a block-level pre element, which is invalid per HTML’s content model (a p can only contain phrasing content; pre is flow content).

The fix separated text and pre blocks into valid sibling elements, ensuring no pre is nested inside a p.
2025-09-23 14:53:54 +02:00
Thomas Waldmann
ed73aa19d2
README: fix typos and grammar 2025-09-23 14:53:53 +02:00
Thomas Waldmann
f9ec04ddf6
github workflows: fix typos and grammar 2025-09-23 14:53:51 +02:00
Thomas Waldmann
adbad12478
github templates: fix typos and grammar 2025-09-23 14:53:49 +02:00
TW
3aee110c44
Merge pull request #9025 from ThomasWaldmann/fix-readonly-tests-master
read_only CM: skip test if cmd_immutable is unsuccessful, fixes #9021
2025-09-22 22:01:16 +02:00
TW
3bff0c31cf
Merge pull request #9024 from ThomasWaldmann/transfer-corrupts-src-repo
fix borg transfer corrupting the src repo index
2025-09-22 21:08:04 +02:00
Thomas Waldmann
e5a5d67bff
read_only CM: skip test if cmd_immutable is unsuccessful, fixes #9021 2025-09-22 21:01:01 +02:00
Thomas Waldmann
4a0b71cad1
legacyrepository: remove auto_recover, see #9022
we only read from borg 1.x legacy repos, we must not
try to "fix" them (users can use borg1 check --repair).

had to remove some tests that relied on this "feature".
2025-09-22 19:56:51 +02:00
Thomas Waldmann
d955f8ce75
fix reading borg 1.x repo index, fixes #9022
2 fixes:
- add code to update/verify the HashHeader integrity hash. this code was
  missing and led to FileIntegrityError on the borg 1.x repo index.
- when reading a non-compact borg 1.x hash table from disk (like the borg
  repo index), only add the "used" buckets to the in-memory hashtable,
  but not the unused/tombstone buckets.

The corruption described in #9022 was happening like this:
- borg failed to read the repo index, because the integrity check failed
- due to open_index(..., auto_recover=True), it tried to "fix" it by
  writing an empty hash table to disk. borg 1.x usually then rebuilt the
  index, but somehow this wasn't happening for the user in #9022.
2025-09-22 19:56:49 +02:00
Thomas Waldmann
9cbd0ca461
transfer: add test for unexpected src repo index change, #9022 2025-09-22 19:36:54 +02:00
TW
5b85f47618
Merge pull request #9015 from PhrozenByte/docs-build-src-version
Update install docs to include `SETUPTOOLS_SCM_PRETEND_VERSION`
2025-09-21 15:43:12 +02:00
TW
e42ec86e67
Merge pull request #9018 from PhrozenByte/docs-arch-dev-deps
Add Arch Linux to installing from source docs
2025-09-21 15:38:19 +02:00
Daniel Rudolf
5b765b9ec5
Add Arch Linux to installing from source docs
Note that Arch Linux usually has no separate `-dev` packages, but ships development headers with the normal package.
2025-09-19 16:55:45 +02:00
Daniel Rudolf
8f63d984be
Update install docs to include SETUPTOOLS_SCM_PRETEND_VERSION 2025-09-13 20:37:52 +02:00
TW
7b0b334cb4
Merge pull request #9013 from ThomasWaldmann/remote-repo-test
tests: add sftp/rclone/s3 repo testing
2025-09-12 21:35:39 +02:00
Thomas Waldmann
b0a680bb2a
tests: add sftp/rclone/s3 repo testing 2025-09-11 23:57:48 +02:00
TW
3e44cb7fd0
Merge pull request #9006 from mikemrm/support-borgstore-s3-backend
feat(backend): enable s3 support using borgstore
2025-09-11 23:21:20 +02:00
TW
bee82e2bb1
Merge pull request #9011 from ThomasWaldmann/ci-s3-sftp-testing
CI: add local servers for s3 and sftp testing
2025-09-11 23:16:38 +02:00
Thomas Waldmann
b5d0261222
CI: add local servers for s3 and sftp testing 2025-09-11 14:40:24 +02:00
Mike Mason
0207c2176e
feat(backend): enable s3 support using borgstore
Borg2 documentation mentions the support for the s3 backend however,
borg was missing the parsing bits for an s3 repo.

This updates the Location parser to parse the s3 url using the same
logic as borgstore.

Note: borgstore should be installed with the s3 dependencies in order
for the s3 backend to work.

Signed-off-by: Mike Mason <github@mikemrm.com>
2025-09-09 22:56:57 -05:00
TW
332ef28c7e
Merge pull request #8988 from ThomasWaldmann/vagrant-debian-testing-master
Vagrant: debian testing/trixie box (master)
2025-08-17 16:50:52 +02:00
dataprolet
5b01535768
Adds systemd-inhibit and examples (#8989) 2025-08-11 15:06:36 +02:00
TW
769e5e5e8a
Merge pull request #8987 from ThomasWaldmann/fuse-testing-config-master
FUSE testing config (master)
2025-08-09 16:57:36 +02:00
Thomas Waldmann
85e0e05f35
vagrant: add debian trixie box
currently still known as "testing",
but soon to be released.
2025-08-09 16:28:47 +02:00
Thomas Waldmann
a88bda6fbc
pyproject.toml: correctly define test envs for fuse testing
Looks like the toml config format of tox does not yet support
an easier way for generative test environments.
2025-08-09 16:07:05 +02:00
TW
498d836aea
Merge pull request #8980 from ThomasWaldmann/save_space-test_create_big-master
save space in test_create_* tests
2025-08-06 16:17:04 +02:00
Thomas Waldmann
38f97d65df
save space in test_create_* tests 2025-08-06 14:56:18 +02:00
TW
6a83ea1c60
Merge pull request #8856 from ThomasWaldmann/tar-posix-ACLs
export-tar/import-tar: support for POSIX ACLs
2025-08-05 16:21:55 +02:00
Thomas Waldmann
fe5a991c8d
export-tar/import-tar: support for POSIX ACLs (PAX format)
Implemented handling of POSIX access and default ACLs in tar files.
New keys, `SCHILY.acl.access` and `SCHILY.acl.default`, are used
to store these ACLs in the tar PAX headers.
2025-08-03 22:12:32 +02:00
TW
eb136a3d17
Merge pull request #8972 from ThomasWaldmann/rel200b19
Release 2.0.0b19
2025-08-02 14:37:12 +02:00
Thomas Waldmann
bf7a1e4a61
vagrant: use pyinstaller 6.14.2 for binary building
this is for future betas, not including b19.
2025-08-02 12:07:39 +02:00
Thomas Waldmann
49d84e3920
vagrant: use python 3.13.5 for binary building and tests
this is for future betas, not including b19.
2025-08-02 12:05:42 +02:00
Thomas Waldmann
4905fd8bea
update CHANGES 2025-08-02 11:21:28 +02:00
Thomas Waldmann
f327af11a6
build_usage build_man 2025-08-02 11:12:20 +02:00
TW
547f7ec338
Merge pull request #8971 from ThomasWaldmann/files-changed-option-master
create --files-changed=MODE option
2025-08-02 11:09:19 +02:00
Thomas Waldmann
b27df15b36
create --files-changed=MODE option
control how borg detects whether a file has changed while it was backed up, valid modes are ctime, mtime or disabled.

ctime is the safest mode and the default.

mtime can be useful if ctime does not work correctly for some reason
(e.g. OneDrive files change their ctime without the user changing the file).

disabled (= disabling change detection) is not recommended as it could lead to
inconsistent backups. Only use if you know what you are doing.
2025-08-02 09:49:04 +02:00
TW
e40298e30d
Merge pull request #8970 from ThomasWaldmann/update-changes
update CHANGES
2025-08-01 21:49:52 +02:00
TW
8659895f30
Merge pull request #8969 from ThomasWaldmann/fix-8966
to_key_filename: raise length limit to 120, fixes #8966
2025-08-01 21:49:26 +02:00
Thomas Waldmann
1f75c40d34
update CHANGES 2025-08-01 20:19:04 +02:00
Thomas Waldmann
5328c2885b
to_key_filename: raise length limit to 120, fixes #8966
it used to be 100, but that caused test failures on
some systems with deep build directories.
2025-08-01 20:15:05 +02:00
TW
53c0d0a449
Merge pull request #8964 from ThomasWaldmann/issue-8963
fixing reader bug, fixes #8963
2025-07-30 17:36:03 +02:00
Thomas Waldmann
9877fe91c9
reader: fix corruption issue "forgetting" all-zero bytestrings, fixes #8963 2025-07-28 23:14:30 +02:00
Thomas Waldmann
85582f1b13
add a (failing) test reproducing #8963 2025-07-28 23:14:28 +02:00
TW
c04707e25e
Merge pull request #8960 from ThomasWaldmann/py314-cprofile-testing
remove test skipping for py314
2025-07-23 10:56:33 +02:00
Thomas Waldmann
aedbab4fd1
remove test skipping for py314 2025-07-22 23:51:31 +02:00
TW
a8fb2d09e6
Merge pull request #8944 from ThomasWaldmann/tar-use-normalized-path-master
import-tar: normalize and sanitize tarinfo.linkname (master)
2025-06-28 14:11:21 +02:00
Thomas Waldmann
04ea0b2861
import-tar: normalize the tarinfo name/linkname when used as hlm key
also: when printing the path, use the already normalized item.path.
2025-06-28 12:06:28 +02:00
TW
0118fae5fe
Merge pull request #8943 from ThomasWaldmann/import-tar-dotslash-master
import-tar: fix the dotslash issue, add test
2025-06-27 14:03:18 +02:00
Thomas Waldmann
628b6ba45c
import-tar: fix the dotslash issue, add test 2025-06-27 12:26:28 +02:00
TW
f8735e68a9
Merge pull request #8936 from ThomasWaldmann/buzhash-micro-opt
buzhash* chunker: use window_size not self.window_size
2025-06-21 21:59:14 +02:00
Thomas Waldmann
a7f8070ff9
buzhash* chunker: use window_size not self.window_size 2025-06-21 19:37:39 +02:00
TW
515019846f
Merge pull request #8931 from ThomasWaldmann/rel200b18
Release 2.0.0b18
2025-06-19 15:53:28 +02:00
Thomas Waldmann
2aed9d4dab
vagrant: use Python 3.12.11 2025-06-18 22:59:38 +02:00
Thomas Waldmann
0324395baf
pyinstaller spec: avoid pkg_resources warning 2025-06-18 22:35:38 +02:00
Thomas Waldmann
eefbee7667
update development.lock.txt
some stuff did not fit together.
2025-06-18 20:27:20 +02:00
Thomas Waldmann
9b26b1011a
build_usage build_man 2025-06-18 17:35:37 +02:00
Thomas Waldmann
840c0c4788
update CHANGES 2025-06-18 17:31:57 +02:00
TW
9485fc05c6
Merge pull request #8930 from ThomasWaldmann/buzhash-optimizations-cleanups
setup.py: cosmetic updates for chunkers
2025-06-18 16:47:47 +02:00
Thomas Waldmann
c9cc5c4c19
setup.py: cosmetic updates for chunkers
- remove outdated comment
- remove undef'ing of NDEBUG for chunks
2025-06-18 15:34:20 +02:00
TW
963fc6b869
Merge pull request #8929 from ThomasWaldmann/issue-8928
compact: fix cleaning archives directory
2025-06-17 17:01:30 +02:00
Thomas Waldmann
4359c41d9b
compact: fix cleaning archives directory
- catch correct exception: ObjectNotFound
- use logger.warning, improve error msg
2025-06-16 23:14:10 +02:00
TW
ba7dbd52f4
Merge pull request #8924 from ThomasWaldmann/bh64-balanced-bit-distribution
buzhash64: deterministically create a balanced bh table
2025-06-16 22:33:03 +02:00
Thomas Waldmann
3617b63336
buzhash64: use own CSPRNG 2025-06-16 19:28:01 +02:00
Thomas Waldmann
bb7a4647ea
add own CSPRNG based on AES256-CTR and a 256bit key/seed.
the stuff in Python stdlib "random.Random" is not cryptographically strong
and the stuff in Python stdlib "secrets" can't be seeded and does not
offer shuffle.
2025-06-16 19:27:59 +02:00
TW
ffe55d2697
Merge pull request #8923 from ThomasWaldmann/coverage-pyproject-master
coverage: use pyproject.toml (master)
2025-06-16 19:06:54 +02:00
Thomas Waldmann
91c8054215
require coverage[toml] to support pyproject.toml on Python < 3.11 2025-06-16 17:45:49 +02:00
Thomas Waldmann
e1510f0c73
coverage: move settings from .coveragerc to pyproject.toml 2025-06-16 17:45:45 +02:00
Thomas Waldmann
17a5326c35
chunker benchmarks: do not measure chunker creation time
Chunker creation can be slow (e.g. for buzhash64), but is only done once.
2025-06-15 12:22:50 +02:00
Thomas Waldmann
d48c9643e8
buzhash64: deterministically create a balanced bh table
the previous approach had cryptographic strength randomness, but a precise
50:50 0/1 bit distribution per bit position in the table was not assured.

now this is always the case due to the way how the table is constructed.
2025-06-15 11:33:40 +02:00
TW
d04f41b886
Merge pull request #8922 from ThomasWaldmann/update-changes
update CHANGES
2025-06-14 19:52:03 +02:00
Thomas Waldmann
1e40d74f88
update CHANGES 2025-06-14 17:20:53 +02:00
TW
7b9fe15b5d
Merge pull request #8919 from ThomasWaldmann/py314
support Python 3.14
2025-06-12 21:55:56 +02:00
Thomas Waldmann
2924fc51df
skip test_debug_profile for python 3.14.0* 2025-06-12 18:45:00 +02:00
Thomas Waldmann
47664ed8cd
disable no-ctracer in .coveragerc 2025-06-12 17:02:59 +02:00
Thomas Waldmann
fef9bba1b4
fix deprecated argparse.FileType
the related warning output also disturbs some tests.
2025-06-12 15:47:57 +02:00
Thomas Waldmann
eaca4a6c4a
tests: fix ZeroDivisionError msg test for py314, fixes #8913 2025-06-12 15:47:56 +02:00
Thomas Waldmann
9530f31e5f
update requirements.d/development.lock.txt 2025-06-12 15:47:54 +02:00
Thomas Waldmann
74689d6ea9
support python 3.14 2025-06-12 12:06:45 +02:00
TW
cd07d84c1d
Merge pull request #8918 from ThomasWaldmann/modularize-tests
Modularize tests
2025-06-12 11:59:14 +02:00
Thomas Waldmann
394cec653b
move some tests to testsuite.helpers package 2025-06-11 23:42:17 +02:00
Thomas Waldmann
7329efba14
refactor crypto tests into a package 2025-06-11 23:41:54 +02:00
Thomas Waldmann
78679f8912
refactor platform tests into a package 2025-06-11 23:41:52 +02:00
TW
a44e259b89
Merge pull request #8914 from ThomasWaldmann/pathlib
refactor: use pathlib.Path
2025-06-11 16:30:13 +02:00
Thomas Waldmann
6a565c8006
pathlib refactor key 2025-06-11 09:01:50 +02:00
Thomas Waldmann
aea3d6aefe
pathlib refactor compact_cmd 2025-06-11 09:01:48 +02:00
Thomas Waldmann
4866d49e77
pathlib refactor shell_completions_test 2025-06-11 09:01:47 +02:00
Thomas Waldmann
afb47cd940
pathlib refactor - remove unused imports 2025-06-11 09:01:45 +02:00
Thomas Waldmann
4dbec57716
pathlib refactor logger 2025-06-11 09:01:44 +02:00
Thomas Waldmann
c48918edc9
pathlib refactor file_integrity 2025-06-11 09:01:43 +02:00
Thomas Waldmann
baecf9cccb
pathlib refactor cache 2025-06-11 09:01:42 +02:00
Thomas Waldmann
3c8cfd0e29
pathlib refactor fslocking 2025-06-11 09:01:38 +02:00
Thomas Waldmann
4ff49a6e91
pathlib refactor platform.base 2025-06-11 08:42:42 +02:00
Thomas Waldmann
a0f73d7a61
pathlib refactor fs 2025-06-11 08:42:40 +02:00
TW
9a65d5245d
Merge pull request #8903 from ThomasWaldmann/buzhash64
buzhash64 chunker
2025-06-11 08:31:27 +02:00
Thomas Waldmann
d23704e112
buzhash64: docs 2025-06-10 23:42:22 +02:00
Thomas Waldmann
b9646f236e
buzhash64: init table using a 256bit key derived from ID key
That way we can feed lots of entropy into the table creation.

The bh64_key is derived from the id_key (NOT the crypt_key), thus
it will create the same key for related repositories (even if they
use different encryption/authentication keys). Due to that, it will
also create the same buzhash64 table, will cut chunks at the same
points and deduplication will work amongst the related repositories.
2025-06-10 22:44:54 +02:00
Thomas Waldmann
544b3f41a9
get_chunker: give it the key instead of the seed
the buzhash seed only has 32bits, but we rather
want 64bits for buzhash64.

just take them from crypt_key for now.
2025-06-10 22:44:52 +02:00
Thomas Waldmann
6f55cba0ce
ChunkerParams: add support for buzhash64 2025-06-10 22:44:51 +02:00
Thomas Waldmann
dc2dab1535
buzhash64: integrate into borg benchmark command 2025-06-10 22:44:50 +02:00
Thomas Waldmann
63ff136dfe
buzhash64: integrate into build 2025-06-10 22:44:48 +02:00
Thomas Waldmann
6a6622f9d8
buzhash64: adapt buzhash and tests for 64bit 2025-06-10 22:44:47 +02:00
Thomas Waldmann
cbe6ba719d
chunkers: prepare for buzhash64
Added some *64*.* files that are just 1:1 copies of their
32bit counterparts, so that the changes for the 64bit
adaption will later be better visible.
2025-06-10 22:44:43 +02:00
TW
6487a9875c
Merge pull request #8912 from ThomasWaldmann/update-changes
update CHANGES
2025-06-10 11:22:43 +02:00
Thomas Waldmann
b116971217
update CHANGES 2025-06-10 01:09:25 +02:00
TW
31a1ac18c7
Merge pull request #8899 from ThomasWaldmann/fish-completions
fish: fix archive name completion
2025-06-09 19:21:11 +02:00
TW
82a525c5be
Merge pull request #8908 from ThomasWaldmann/3818simplifyexport-master2
small fixes for docs update in 3818simplifyexport-master
2025-06-09 14:35:43 +02:00
Thomas Waldmann
7741b503ad
reformat text 2025-06-09 14:19:14 +02:00
Thomas Waldmann
c850f508f8
fix grammar 2025-06-09 14:19:12 +02:00
TW
f3cfc72b9d
Merge pull request #8331 from qyanu-pull-requests/3818simplifyexport-master
docs: borg-serve: simplify example of env in authorized_keys
2025-06-09 14:17:46 +02:00
TW
9dc18e3707
Merge pull request #8906 from ThomasWaldmann/permissions-docs
docs: add docs for serve --permissions / BORG_REPO_PERMISSIONS
2025-06-08 14:01:58 +02:00
Thomas Waldmann
81bacd04c5
docs: add docs for serve --permissions / BORG_REPO_PERMISSIONS 2025-06-08 13:49:09 +02:00
TW
3cf8d7cf2f
Merge pull request #8905 from ThomasWaldmann/derive-key
key: add derive_key to derive new keys from existing key material
2025-06-06 21:37:29 +02:00
TW
f569668474
Merge pull request #8904 from ThomasWaldmann/allow-msgpack-111
Allow msgpack 1.1.1(rc1)
2025-06-06 20:56:49 +02:00
Thomas Waldmann
e86bae79c2
key: add derive_key to derive new keys from existing key material.
Just a slight refactor of existing code to make
it more useful for other key-generation purposes.
2025-06-06 20:55:39 +02:00
Thomas Waldmann
467d0604da
msgpack version check: ignore "rc" or other version elements
Only compare the main version number, e.g. 1.1.1 (first 3 elements
of the version tuple).

Without this change, it would not accept 1.1.1rc1 because that is
not "<= (1, 1, 1)" in that simplistic version comparison.
2025-06-06 18:38:10 +02:00
Thomas Waldmann
862f19aab9
msgpack: allow 1.1.1
1.1.1rc1 looked good in testing, so hopefully 1.1.1 will also be ok.
2025-06-06 18:35:25 +02:00
TW
fb527051cb
Merge pull request #8902 from ThomasWaldmann/separate-chunkers
Separate chunkers
2025-06-05 11:46:55 +02:00
Thomas Waldmann
25ec20410c
chunkers: add fixed chunker tests to selftest 2025-06-05 09:49:12 +02:00
Thomas Waldmann
3c459f0ae7
chunkers: rename test modules 2025-06-05 09:46:19 +02:00
Thomas Waldmann
0754138a89
Split remaining chunker/reader tests into separate modules 2025-06-05 01:26:06 +02:00
Thomas Waldmann
ae93e67254
Rename chunker_slow_test.py to buzhash_pytest_test.py 2025-06-05 00:54:11 +02:00
Thomas Waldmann
cd6360a894
Split chunker_test into fixed_test and buzhash_test modules
Separated `chunker_test` into two dedicated test modules: `fixed_test` (for `ChunkerFixed`) and `buzhash_test` (for `Chunker`). Updated imports and adjusted references accordingly.
2025-06-05 00:49:50 +02:00
Thomas Waldmann
e7c9db9506
tests: move chunker tests to own package 2025-06-05 00:41:31 +02:00
Thomas Waldmann
90fe56e20a
make mypy happy 2025-06-05 00:22:26 +02:00
Thomas Waldmann
4f6605b115
chunker_test: fix import issue
name collision: module buzhash vs function buzhash.
2025-06-05 00:00:25 +02:00
Thomas Waldmann
f44b1742f5
Extract ChunkerFixed into a dedicated module under chunkers.
Moved the `ChunkerFixed` implementation from `chunker` to a new `fixed` module for better modularity. Updated imports and type hints.

Removed now empty chunkers.chunker module.
2025-06-04 23:48:50 +02:00
Thomas Waldmann
3f4d7ef910
Extract ChunkerFailing into a dedicated module under chunkers
Moved the `ChunkerFailing` implementation from `chunker` to a new `failing` module for better modularity. Updated imports and type hints. Adjusted related definitions in `chunker.pyi` accordingly.
2025-06-04 23:07:05 +02:00
Thomas Waldmann
31494f200d
Extract buzhash logic into a dedicated module under chunkers
Moved `buzhash` implementation from `chunker` to a new `buzhash` module for better separation of concerns. Updated imports, adjusted `setup.py` and build configuration accordingly. Removed deprecated `Chunker` definitions from `chunker.pyi`.
2025-06-04 22:57:03 +02:00
Thomas Waldmann
322e2018ec
Move get_chunker to __init__.py and update Chunker signature
Relocated `get_chunker` function from `chunker` module to `chunkers.__init__.py` for improved organization. Updated `Chunker` class signature to include a `sparse` parameter with a default value. Adjusted imports and type hints accordingly.
2025-06-04 22:46:06 +02:00
Thomas Waldmann
a78c310b72
Split reader functionality into a separate module under chunkers package
Extracted the `reader` logic from `chunker` into a dedicated `reader` module to improve modularity and maintainability. Updated imports, references, and build configurations accordingly.
2025-06-04 22:40:39 +02:00
Thomas Waldmann
bc86bd4bb0
Move chunker module to chunkers package
Refactor by relocating the `chunker` module under a new `chunkers` package, adjusting imports and file references accordingly.
2025-06-04 22:12:45 +02:00
TW
ae80be7f43
Merge pull request #8901 from ThomasWaldmann/chunker-refactor3
Small Chunker refactor
2025-06-04 21:55:39 +02:00
Thomas Waldmann
f58d26671d
ChunkerFixed: do not assert on short header read
ChunkerFixed can be configured to support files with a specific header size.

But we do not want to get an AssertionError if we encounter a 0-byte file
or a file that is shorter than the header size.
2025-06-04 13:40:16 +02:00
Thomas Waldmann
66f10712b4
chunker: use safe_fadvise
also: refactor safe_advise a bit, use has_posix_fadvise.
2025-06-04 13:28:32 +02:00
TW
2295c83c7e
Merge pull request #8900 from ThomasWaldmann/gitignore-update
.gitignore: update entries
2025-06-04 11:51:13 +02:00
Thomas Waldmann
b26f222ca4
.gitignore: update entries 2025-06-04 11:40:55 +02:00
TW
6e2b550a0e
Merge pull request #8897 from ThomasWaldmann/update-changes
update CHANGES
2025-06-04 01:01:46 +02:00
Thomas Waldmann
a1ba5c3c81
fish: fix archive name completion 2025-06-04 01:01:08 +02:00
Thomas Waldmann
5ca22e9c10
update CHANGES 2025-06-03 20:26:10 +02:00
TW
7ec02dce46
Merge pull request #8895 from ThomasWaldmann/exclude-based-on-xattrs
Exclude based on xattrs or NODUMP flag
2025-06-03 19:54:00 +02:00
Thomas Waldmann
2129d81fdb
create: auto-exclude items based on xattrs or NODUMP, see #4972
no options yet, just hardcoded macOS and Linux xattrs.
removed the --exclude-nodump option, it is also done automagically now.

also: create: call stat_ext_attrs early

this reads bsdflags, xattrs and ACLs from the
filesystem, except if the user chose to disable that.

notable:
- borg always reads these, even for unchanged files
- if we read them early, borg can now behave differently
  based e.g. on a xattr value (and e.g. exclude the file)
2025-06-03 12:56:30 +02:00
TW
1c07087e00
Merge pull request #8883 from ThomasWaldmann/chunker-refactor2
Chunker refactor
2025-06-03 12:51:30 +02:00
TW
0fa548beac
Merge pull request #8894 from ThomasWaldmann/bandit
use bandit
2025-06-03 09:07:35 +02:00
Thomas Waldmann
3b94130b1c
suppress some bandit warnings 2025-06-01 18:00:37 +02:00
Thomas Waldmann
338f9b1db9
add bandit, a security-oriented static analysis tool 2025-06-01 18:00:35 +02:00
TW
dda9c445e1
Merge pull request #8893 from ThomasWaldmann/borg-serve-permissions
serve: add --permissions option as an alternative to BORG_REPO_PERMISSIONS env var
2025-05-30 13:08:29 +02:00
Thomas Waldmann
bdc36d451f
serve: add --permissions option as an alternative to BORG_REPO_PERMISSIONS env var 2025-05-30 11:42:56 +02:00
TW
8c235d760b
Merge pull request #8891 from ThomasWaldmann/refactor-chunker-slow-master
test_chunkpoints_unchanged: do not use blake2b_256
2025-05-29 19:36:24 +02:00
Thomas Waldmann
6841897692
test_chunkpoints_unchanged: do not use blake2b_256
we want to get rid of legacy stuff(*) one day and sha256 is as
good for this purpose (and might be even hw accelerated).

(*) considered legacy due to the way it gives the key to the
blake2b function (just padding and prepending it to the data,
instead of using the key parameter, see #8867 ).
2025-05-29 16:38:53 +02:00
Thomas Waldmann
9f73862d51
sparse test: test for transformation of all-zero blocks into CH_ALLOC chunks 2025-05-28 22:33:27 +02:00
Thomas Waldmann
2ef669945f
skip test_create_read_special_symlink for now
it tends to hang, not only on cygwin.
2025-05-28 22:12:27 +02:00
Thomas Waldmann
439c193662
add tests for archiving big all-zero and all-random files 2025-05-28 13:05:13 +02:00
Thomas Waldmann
29cd100e3b
Cython: do optimisations only where really needed 2025-05-28 11:29:23 +02:00
Thomas Waldmann
a235cff0c5
Chunker: fix infinite loop
Could happen at EOF when remaining data is insufficient and no new data can be added.
2025-05-28 11:07:15 +02:00
Thomas Waldmann
5445a52994
Chunker: add sparse/fmap support 2025-05-27 23:58:12 +02:00
Thomas Waldmann
ad6d0ef2e8
Chunker: integrate FileReader for unified read logic
Replaced inline file reading logic with `FileReader` to standardize handling across chunkers. Improved buffer updates and allocation handling for sparse files and optimized read operations.
2025-05-27 23:58:08 +02:00
Thomas Waldmann
1c0d3eaa9f
FileFMAPReader: add extensive test coverage
Includes unit tests for basic functionality, handling of custom file maps, allocation types, sparse file support, and `_build_fmap` method.
2025-05-27 23:58:06 +02:00
Thomas Waldmann
e65755e114
FileReader: add tests for read and chunk handling
Includes cases for simple reads, multiple reads, and mock chunk scenarios to verify behavior with mixed allocation types.

Also: change Chunk type for empty read result for better consistency.
2025-05-27 23:58:02 +02:00
Thomas Waldmann
4db522dc0d
remove unneeded assertion, use 1MiB read size 2025-05-27 23:58:00 +02:00
Thomas Waldmann
43635a2edc
FileReader: refactor read method
Simplified and improved handling of mixed types of chunks during reading. The allocation type of resulting chunks is now determined based on contributing chunks.
2025-05-27 23:57:58 +02:00
Thomas Waldmann
3dac8f180c
Refactor FileReader.read to always return Chunk objects 2025-05-27 23:57:57 +02:00
Thomas Waldmann
1f03a776d5
Remove support for header_size in file readers.
The `header_size` parameter and related logic have been removed from file readers, simplifying their implementation. This change eliminates unnecessary complexity while maintaining all functional capabilities via `read_size` and `fmap`.
2025-05-27 23:57:55 +02:00
Thomas Waldmann
f036152789
Chunker: split logic into FileFMAPReader and FileReader
`FileFMAPReader` deals with sparse files (data vs holes) or fmap and yields blocks of some specific read_size using a generator.

`FileReader` uses the `FileFMAPReader` to fill an internal buffer and lets users use its `read` method to read arbitrary sized chunks from the buffer.

For both classes, instances now only deal with a single file.
2025-05-27 23:57:53 +02:00
Thomas Waldmann
2818a0c26e
Refactor ChunkerFixed: move file reading into FileReader class
Replaced `ChunkerFixed`'s block-reading functionality with a new `FileReader` class to streamline code and improve separation of concerns. Adjusted `ChunkerFixed` to delegate file reading to `FileReader` while focusing on chunk assembly.

`FileReader` is intended to be useful for other chunkers also, so they can easily implement sparse file reading / fmap support.
2025-05-27 23:57:52 +02:00
Thomas Waldmann
6a17829c25
refactor ChunkerFixed: move filemap building to _build_fmap method 2025-05-27 23:57:48 +02:00
TW
04000f7fed
Merge pull request #8880 from Atharva-Varpe/master
tox: use native pyproject.toml configuration
2025-05-27 17:12:46 +02:00
TW
a7bc9771d9
Merge pull request #8882 from ThomasWaldmann/buzhash-chunker-cy-translation
Buzhash chunker: C to Cython translation
2025-05-26 23:18:35 +02:00
Thomas Waldmann
8d3767efe7
inline BARREL_SHIFT code 2025-05-26 21:52:41 +02:00
Thomas Waldmann
522eaf6899
Convert _chunker.c into Cython code within Chunker class
This was mostly done by Junie AI, but needed some manual fixes:

fix exception handling
======================

-    cdef object process(self):
+    cdef object process(self) except *:

fix construction of memoryviews
===============================

placement of the [:size] is important.

-                return memoryview(<char*>(self.data + self.position))[:self.remaining]
+                return memoryview((self.data + self.position)[:self.remaining])

-        return memoryview(<char*>(self.data + old_last))[:n]
+        return memoryview((self.data + old_last)[:n])
2025-05-26 21:32:14 +02:00
Atharva Varpe
7b8137c646 removing tox.ini 2025-05-24 06:34:20 +00:00
Atharva Varpe
a4633ec144 added native tox support to pyproject.toml 2025-05-24 05:38:44 +00:00
TW
ee1f0fdb9c
Merge pull request #8876 from ThomasWaldmann/docs
docs: fix mistyped CVE number
2025-05-23 09:48:07 +02:00
Thomas Waldmann
456e319bb6
docs: fix mistyped CVE number 2025-05-23 09:26:26 +02:00
TW
2b655fccf7
Merge pull request #8872 from ThomasWaldmann/chunker-params-reject-even-window-size
ChunkerParams: reject even window size for buzhash, fixes #8868
2025-05-23 07:36:23 +02:00
TW
6fc0cd5ef3
Merge pull request #8873 from ThomasWaldmann/disable-windows-ci
CI: disable windows for now
2025-05-23 07:35:17 +02:00
Thomas Waldmann
7072f6263d
ChunkerParams: reject even window size for buzhash, fixes #8868 2025-05-23 06:49:52 +02:00
Thomas Waldmann
5940bad06e
CI: disable windows for now
The file:// repo URLs are still broken on windows.
2025-05-23 06:47:59 +02:00
TW
5707a37702
Merge pull request #8871 from ThomasWaldmann/rel200b17
Release 2.0.0b17
2025-05-23 06:37:05 +02:00
Thomas Waldmann
6b87fec1f7
update CHANGES 2025-05-22 14:22:10 +02:00
Thomas Waldmann
4514b957e4
require borgstore 0.3.x 2025-05-22 13:23:29 +02:00
Thomas Waldmann
fa01a2d46a
build_usage build_man 2025-05-22 13:21:21 +02:00
TW
fdd6f69eb4
Merge pull request #8870 from ThomasWaldmann/update-changes
update CHANGES
2025-05-22 13:13:54 +02:00
Thomas Waldmann
5b24e774b7
update CHANGES 2025-05-22 12:46:05 +02:00
TW
138afbe47f
Merge pull request #8863 from ThomasWaldmann/split-helpers-tests
Split helpers tests
2025-05-22 12:18:22 +02:00
TW
34cc0b28d1
Merge pull request #8865 from ThomasWaldmann/cython-fixes
Cython and build fixes
2025-05-22 01:17:17 +02:00
TW
4b3ba5f814
Merge pull request #8866 from ThomasWaldmann/tox
minor tox.ini improvements
2025-05-22 01:16:57 +02:00
TW
87a6a43f4f
Merge pull request #8864 from ThomasWaldmann/ci-windows-coverage
CI: upload coverage for windows tests
2025-05-22 00:07:48 +02:00
Thomas Waldmann
60d37e871d
minor tox.ini improvements
- consistent indentation with spaces
- use pytest, not py.test
- consistent empty lines between sections
- remove empty changedir lines
2025-05-21 23:44:16 +02:00
Thomas Waldmann
16b7dd8cee
suppress compiler warning about CYTHON_FALLTHROUGH
The `-Wno-unreachable-code-fallthrough` compiler flag suppresses warnings about fallthrough annotations in unreachable code.

In C switch statements, "fallthrough" occurs when execution continues from one case to the next without a break statement. This is often a source of bugs, so modern compilers warn about it. To indicate intentional fallthrough, developers use annotations like `__attribute__((fallthrough))`.

In Cython-generated C code, the `CYTHON_FALLTHROUGH` macro is defined to expand to the appropriate fallthrough annotation for the compiler being used. For example, in `compress.c`:

```c
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
```

The issue occurs because Cython generates code with conditional branches that may be unreachable on certain platforms or configurations. When these branches contain switch statements with fallthrough annotations, compilers like Clang issue warnings like:

```
warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
```

These warnings appear in the generated C code, not in the original Cython source. They're harmless but noisy, cluttering the build output with warnings about code we don't control.

By adding `-Wno-unreachable-code-fallthrough` to the compiler flags in `setup.py`, we specifically tell the compiler to ignore these particular warnings, resulting in a cleaner build output without affecting the actual functionality of the code.

This is a common practice when working with generated code - suppress specific warnings that are unavoidable due to the code generation process while keeping other useful warnings enabled.
2025-05-21 23:22:24 +02:00
Thomas Waldmann
2034864085
minor cython code fixes 2025-05-21 23:05:26 +02:00
Thomas Waldmann
18844717d2
CI: upload coverage for windows tests 2025-05-21 22:40:55 +02:00
Thomas Waldmann
881eaca08a
fix tests so that they are as before the splitup 2025-05-21 22:20:12 +02:00
Thomas Waldmann
5545af1fd0
remove now empty helpers_test 2025-05-21 21:11:49 +02:00
Thomas Waldmann
89e7e117a0
tests: move tests to testsuite.helpers.parseformat_test 2025-05-21 21:10:58 +02:00
Thomas Waldmann
a6ed1f63bc
tests: move tests to testsuite.helpers.__init__test 2025-05-21 21:07:28 +02:00
Thomas Waldmann
c564e3927b
tests: move tests to testsuite.archiver.prune_cmd_test 2025-05-21 21:04:04 +02:00
Thomas Waldmann
9241c8c940
tests: move tests to testsuite.helpers.misc_test 2025-05-21 21:00:01 +02:00
Thomas Waldmann
95432a9466
tests: move tests to testsuite.helpers.msgpack_test 2025-05-21 20:48:20 +02:00
Thomas Waldmann
a3124cbed6
tests: move tests to testsuite.helpers.process_test 2025-05-21 20:44:30 +02:00
Thomas Waldmann
63c4082843
tests: move tests to testsuite.helpers.shellpattern_test 2025-05-21 20:40:22 +02:00
Thomas Waldmann
6427915afc
tests: move tests to testsuite.helpers.time_test 2025-05-21 20:31:02 +02:00
Thomas Waldmann
75729615b0
tests: move tests to testsuite.helpers.passphrase_test 2025-05-21 20:25:46 +02:00
Thomas Waldmann
6ff557c6eb
tests: move tests to testsuite.helpers.progress_test 2025-05-21 20:20:33 +02:00
Thomas Waldmann
8458ed1965
tests: move tests to testsuite.helpers.parseformat_test 2025-05-21 20:10:53 +02:00
Thomas Waldmann
6d0551b9fd
tests: move helpers.datastruct tests to testsuite.helpers.datastruct_test 2025-05-21 19:02:24 +02:00
Thomas Waldmann
d5e460f6d5
tests: move helpers.yes_no tests to testsuite.helpers.yes_no_test 2025-05-21 18:50:43 +02:00
Thomas Waldmann
a965ce6dea
tests: move helpers.fs tests to testsuite.helpers.fs_test 2025-05-21 18:34:52 +02:00
Thomas Waldmann
6e57763345
create borg.testsuite.helpers package 2025-05-21 18:11:00 +02:00
TW
dc7d876957
Merge pull request #8862 from ThomasWaldmann/tests-save-temp-space
Tests: save temp space
2025-05-21 17:02:20 +02:00
TW
7760ebb6e3
Merge pull request #8861 from ThomasWaldmann/tests-fix-ts-granularity
tests: fix diff cmd test on macOS HFS+, fixes #8860
2025-05-21 16:03:23 +02:00
Thomas Waldmann
36e9cd4991
tests: test_list_chunk_counts, save space on TMPDIR 2025-05-21 15:31:51 +02:00
Thomas Waldmann
6210ae8b7b
tests: test_max_data_size, save space on TMPDIR 2025-05-21 15:31:50 +02:00
Thomas Waldmann
01417e3085
tests: test_transfer_rechunk, save space on TMPDIR 2025-05-21 15:31:49 +02:00
Thomas Waldmann
f7419ff06e
tests: test_sparse_file, save space on TMPDIR 2025-05-21 15:31:47 +02:00
Thomas Waldmann
ba3eb06f74
tests: repo-space, save space on TMPDIR 2025-05-21 15:14:24 +02:00
Thomas Waldmann
b4c4bf0b3f
tests: fix diff cmd test on macOS HFS+, fixes #8860
If we touch too quickly after file creation, it would not noticably update the timestamp.
2025-05-21 14:39:39 +02:00
TW
39b847a138
Merge pull request #8859 from ThomasWaldmann/pyupgrade-py310-plus
pyupgrade --py310-plus ./**/*.py
2025-05-20 23:29:58 +02:00
TW
38a328b09b
Merge pull request #8858 from ThomasWaldmann/shell-archive-completions
some fixes for shell completions
2025-05-20 23:25:27 +02:00
Thomas Waldmann
c7765adf08
pyupgrade --py310-plus ./**/*.py 2025-05-20 22:05:13 +02:00
Thomas Waldmann
a4761f9158
zsh: no barchive, add --repo 2025-05-20 21:28:46 +02:00
Thomas Waldmann
7e78aaf04d
zsh fixes, remove repo-list caching 2025-05-20 21:08:09 +02:00
Thomas Waldmann
ca87c60565
minor bash completion fixes 2025-05-20 21:05:38 +02:00
TW
d197810bde
Merge pull request #8850 from ThomasWaldmann/shell-completions
add new commands and options to shell completions
2025-05-20 18:42:33 +02:00
TW
80624d1460
Merge pull request #8854 from ThomasWaldmann/files-cache-cleanup
compact: also clean up files cache, fixes #8852
2025-05-20 18:42:07 +02:00
TW
bde1176866
Merge pull request #8855 from ThomasWaldmann/update-docs-usage-man
Update docs / usage / man
2025-05-19 23:54:41 +02:00
Thomas Waldmann
6e548ed1f0
build_man build_usage 2025-05-19 23:20:38 +02:00
Thomas Waldmann
7644b04df2
docs: remove outdated docs/man files about borg change-passphrase
this is borg key change-passphrase now.
2025-05-19 23:18:19 +02:00
TW
c9083a3d07
Merge pull request #8853 from ThomasWaldmann/fix-todo
legacyremote: fix api versioning todo
2025-05-19 23:00:31 +02:00
Thomas Waldmann
318c94d750
compact: also clean up files cache, fixes #8852 2025-05-19 22:39:05 +02:00
Thomas Waldmann
31b369ff85
legacyremote: fix api versioning todo 2025-05-19 21:18:52 +02:00
Thomas Waldmann
5c681b921c
completions: test validity of shell completion files
CI: install zsh and fish so we can test shell completions
2025-05-19 21:03:14 +02:00
Thomas Waldmann
3196f490f3
zsh: add new commands and options to zsh completions 2025-05-19 21:03:11 +02:00
Thomas Waldmann
9116533ec3
fish: add new commands and options to fish completions 2025-05-19 20:30:52 +02:00
Thomas Waldmann
15d3408360
bash: add new commands and options to bash completions
Updated bash completions to include new commands such as `analyze`, `debug`, `repo-space`, `tag`, and `undelete`, along with their respective options. Fixed a typo in the `--upgrader` completions and improved completion handling for various commands.
2025-05-19 20:30:49 +02:00
TW
708c93a4b0
Merge pull request #8845 from ThomasWaldmann/fix-msys2-ci
Fix windows CI
2025-05-19 12:02:42 +02:00
Thomas Waldmann
3df7702519
tests: fix and enable windows CI, fixes #8728
thanks a lot to @sothix for helping with this!

removed pytest-forked, is not found anymore:
error: target not found: mingw-w64-ucrt-x86_64-python-pytest-forked

use a virtual env to avoid mixup of user with system packages.

remove old workaround for setuptools (SETUPTOOLS_USE_DISTUTILS: stdlib).

fix pip install

use --system-site-packages as a workaround for broken pip install python-cffi.

do not upgrade pip setuptools build wheel

use python -m pytest to use the one from the venv
2025-05-19 11:00:11 +02:00
Vaskebjoern
15e55bfd2e
docs: add S3/B2 urls to documentation for repository urls, fixes #8833 2025-05-19 10:41:07 +02:00
TW
b73af3642d
Merge pull request #8849 from ThomasWaldmann/fd-based-dir-is-tagged
dir_is_tagged/_is_cachedir: add fd-based operations
2025-05-18 22:38:12 +02:00
TW
eedede3776
Merge pull request #8847 from ThomasWaldmann/list-depth
list --depth=N: list files up to N depth in path hierarchy, fixes #8268
2025-05-18 19:32:07 +02:00
TW
ffb5ea1c60
Merge pull request #8848 from ThomasWaldmann/fuse-signal-no
fuse_main: return signal number
2025-05-18 19:31:05 +02:00
Thomas Waldmann
663b3ed0e8
dir_is_tagged/_is_cachedir: add fd-based operations
also add tests.
2025-05-18 19:29:47 +02:00
Thomas Waldmann
98cf13a564
fuse_main: return signal number 2025-05-18 15:25:20 +02:00
Thomas Waldmann
2f8485400a
list --depth=N: list files up to N depth in path hierarchy, fixes #8268
IOW: if there are > N slashes in the path, it is not listed.
2025-05-18 14:31:15 +02:00
TW
98c0f29876
Merge pull request #8846 from ThomasWaldmann/update-changes
update CHANGES
2025-05-18 13:56:44 +02:00
Thomas Waldmann
6e0a11cb96
update CHANGES 2025-05-18 09:57:29 +02:00
TW
a764abd7b0
Merge pull request #8803 from ThomasWaldmann/transfer-rechunk
transfer with re-chunking
2025-05-18 09:32:01 +02:00
Thomas Waldmann
51d188ad12
fix setup_repos, enable remote archiver testing 2025-05-18 08:12:37 +02:00
TW
7afb649262
Merge pull request #8844 from ThomasWaldmann/write-only
repository: add write-only permissions mode, fixes #1165
2025-05-18 07:25:01 +02:00
Thomas Waldmann
9c6e636759
transfer: implement --chunker-params, fixes #8706
when rechunking, it puts the new chunker params into the archive metadata.
2025-05-17 22:09:37 +02:00
Thomas Waldmann
44edf6b3c5
repository: add write-only permissions mode, fixes #1165
Also: moved name length check to Archive.__init__, so it doesn't
read all other archives main metadata when creating a new archive.

In write-only mode, the files cache can't be built from the repo
from the latest archive of same series, we are not allowed to read that!
2025-05-17 21:36:51 +02:00
Thomas Waldmann
fee5600481
refactor: create transfer_chunks function 2025-05-16 20:39:11 +02:00
TW
b053bd1c7a
Merge pull request #8839 from ThomasWaldmann/adapt-to-restricted-permissions
use cache/last-key-checked, so config/ doesn't need D permission
2025-05-16 19:43:43 +02:00
vaskebjoern
233e7a474a
compact: add --iec option, fixes #8831 2025-05-16 18:24:31 +02:00
Thomas Waldmann
ecdf399e23
use cache/last-key-checked, so config/ doesn't need D permission 2025-05-16 17:56:22 +02:00
TW
e0fd2af7bd
Merge pull request #8837 from ThomasWaldmann/store-permissions2
Store permissions
2025-05-16 13:17:03 +02:00
Thomas Waldmann
7cef820b7e
pull borgstore from master branch 2025-05-16 13:16:45 +02:00
Thomas Waldmann
552646cc9b
BORG_REPO_PERMISSIONS=all|no-delete|read-only
The posixfs borgstore backend implements permissions to make
testing with differently permissive stores easier.

The env var selects from pre-defined permission configurations
within borg and gives the chosen permissions config to borgstore.
2025-05-16 13:16:43 +02:00
TW
4d43e136a6
Merge pull request #8826 from ThomasWaldmann/repo-compress-tests
tests: add repo-compress --stats test
2025-05-11 10:21:04 +02:00
TW
4d1e4cd5c0
improve testing of transfer cmd 2025-05-11 10:20:06 +02:00
TW
5c304edf9c
Merge pull request #8829 from RonnyPfannschmidt/fix-6858-cpdev-set-name-supported-in-cython31
fix #6858: correct the signature of __set_name__ as cython 3.1 added support
2025-05-10 12:18:34 +02:00
Ronny Pfannschmidt
be1b90bbc3 remove Cython constraints 2025-05-10 08:05:19 +02:00
Ronny Pfannschmidt
8b313048bd fix #8828: correct the signature of __set_name__ as cython 3.1 added support
the code calling it is left in place for now to ensure function with older cython
2025-05-10 08:04:12 +02:00
TW
c78a3434b9
Merge pull request #8830 from RonnyPfannschmidt/codeql-update
update codeql to v3 due to deprecation
2025-05-10 02:15:03 +02:00
Ronny Pfannschmidt
4d2197b536 update codeql to v3 due to deprecation 2025-05-09 23:11:23 +02:00
Thomas Waldmann
d9f6f16b5c
tests: add repo-compress --stats test
very simple, mostly for coverage.
2025-05-09 22:19:34 +02:00
TW
82e06a345f
Merge pull request #8827 from ThomasWaldmann/require-cython-less-than-31-master
require Cython < 3.1 for now
2025-05-09 22:04:57 +02:00
Thomas Waldmann
d3080c84fe
require Cython < 3.1 for now
This is a workaround for:

https://github.com/cython/cython/issues/6858
2025-05-09 20:39:50 +02:00
TW
7d92389b1f
Merge pull request #8822 from lkwg82/patch-1
adds 1.4.x versions to SECURITY.md
2025-05-08 15:43:25 +02:00
Lars K.W. Gohlke
040ecfe9f9
adds 1.4.x versions to SECURITY.md 2025-05-08 13:35:17 +02:00
TW
b14be7fa92
Merge pull request #8821 from ThomasWaldmann/compact-fixes
borg compact fix / test
2025-05-08 11:17:53 +02:00
Thomas Waldmann
38268127c9
compact/check: fix bug not writing the complete index, fixes #8813
Add incremental flag to `write_chunkindex_to_repo_cache`.

borg create uses incremental cache indexes to save progress.
But other OPs need to write a full index and delete all other cached indexes.

Added debug logging for missing object IDs.
2025-05-08 01:54:52 +02:00
TW
5dc05b083c
Merge pull request #8819 from ThomasWaldmann/developer-docs
misc updates to developer docs
2025-05-07 17:43:46 +02:00
Thomas Waldmann
b6ee18fffc
docs: minor formatting changes in development docs 2025-05-07 17:02:29 +02:00
Thomas Waldmann
b68552aef2
docs: announce releases on Mastodon, bsky, X 2025-05-07 16:53:30 +02:00
Thomas Waldmann
32ce149caa
docs: refer to more current 1.4-maint 2025-05-07 16:48:55 +02:00
Thomas Waldmann
ae423cfd10
docs: must have the release tags in the local repo, fixes #8582 2025-05-07 16:45:53 +02:00
TW
1ed582a391
Merge pull request #8818 from ThomasWaldmann/repo-info-formatting-fix
repo-info: fix output formatting
2025-05-07 11:27:48 +02:00
TW
c16956a47b
Merge pull request #8817 from ThomasWaldmann/display-archive-ts-in-localtime
check/compact/analyze: show archive timestamp in local tz, fixes #8814
2025-05-07 11:12:43 +02:00
TW
e3cb7b8915
Merge pull request #8816 from ThomasWaldmann/repo-space-tests-and-fixes
repo-space tests and fixes
2025-05-07 10:45:39 +02:00
Thomas Waldmann
dd638ff22d
repo-info: fix output formatting
also: simplify code a little
2025-05-07 10:34:26 +02:00
Thomas Waldmann
2063da3b09
check/compact/analyze: show archive timestamp in local tz, fixes #8814 2025-05-07 10:02:35 +02:00
Thomas Waldmann
455c3e99ad
repo-space: enable ssh: repo testing, fix AttributeError, fixes #8815 2025-05-07 09:14:59 +02:00
Thomas Waldmann
9206e106e1
Add tests for repo-space command functionality
Introduce tests to verify the functionality of the `repo-space` command, including space reservation, freeing, display, and edge cases. These tests ensure proper handling of various scenarios and validation of the respective outputs.
2025-05-07 09:02:28 +02:00
TW
87b1d454cc
Merge pull request #8809 from ThomasWaldmann/rel200b16
Release 2.0.0b16
2025-05-06 14:15:48 +02:00
Thomas Waldmann
524d927871
build_usage build_man 2025-05-06 01:37:17 +02:00
Thomas Waldmann
3bca22a0a3
update CHANGES 2025-05-06 01:35:29 +02:00
TW
5c277b2e77
Merge pull request #8808 from ThomasWaldmann/other-repo-improvements
better support other repo by misc. passphrase env vars, fixes #8457
2025-05-06 01:10:30 +02:00
Thomas Waldmann
bcb178418e
BORG_DEBUG_PASSPHRASE: also show "other" env vars, docs 2025-05-05 21:21:38 +02:00
Thomas Waldmann
ae4aaa96b9
better support other repo by misc. passphrase env vars, fixes #8457
- borg repo-create and borg transfer not only support --repo / --other-repo options,
  but also already supported related BORG_REPO and BORG_OTHER_REPO env vars.
- similar to that, the passphrases now come from BORG_[OTHER_]PASSPHRASE, BORG_[OTHER_]PASSCOMMAND or BORG_[OTHER_]PASSPHRASE_FD.
- borg repo-create --repo B --other-repo A does not silently copy the passphrase of key A
  to key B anymore, but either asks for the passphrase or reads it from env vars.
2025-05-05 21:09:31 +02:00
TW
9a61a86de3
Merge pull request #8805 from ThomasWaldmann/check-ask-passphrase-early
check: ask for key passphrase early, fixes #1931
2025-04-30 22:26:57 +02:00
TW
5ea7383d10
Merge pull request #8804 from ThomasWaldmann/fix-timezone-inconsistency
format_time: output date/time in local tz, fixes #8802
2025-04-30 20:38:08 +02:00
Thomas Waldmann
2340e60504
check: ask for key passphrase early, fixes #1931 2025-04-30 20:35:16 +02:00
Thomas Waldmann
f8aea242c7
format_time: output date/time in local tz, fixes #8802 2025-04-30 18:11:29 +02:00
TW
2efe2bd9ee
Merge pull request #8801 from ThomasWaldmann/borg-serve-repo-option-docs
docs: borg serve --repo is not supported, fixes #8591
2025-04-30 11:58:44 +02:00
Thomas Waldmann
27ca97884c
docs: borg serve --repo is not supported, #8591 2025-04-29 23:08:14 +02:00
TW
677390e175
Merge pull request #8800 from ThomasWaldmann/remove-cygwin-workaround
remove cygwin < 2.8.0 bug workaround
2025-04-29 20:20:52 +02:00
TW
a97ffd3d5d
Merge pull request #8799 from ThomasWaldmann/remote-api-versioning
fix remote api versioning
2025-04-29 13:48:08 +02:00
Thomas Waldmann
edd55df3e8
remove cygwin < 2.8.0 bug workaround 2025-04-28 22:43:22 +02:00
Thomas Waldmann
ee304a7328
fix remote api versioning 2025-04-28 22:38:15 +02:00
TW
d11ba6e7f8
Merge pull request #8798 from ThomasWaldmann/remove-append-only
remove remainders of append-only support
2025-04-28 22:30:10 +02:00
Thomas Waldmann
477e8f53fb
build_man build_usage 2025-04-28 21:42:30 +02:00
Thomas Waldmann
9e6d90754e
remove remainders of append-only support
Some features like append-only repositories rely on a server-side component
that enforces them (because that shall only be controllable server-side,
not client-side).

So, that can only work, if such a server-side component exists, which is the
case for borg 1.x ssh: repositories (but not for borg 1.x non-ssh: repositories).

For borg2, we currently have:
- fs repos
- sftp: repos
- rclone: repos (enabling many different cloud providers)
- s3/b3: repos
- ssh: repos using client/server rpc code similar as in borg 1.x

So, only for the last method we have a borg server-side process that could enforce some features, but not for any of the other repo types.

For append-only the current idea is that this should not be done within borg,
but solved by a missing repo object delete permission enforced by the storage.

borg create could then use credentials that miss permission to delete,
while borg compact would use credentials that include permission to delete.
2025-04-28 18:55:15 +02:00
TW
94df5eee21
Merge pull request #8797 from ThomasWaldmann/remove-quota
remove remainders of quota support
2025-04-28 17:46:02 +02:00
Thomas Waldmann
48b39d878f
remove remainders of quota support
Some features like repository quotas rely on a server-side component
that enforces them (because that shall only be controllable server-side,
not client-side).

So, that can only work, if such a server-side component exists, which is the
case for borg 1.x ssh: repositories (but not for borg 1.x non-ssh: repositories).

For borg2, we currently have:
- fs repos
- sftp: repos
- rclone: repos (enabling many different cloud providers)
- s3/b3: repos
- ssh: repos using client/server rpc code similar as in borg 1.x

So, only for the last method we have a borg server-side process that could enforce some features, but not for any of the other repo types.

For quotas the current idea is that this should not be done within borg,
but enforced by a storage specific quota implementation (like fs quota,
or quota of the cloud storage provider). borg could offer information
about overall repo space used, but would not enforce quotas within borg.
2025-04-28 16:57:30 +02:00
TW
19c1a29181
Merge pull request #8794 from ThomasWaldmann/change-chunkindex-hash-seed
chunks cache: invalidate old chunk index cache
2025-04-28 01:51:30 +02:00
Thomas Waldmann
34d3ed402b
chunks cache: invalidate old chunk index cache
guess we better invalidate the old repo-side cache of the
chunk index and rebuild it with the current borg and
borghash code.
2025-04-28 01:00:17 +02:00
TW
622b42aefa
Merge pull request #8792 from ThomasWaldmann/fix-compact
compact: always write updated chunkindex to repo, fixes #8791
2025-04-25 11:52:32 +02:00
Thomas Waldmann
8dfdfb7e18
compact: always write updated chunkindex to repo, fixes #8791
The issue was due to using an outdated chunkindex that had
entries for chunks that did not exist in the repo anymore.
2025-04-25 10:31:46 +02:00
TW
2391f3f589
Merge pull request #8790 from ThomasWaldmann/remove-py39-2
remove support for / testing on Python 3.9
2025-04-25 09:47:30 +02:00
Thomas Waldmann
5c3d9dec4b
remove support for / testing on Python 3.9
Python 3.9 will run out of upstream support 2025-10 anyway.
So we can also drop it right now and have faster CI testing.
2025-04-24 22:29:55 +02:00
TW
40c20478ca
Merge pull request #8788 from ThomasWaldmann/obfuscation-fixes-master
Obfuscation fixes (master)
2025-04-24 22:18:28 +02:00
TW
a2f95c7e2a
Merge pull request #8789 from ThomasWaldmann/remove-py39
remove support for / testing on Python 3.9
2025-04-24 22:18:06 +02:00
Thomas Waldmann
a90473600d
remove support for / testing on Python 3.9
Python 3.9 will run out of upstream support 2025-10 anyway.
So we can also drop it right now and have faster CI testing.
2025-04-24 20:55:02 +02:00
Thomas Waldmann
738b0c8cb6
only obfuscate the size of file content chunks, fixes #7559
before this fix, borg also obfuscated other chunks it creates,
e.g. the archive metadata stream chunks, which is not necessary
and only added a lot of overhead.

as we have meta["type"] in borg2, this is easy to fix here.
2025-04-24 20:39:41 +02:00
Thomas Waldmann
cb34a1c705
cosmetic: move padme obfuscation method closer to the other o. methods 2025-04-24 19:53:17 +02:00
TW
45435514bd
Merge pull request #8784 from ThomasWaldmann/cache-fixes-master
chunks cache fixes (master)
2025-04-23 02:01:05 +02:00
Thomas Waldmann
3d92e0812c
AdhocWithFilesCache: fix call to _maybe_write_chunks_cache 2025-04-23 00:14:26 +02:00
Thomas Waldmann
7dfc88a493
ChunksMixin: don't use self._chunks until it is demand-built 2025-04-23 00:06:46 +02:00
TW
8c5559cf3a
Merge pull request #8780 from ThomasWaldmann/rel200b15
Release 2.0.0b15
2025-04-22 13:23:54 +02:00
Thomas Waldmann
18dbfd3985
update CHANGES 2025-04-21 21:08:45 +02:00
Thomas Waldmann
4550a49b0f
build_usage / build_man 2025-04-21 21:08:42 +02:00
Thomas Waldmann
8d8fd598af
update development.lock.txt 2025-04-21 21:08:41 +02:00
Thomas Waldmann
3ea0c9a3f1
vagrant: use Python 3.12.10 2025-04-21 21:08:39 +02:00
Thomas Waldmann
cb3253191d
vagrant: install borgstore with all options
now we have a new s3 backend.
2025-04-21 20:27:53 +02:00
Thomas Waldmann
35d7bb316c
adapt to new deleted flag semantics in borgstore 0.2.0
also: require borgstore 0.2.x
2025-04-21 20:25:31 +02:00
TW
66b952ca24
Merge pull request #8779 from ThomasWaldmann/update-changes-master
update CHANGES
2025-04-21 18:57:38 +02:00
Thomas Waldmann
a69fd81098
update CHANGES 2025-04-21 18:36:23 +02:00
TW
b5e95daccf
Merge pull request #8778 from ThomasWaldmann/assert-quickfix-master
quickfix to disallow running borg with assertions switched off, see #8649
2025-04-21 18:34:27 +02:00
Thomas Waldmann
13b7e1f5a8
quickfix to disallow running borg with assertions switched off, see #8649
forward port of #8685 to master branch.
2025-04-21 17:44:20 +02:00
TW
4f38dc6031
Merge pull request #8761 from ThomasWaldmann/fix-remote-modern-exit-codes-master
fix remote repository exception handling / exit codes, fixes #8631
2025-04-21 15:09:07 +02:00
TW
4c8cb05ad7
Merge pull request #8774 from ThomasWaldmann/license-spdx-master
pyproject.toml: SPDX expression for license, add license-files, see #8771
2025-04-20 15:28:36 +02:00
Thomas Waldmann
0a3ccf1094
pyproject.toml: SPDX expression for license, add license-files, see #8771
Also: raise setuptools version requirement appropriately.
2025-04-19 21:39:21 +02:00
TW
a34f4a1dae
Merge pull request #8768 from sersorrel/push-rzkyyukwytos
Remove unnecessary check that Padmé overhead is at most 12%
2025-04-19 11:25:51 +02:00
ash
d1899c1919 Remove unnecessary check that Padmé overhead is at most 12%
It's easy enough to verify exhaustively for any plausible chunker params
that Padmé always produces at most a 12% overhead. Checking that again
at runtime is pointless.
2025-04-18 23:00:23 +01:00
Thomas Waldmann
8ec48ffb05
refactor test_return_codes
... so works in a similar way as test_exit_codes.
2025-04-17 17:57:38 +02:00
Thomas Waldmann
0b284db33a
fix remote repository exception handling / exit codes, fixes #8631
also: reduce code duplication.
2025-04-17 17:45:15 +02:00
TW
da3105f1e0
Merge pull request #8758 from ThomasWaldmann/fix-nfs4-acl-freebsd-master
freebsd: fix nfs4 acl processing, fixes #8756 (master)
2025-04-17 17:16:57 +02:00
Thomas Waldmann
df2bb8c988
freebsd: fix nfs4 acl processing, fixes #8756
This only happened when:
- using borg extract --numeric-ids
- processing NFS4 ACLs

It didn't affect POSIX ACL processing.

This is rather old code, so it looks like nobody used that
code or the bug was not reported.

The bug was discovered by PyCharm's "Junie" AI. \o/
2025-04-17 15:41:31 +02:00
TW
3651d26b1e
Merge pull request #8747 from destructor64/key_import_error_message_fix
Fix paper key import error message
2025-04-13 19:02:42 +02:00
Peter Zangerl
ce5dd4bed2 Fix paper key import error message 2025-04-13 10:06:16 +02:00
Xiaocheng Song
0d9f375fdd
macOS: retrieve birthtime in nanosecond precision via system call, fixes #8724 2025-04-12 14:03:48 +02:00
TW
e12b3bb2f6
Merge pull request #8568 from ThomasWaldmann/remove-chunks-healthy
Item: remove .chunks_healthy, fixes #8559
2025-04-11 21:11:42 +02:00
TW
bec6da4c15
Merge pull request #8741 from ThomasWaldmann/update3-rtd-master
docs: fix search preview
2025-04-10 21:31:23 +02:00
Thomas Waldmann
c14e803429
docs: fix template to support search result preview 2025-04-10 21:20:37 +02:00
Thomas Waldmann
30e9bc9d83
docs: add layout.html template from guzzle_sphinx_theme 0.7.11 2025-04-10 21:19:15 +02:00
TW
0eef4abd59
Merge pull request #8739 from ThomasWaldmann/update2-rtd-master
docs: add sphinxcontrib.jquery
2025-04-10 20:10:21 +02:00
Thomas Waldmann
f55d64db0b
docs: add sphinxcontrib.jquery
The html generated uses jquery ($(...)),
but sphinx does not include it anymore since a while.

also: correctly add guzzle_sphinx_theme to extensions.
2025-04-10 19:50:12 +02:00
TW
f3eeae9908
Merge pull request #8738 from ThomasWaldmann/update-rtd-master
docs theme updates / fixes
2025-04-10 19:01:23 +02:00
Thomas Waldmann
d312ddb1f7
docs: register theme as extension 2025-04-10 18:56:25 +02:00
TW
4c09535b08
Merge pull request #8736 from ThomasWaldmann/port-8615-master
Docs about slow msgpack when using the binary (master)
2025-04-09 17:38:00 +02:00
Thomas Waldmann
2996daff97
docs: add FAQ entry about pure-python msgpack warning, fixes #8323 2025-04-09 17:07:18 +02:00
Thomas Waldmann
1252c16373
binary readme: first check faq and existing issues 2025-04-09 17:06:36 +02:00
TW
279bdc3fee
Merge pull request #8726 from ThomasWaldmann/update-changes
update CHANGES
2025-04-09 16:00:21 +02:00
Thomas Waldmann
992b5f18c8
update CHANGES 2025-04-06 18:25:11 +02:00
Thomas Waldmann
3fdf7a3e78
fetch_many: add replacement_chunk=True param
Sometimes, usually for file content chunks, it makes sense to
generate all-zero replacement chunks on-the-fly.

But for e.g. an archive items metadata stream, this does not
make sense (because it wants to msgpack.unpack the data), so
we rather want None. In that case, we do not have the size
information anyway.
2025-04-06 17:35:33 +02:00
Thomas Waldmann
84fe9d2c67
extract, diff, ...: use raise_missing=False
preloading: always use raise_missing=False, because
the behaviour is defined at preloading time.

fetch_many: use get_many with raise_missing=False.
if get_many yields None instead of the expected chunk
cdata bytes, on-the-fly create an all-zero replacement
chunk of the correct size (if the size is known) and
emit an error msg about the missing chunk id / size.

note: for borg recreate with re-chunking this is a bit
unpretty, because it will transform a missing chunk into
a zero bytes range in the target file in the recreated
archive. it will emit an error message at recreate time,
but afterwards the recreated archive will not "know"
about the problem any more and will just have that
zero-patched file.
so guess borg recreate with re-chunking should better
only be used on repos that do not miss chunks.
2025-04-06 17:35:31 +02:00
Thomas Waldmann
a9b2291281
get/get_many: add raise_missing=True param 2025-04-06 17:35:30 +02:00
Thomas Waldmann
e48ccc7627
simplify fetch_many api
it now takes either:
- a list of ChunkListEntry namedtuples
- a list of chunk IDs [bytes]
2025-04-06 17:35:28 +02:00
Thomas Waldmann
6357f2ebc1
Item: remove .chunks_healthy, fixes #8559
Well, it's not totally removed, some code in Item, Archive and
borg transfer --from-borg1 needs to stay in place, so that we
can pick the CORRECT chunks list that is in .chunks_healthy
for all-zero-replacement-chunk-patched items when transferring
archives from borg1 to borg2 repos.

transfer: do not transfer replacement chunks, deal with missing chunks in other_repo

FUSE fs read: IOError or all-zero result
2025-04-06 17:35:22 +02:00
TW
89daeabd7b
Merge pull request #8719 from ThomasWaldmann/remove-make-parent-dirs-master
create: remove --make-parent-dirs option, #8619
2025-04-06 17:29:48 +02:00
TW
e4890298ef
Merge pull request #8722 from div-dev123/bug/attr
tests: ignore 'com.apple.provenance' xattr (macOS specific)
2025-04-06 12:36:11 +02:00
Divyansh Agrawal
9fa8b58867 tests: ignore 'com.apple.provenance' xattr (macOS specific) 2025-04-06 13:49:49 +05:30
Divyansh Agrawal
d2066ed13d
implement padme chunk size obfuscation (SPEC 250), fixes #8705
---------

Co-authored-by: Divyansh Agrawal <your.email@example.com>
2025-04-05 19:12:19 +02:00
Thomas Waldmann
72cdf82660
create: remove --make-parent-dirs option, #8619
borgstore now does this automatically.
2025-04-04 23:18:39 +02:00
vancheese
8df4bf75d4
docs: borg commands updated with --repo option, fixes #8550 2025-04-01 17:28:57 +02:00
TW
07606a3199
Merge pull request #8700 from ThomasWaldmann/vagrant-updates-master
Vagrant updates master
2025-03-24 10:48:16 +01:00
Thomas Waldmann
20c36b652c
vagrant: build binaries with borgstore[sftp], fixes #8574 2025-03-23 17:27:22 +01:00
Thomas Waldmann
c7fd43c576
msys2: use pyinstaller 6.11.1 2025-03-23 16:00:33 +01:00
Thomas Waldmann
944a74cdf7
vagrant: use pyinstaller 6.11.1 2025-03-23 15:59:13 +01:00
Thomas Waldmann
8e0ce268b2
use python 3.12.8
this includes/bundles a non-broken pip for old macOS. #8495
2025-03-23 15:56:04 +01:00
TW
112cc1a156
Merge pull request #8696 from ThomasWaldmann/requirements-update-master
update development.lock.txt
2025-03-23 15:45:05 +01:00
TW
b90807c722
Merge pull request #8693 from dagelf/docs
Clearer language
2025-03-23 14:59:23 +01:00
TW
fb6f0d4eb6
Merge pull request #8698 from ThomasWaldmann/update-changes-master
update CHANGES
2025-03-23 14:53:46 +01:00
TW
c866a4ba66
Merge pull request #8697 from ThomasWaldmann/y2025-master
it's 2025.
2025-03-23 14:48:46 +01:00
Thomas Waldmann
863a1efdc0
update CHANGES 2025-03-23 14:48:01 +01:00
Thomas Waldmann
e12ad8a6a8
it's 2025. 2025-03-23 14:40:03 +01:00
Thomas Waldmann
d8a0601b7c
update development.lock.txt 2025-03-23 14:34:23 +01:00
Coenraad Loubser
309bfc1f0c
Clearer language 2025-03-21 12:23:19 +02:00
Abhijeet
4eef6178e4
add {unixtime} placeholder, fixes #8522 2025-02-24 17:18:58 +01:00
TW
07e0eabb69
Merge pull request #8672 from ThomasWaldmann/update-changes
update CHANGES
2025-02-17 21:31:51 +01:00
Thomas Waldmann
7b0eed99ae
update CHANGES 2025-02-16 19:31:32 +01:00
TW
8817b0f832
Merge pull request #8642 from httpdev/fix-docs-automated-local-sytemd-wants
docs: modify docs for automated backup to append to SYSTEMD_WANTS
2025-01-22 22:43:39 +01:00
jan
de9d46acf0 docs: modify docs for automated backup to append to SYSTEMD_WANTS rather than overwrite
fixes #8641
In the example, setting SYSTEMD_WANTS instead of appending may prevent
other autostart services attached by earlier udev rules from launching.
This commit changes = to += to fix this behavior.
2025-01-19 14:41:52 +01:00
TW
96305856e7
Merge pull request #8640 from httpdev/fix-docs-automated-local
docs: fix udev rule priority in automated-local.rst
2025-01-18 21:15:32 +01:00
jan
113e1b7fb2 docs: fix udev rule priority in automated-local.rst
fixes #8639
The priority of 40 for the udev rules as stated in to documentation
applies the rule too early on some systems, which prevents the rule from
matching. This commit changes the priority to 80.
2025-01-18 14:22:47 +01:00
infectormp
bfa944af07
FAQ: Why backups are slow on a Linux server that is a member of a windows domain? (#8636)
FAQ: Why backups are slow on a Linux server that is a member of a windows domain?
2025-01-18 00:03:22 +01:00
goebbe
4832364c1d
docs: clarify requirements when using command line options with special characters within a shell (#8628)
docs: within a shell, cli options with special characters may require quoting, #8578
2025-01-11 14:37:21 +01:00
TW
3a43b58aee
Merge pull request #8630 from KenKundert/master
update prune documentation for new --keep-within intervals
2025-01-10 20:48:45 +01:00
Ken Kundert
45b8e629ac update prune documentation for new --keep-within intervals 2025-01-10 11:12:20 -08:00
Ken Kundert
b9498ca571
Allow timespan to be specified with common time units (#8626)
allow timespan to be specified with common time units, fixes #8624

Co-authored-by: Ken Kundert <ken@theKunderts.net>
2025-01-08 18:48:10 +01:00
Syed Ali Ghazi Ejaz
40df2f3c49
Enhance passphrase handling (Fixes #8496) (#8605)
Improve handling when defining a passphrase or debugging passphrase issues, fixes #8496

Setting `BORG_DEBUG_PASSPHRASE=YES` enables passphrase debug logging to stderr, showing passphrase, hex utf-8 byte sequence and related env vars if a wrong passphrase was encountered.

Setting `BORG_DISPLAY_PASSHRASE=YES` now always shows passphrase and its hex utf-8 byte sequence.
2025-01-08 17:58:35 +01:00
TW
5b141e2077
Merge pull request #8625 from ThomasWaldmann/workaround-sphinx-warning-master
work around sudden failure of sphinx ini lexer
2025-01-05 19:52:29 +01:00
Thomas Waldmann
0b4ec9df1a
work around sudden failure of sphinx ini lexer
/Users/tw/w/borg/docs/internals/data-structures.rst:971:
WARNING: Lexing literal_block
'
[cache]
version = 1
repository = 3c4...e59
manifest = 10e...21c
timestamp = 2017-06-01T21:31:39.699514
key_type = 2
previous_location = /path/to/repo

[integrity]
manifest = 10e...21c
files = {"algorithm": "XXH64", "digests": {"HashHeader": "eab...39e3", "final": "e2a...b24"}}
'
as "ini" resulted in an error at token: '}'.
Retrying in relaxed mode. [misc.highlighting_failure]

Note: this part of the docs didn't change for a long time, so I guess
the sudden warning comes from a change in sphinx' lexers.

Main problem is that rc != 0 will abort our CI pipeline.
2025-01-05 19:47:40 +01:00
TW
fd43feb040
Merge pull request #8620 from qyanu-pull-requests/3818recommendchsh-master
docs: borg serve: recommend using a simple shell (closes #3818)
2025-01-05 19:35:52 +01:00
Max-Julian Pogner
048ff2afba docs: borg serve: recommend using a simple shell (closes #3818)
Co-authored-by: Thomas Waldmann <tw@waldmann-edv.de>
2025-01-05 19:19:14 +01:00
Max-Julian Pogner
75687b469d docs: borg-serve: simplify example of env in authorized_keys
see #8318

so long as it can be assumed that the user has configured a POSIX
compliant login shell, using a simple command [1] looks cleaner, as
no ``export`` or ``;`` are used.

[1] Section "2.9.1 Simple Commands" in volume "Shell & Utilities" of POSIX.1-2024
2025-01-04 01:09:33 +01:00
TW
f9f1d21b33
Merge pull request #8613 from ThomasWaldmann/compact-dry-run-master
compact: support --dry-run (do nothing), fixes #8300
2024-12-29 19:17:30 +01:00
TW
35c56b9753
Merge pull request #8612 from ThomasWaldmann/yesno-ignore-unicode-error-master
yes: deal with UnicodeDecodeError in input(), fixes #6984
2024-12-29 18:47:27 +01:00
TW
0c3269fee0
Merge pull request #8614 from ThomasWaldmann/docs-bundled-libs-master
docs: update install docs, fixes #8342.
2024-12-29 18:20:50 +01:00
Thomas Waldmann
2d033e7155
docs: update install docs, fixes #8342.
the python package pkgconfig does not need to be "preinstalled"
anymore, because our pyproject.toml cares for that. otoh, the cli tool
pkg-config must be preinstalled so that libs and headers can be found
automagically.

Also be a bit more clear about the FUSE stuff.
2024-12-29 18:08:42 +01:00
Thomas Waldmann
1559a1ed07
compact: support --dry-run (do nothing), fixes #8300 2024-12-29 17:57:54 +01:00
Thomas Waldmann
9d1107ea80
yes: deal with UnicodeDecodeError in input(), fixes #6984
if retry is True, it will just retry to get a valid answer.
if retry is False, it will return the default.

the code can be tested by entering "error" (without the quotes).
2024-12-29 17:36:28 +01:00
Syed Ali Ghazi Ejaz
ec3c7b5770
Add flags to borg extract Command (Fixes #8564) (#8575)
borg extract --dry-run now displays +/- flags (included/excluded) left to the path.
2024-12-27 23:10:43 +01:00
TW
26b2ffc8a0
Merge pull request #8592 from ThomasWaldmann/preload
item content chunks preloading related changes
2024-12-24 16:02:00 +01:00
Thomas Waldmann
694fa93b76
iter_items: decouple item iteration and content data chunks preloading
It needs to be possible to iterate over all items in an archive,
do some output (e.g. if an item is included / excluded) and then
only preload content data chunks for the included items.
2024-12-23 22:30:12 +01:00
Thomas Waldmann
2108616e4c
remote: simplify code, add debug logging 2024-12-23 21:19:42 +01:00
TW
690ffd1454
Merge pull request #8586 from in0rdr/fix/libffi-dev
doc(installation): add libffi-dev dependency
2024-12-16 19:57:40 +01:00
Andreas Gruhler
9e0023c218 doc(installation): libffi required for argon2-cffi-bindings 2024-12-15 21:36:52 +01:00
Andreas Gruhler
ca25453e10 doc(installation): add libffi-dev dependency 2024-12-15 16:08:27 +01:00
TW
84744ac1a4
Merge pull request #8561 from ThomasWaldmann/speedup-compact
compact: add --stats option
2024-11-25 01:17:08 +01:00
Thomas Waldmann
a46131bec5
compact: add --stats option
with --stats it will be as slow as before, listing all repo objs.

without --stats, it will be faster by using the cached chunks index.
2024-11-24 19:36:16 +01:00
TW
4c1e2bc4b0
Merge pull request #8565 from ThomasWaldmann/pkgconf
macos: fix broken brew pkg-config -> pkgconf transition
2024-11-24 19:35:03 +01:00
TW
b8fe10da84
Merge pull request #8557 from bket/openbsd_openssl_version
borg2 - Support other OpenSSL versions on OpenBSD (#8553)
2024-11-24 18:20:12 +01:00
Thomas Waldmann
41f150ff7f
macos: fix broken brew pkg-config upgrade
it looks like in brew they removed pkg-config formula and added
an alias to the pkgconf formula (which also provides a pkg-config
cli command).

the transition was not seamless:

on github actions CI:

Installing pkg-config
==> Downloading https://ghcr.io/v2/homebrew/core/pkgconf/manifests/2.3.0_1
==> Fetching pkgconf
==> Downloading https://ghcr.io/v2/homebrew/core/pkgconf/blobs/sha256:5f83615f295e78e593c767d84f3eddf61bfb0b849a1e6a5ea343506b30b2c620
==> Pouring pkgconf--2.3.0_1.arm64_sonoma.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /opt/homebrew
Could not symlink bin/pkg-config
Target /opt/homebrew/bin/pkg-config
is a symlink belonging to pkg-config@0.29.2. You can unlink it:
  brew unlink pkg-config@0.29.2

To force the link and overwrite all conflicting files:
  brew link --overwrite pkgconf

To list all files that would be deleted:
  brew link --overwrite pkgconf --dry-run

Possible conflicting files are:
/opt/homebrew/bin/pkg-config -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/bin/pkg-config
/opt/homebrew/share/aclocal/pkg.m4 -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/share/aclocal/pkg.m4
/opt/homebrew/share/man/man1/pkg-config.1 -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/share/man/man1/pkg-config.1
==> Summary
🍺  /opt/homebrew/Cellar/pkgconf/2.3.0_1: 27 files, 474KB
Installing pkg-config has failed!
2024-11-24 18:11:39 +01:00
Björn Ketelaars
cf6a324afa borg2 - Support other OpenSSL versions on OpenBSD
`setup.py` hardcoded crypto library paths for OpenBSD, causing build
issue when OpenBSD drops specific OpenSSL version. Solution is to make
paths configurable.

Addresses #8553.
2024-11-23 23:01:44 +01:00
TW
d1b2884204
Merge pull request #8554 from bket/openbsd_vagrant
Fix issues seen with the OpenBSD vagrant box
2024-11-20 11:31:26 +01:00
Björn Ketelaars
33834c419f Filter test output with LibreSSL related warnings on OpenBSD
We do not want that urllib spoils test output with LibreSSL related
warnings on OpenBSD.

`NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently
the 'ssl' module is compiled with 'LibreSSL 3.8.2'`.
2024-11-20 06:01:12 +01:00
Björn Ketelaars
9c88e2a4e8 Fix OpenBSD Vagrant
This should address #8506. Unfortunately I'm unable to test.

#8506 is likely caused by the Vagrant box having a mirror in its
`etc/installurl`, which does not offer 7.4 packages. There are other
mirrors out there who do, e.g., https://ftp.eu.openbsd.org/pub/OpenBSD/.

Proposed 'fix' is to replace the mirror in `/etc/installurl`.
2024-11-20 06:01:12 +01:00
TW
43fe3590d0
Merge pull request #8549 from ThomasWaldmann/borghash010
adapt to and require borghash 0.1.0
2024-11-18 09:31:01 +01:00
Thomas Waldmann
ebfd581049
add undelete command to index 2024-11-18 02:30:58 +01:00
Thomas Waldmann
0323c2f987
adapt to and require borghash 0.1.0 2024-11-18 01:48:01 +01:00
TW
0551150322
Merge pull request #8547 from ThomasWaldmann/rel200b14
Release 2.0.0 beta 14
2024-11-17 01:20:43 +01:00
Thomas Waldmann
37077a55e7
build_usage build_man 2024-11-16 20:14:16 +01:00
Thomas Waldmann
e8a6421ebf
b14 release date 2024-11-16 20:08:19 +01:00
TW
10c25414f4
Merge pull request #8546 from ThomasWaldmann/files-cache-upgrade-notes
upgrade notes about files cache settings when NOT using archive series
2024-11-16 18:52:33 +01:00
Thomas Waldmann
5f605d6642
upgrade notes about files cache settings when NOT using archive series 2024-11-16 18:47:16 +01:00
TW
b65cfeff51
Merge pull request #8545 from ThomasWaldmann/update-changes
update CHANGES
2024-11-16 18:08:41 +01:00
Thomas Waldmann
b007b99394
update CHANGES 2024-11-16 15:20:51 +01:00
TW
c92d528c82
Merge pull request #8543 from ThomasWaldmann/repo-compress-use-flags
repo-compress: reduce memory consumption
2024-11-15 12:08:49 +01:00
Thomas Waldmann
f7dea6e93f
repo-compress: reduce memory consumption
Worst (but frequent) case here is that all or most of the chunks
in the repo need to get recompressed, thus storing all chunk ids
in a python list would need significant amounts of memory for
large repositories.

We already have all chunk ids stored in cache.chunks, so we now just
flag the ones needing re-compression by setting the F_COMPRESS flag
(that does not need any additional memory).
2024-11-15 10:42:07 +01:00
TW
b6ae924f30
Merge pull request #8541 from ThomasWaldmann/incremental-chunkindex-cache-updates
enable partial/incremental ChunkIndex cache updates
2024-11-15 09:57:19 +01:00
Thomas Waldmann
295f4e3114
update ChunkIndex cache in repo every 10mins 2024-11-14 21:44:56 +01:00
Thomas Waldmann
d5d49e8a15
ChunkIndex: enable partial index updates
- ChunkIndex: implement system flags
- ChunkIndex: F_NEW flag as 1st system flag for newly added chunks
- incrementally write only NEW chunks to repo/cache/chunks.*
- merge all chunks.* when loading the ChunkIndex from the repo

Also: the cached ChunkIndex only has the chunk IDs. All values are just dummies.
The ChunkIndexEntry value can be used to set flags and track size, but we
intentionally do not persist flags and size to the cache.

The size information gets set when borg loads the files cache and "compresses"
the chunks lists in the files cache entries. After that, all chunks referenced
by the files cache will have a valid size as long as the ChunkIndex is in memory.
This is needed so that "uncompress" can work.
2024-11-14 20:28:04 +01:00
TW
4ed03c17e6
Merge pull request #8536 from ThomasWaldmann/vagrant-debian32
vagrant: add bookworm32 box for 32bit platform testing
2024-11-12 01:01:22 +01:00
TW
d266b2fd2d
Merge pull request #8531 from ThomasWaldmann/chunkindex
chunk index cache: use cache/chunks.<HASH>, see #8503
2024-11-11 23:02:50 +01:00
Thomas Waldmann
6a1aa438f8
vagrant: add bookworm32 box for 32bit platform testing 2024-11-10 02:11:24 +01:00
Thomas Waldmann
56493fc62b
chunk index cache: fix "upgrade" code
nice try, but due to other changes after b13, the cache is invalid anyway.
2024-11-08 22:10:39 +01:00
Thomas Waldmann
43a27f294d
caching a merged chunk index: only delete what we merged 2024-11-08 22:03:32 +01:00
Thomas Waldmann
00f8cdc9a7
when building the chunk index, merge all we have in the cache 2024-11-08 22:03:29 +01:00
Thomas Waldmann
4a6fcc26d7
use stable chunkindex list order 2024-11-08 22:03:28 +01:00
Thomas Waldmann
d4310dd4cf
chunk index cache: use cache/chunks.<HASH>, see #8503
- doesn't need a separate file for the hash
- we can later write multiple partial chunkindexes to the cache

also:

add upgrade code that renames the cache from previous borg versions.
2024-11-08 22:03:26 +01:00
TW
35c83dfd66
Merge pull request #8525 from PhrozenByte/docs-undelete
Update docs to better incorporate new undelete command
2024-11-08 20:43:34 +01:00
Daniel Rudolf
38ba3d8c4d Update docs to better incorporate new undelete command
Follow-up to #8515

Refer to https://github.com/borgbackup/borg/pull/8515#pullrequestreview-2417746853 for details.
2024-11-08 01:50:45 +01:00
TW
e9ace2df78
Merge pull request #8530 from ThomasWaldmann/mount-fixes
mount: fix check_pending_archive to give correct root dir, fixes #8528
2024-11-07 23:22:43 +01:00
Thomas Waldmann
f515160bb0
mount: fix check_pending_archive to give correct root dir, fixes #8528
for archive series (duplicate names!), it is not just
the archive name, but NAME-ARCHIVEID.
2024-11-07 21:15:58 +01:00
TW
2dffc60507
Merge pull request #8515 from ThomasWaldmann/soft-delete
soft delete / undelete
2024-11-06 15:44:50 +01:00
Thomas Waldmann
142a739105
check: improve docs 2024-11-05 22:15:16 +01:00
Thomas Waldmann
7cd048f53a
compact: explain more 2024-11-05 21:25:24 +01:00
Thomas Waldmann
72b1a8ea04
delete/prune: add hint about undelete 2024-11-05 21:02:52 +01:00
Thomas Waldmann
a48a8d2bea
check --find-lost-archives (was: --undelete-archives)
Consider soft-deleted archives/ directory entries, but only create a new
archives/ directory entry if:
- there is no entry for that archive ID
- there is no soft-deleted entry for that archive ID either

Support running with or without --repair.

Without --repair, it can be used to detect such inconsistencies and return with rc != 0.

--repository-only contradicts --find-lost-archives.
2024-11-05 21:02:50 +01:00
Thomas Waldmann
c35cbc9028
rebuild_archives_directory: accelerate by only reading metadata
We are only interested in archive metadata objects here, thus for most repo objects
it is enough to read the repoobj's metadata and determine the object's type.

Only if it is the right type of object, we need to read the full object (metadata
and data).
2024-11-05 21:02:49 +01:00
Thomas Waldmann
299c05287f
compact: remove soft-deleted archives/* entries, docs 2024-11-05 21:02:24 +01:00
Thomas Waldmann
9fabc19e6b
undelete: undelete soft-deleted archives, fixes #8500 2024-11-05 20:56:32 +01:00
Thomas Waldmann
7ed8ed56d2
repo-list: --deleted lists deleted archives 2024-11-05 20:03:07 +01:00
Thomas Waldmann
088d59d814
repository: store_list: add deleted param 2024-11-05 20:03:06 +01:00
Thomas Waldmann
c8bce0329d
archive deletion: use store soft-deletion
This keeps the object, just renames it to "*.del".
2024-11-05 20:03:04 +01:00
Thomas Waldmann
179aadc5cc
repository: add store_move for soft-delete 2024-11-05 20:02:57 +01:00
TW
c4635690e3
Merge pull request #8523 from ThomasWaldmann/zsh-completions-borg2
shell completions: adapt zsh for borg 2.0.0b13
2024-11-05 18:31:44 +01:00
Thomas Waldmann
fdc882230e
shell completions: adapt zsh for borg 2.0.0b13
I am not familiar with zsh completions, so I did only the easy stuff.

A lot of the more complex stuff is likely still broken, PR's welcome!
2024-11-05 17:16:38 +01:00
TW
d1d438ba57
Merge pull request #8520 from ThomasWaldmann/vagrant-improvements
vagrant improvements
2024-11-03 21:14:53 +01:00
Thomas Waldmann
32a8c9a3c9
vagrant: fix pythons on freebsd14
- install with sqlite3
- make sure there is python3/pip3/virtualenv command
2024-11-03 19:28:15 +01:00
Thomas Waldmann
a0f56bfddd
vagrant: simplify openindiana box setup 2024-11-03 15:05:07 +01:00
TW
4a88e16790
Merge pull request #8519 from ThomasWaldmann/revert-8510
improve borg mount docs
2024-11-03 14:32:29 +01:00
Thomas Waldmann
5fc72080bb
mount docs: apply jdchristensen's suggestion, better phrasing. 2024-11-03 14:04:45 +01:00
Thomas Waldmann
c49a4e20eb
Revert "docs: Fix grammar in borg mount docs #8510"
This reverts commit d3f3082bf4.

Comment by jdchristensen:

I agree that "wipe clean" is correct grammar, but it doesn't match the situation in "unmount cleanly".
The change in this patch is definitely wrong.
Putting it another way, one would never say that we "clean unmount a filesystem".
We say that we "cleanly unmount a filesystem", or in other words, that it "unmounts cleanly".

But the original text is slightly awkward, so I would propose: "When running in the foreground,
^C/SIGINT cleanly unmounts the filesystem, but other signals or crashes do not."

(Not that this guarantees anything, but I'm a native speaker.)
2024-11-03 14:00:00 +01:00
TW
bef9595463
Merge pull request #8516 from ThomasWaldmann/fix-compress-entry
compress_entry: fix assertion failure
2024-11-03 00:16:42 +01:00
Thomas Waldmann
0545b6a2eb
compress_entry: fix assertion failure
if the size is not known yet in the chunks index, we must update the value there.
2024-11-02 19:21:08 +01:00
TW
59459af88b
Merge pull request #8513 from ThomasWaldmann/refcount-becomes-flags
ChunkIndexEntry.refcount -> .flags
2024-11-02 02:33:50 +01:00
Thomas Waldmann
8a13cf2c4d
make mypy happy 2024-11-02 00:06:09 +01:00
Thomas Waldmann
2ab3c163ce
invalidate existing cache by incrementing the ChunkIndex seed
we changed the semantics (and name) of the first tuple element:
refcount -> flags

thus, better invalidate existing cache.
2024-11-01 23:57:38 +01:00
Thomas Waldmann
ba3e701730
ChunkIndex.add: remove useless refs parameter 2024-11-01 23:53:01 +01:00
Thomas Waldmann
94effcd782
ChunkIndex: .refcount -> .flags
We gave up refcounting quite a while ago and are only interested
in whether a chunk is used (referenced) or not (orphan).

So, let's keep that uint32_t value, but use it for bit flags, so
we could use it to efficiently remember other chunk-related stuff also.
2024-11-01 23:52:59 +01:00
TW
8bdf6b7ffb
Merge pull request #8512 from ThomasWaldmann/use-refcount-less
seen_chunk: do not use .refcount
2024-11-01 22:20:18 +01:00
TW
3c38b2fa66
Merge pull request #8511 from ThomasWaldmann/files-cache-using-borghash
reduce memory consumption of files cache, fixes #5756
2024-11-01 21:06:49 +01:00
Thomas Waldmann
de1b7e0581
seen_chunk: do not use .refcount
If we have an entry for a chunk id in the ChunkIndex,
it means that this chunk exists in the repository.

The code was a bit over-complicated and used entry.refcount
only to detect whether .get(id, default) actually got something
from the ChunkIndex or used the provided default value.

The code does the same now, but in a simpler way.
Additionally, it checks for size consistency if a size is
provided by the caller and a size is already present in
the entry.
2024-11-01 21:05:49 +01:00
Thomas Waldmann
26bb7825b1
minor cleanup 2024-11-01 17:48:15 +01:00
Thomas Waldmann
e053307523
reduce memory consumption of files cache, fixes #5756
- refactor packing/unpacking of fc entries into separate functions
- instead of a chunks list entry being a tuple of 256bit id [bytes] and 32bit size [int],
  only store a stable 32bit index into kv array of ChunkIndex (where we also have id and
  size [and refcount]).
- only done in memory, the on-disk format has (id, size) tuples.

memory consumption (N = entry.chunks list element count, X = overhead for rest of entry):
- previously:
  - packed = packb(dict(..., chunks=[(id1, size1), (id2, size2), ...]))
  - packed size ~= X + N * (1 + (34 + 5)) Bytes
- now:
  - packed = packb(dict(..., chunks=[ix1, ix2, ...]))
  - packed size ~= X + N * 5 Bytes
2024-11-01 17:47:43 +01:00
TW
b553452911
Merge pull request #8484 from mrichtarsky/docs
Docs: Remove --bypass-lock, small changes regarding compression
2024-11-01 12:26:06 +01:00
TW
168d34664e
Merge pull request #8483 from mrichtarsky/faq
docs/FAQ: Clean up entries regarding SSH settings
2024-11-01 12:16:37 +01:00
TW
038f6da988
Merge pull request #8510 from fantasya-pbem/master
docs: Fix grammar in borg mount docs
2024-11-01 12:06:07 +01:00
Thalian
d3f3082bf4 docs: Fix grammar in borg mount docs #8510
"clean" as adverb does not have suffix -ly.
Source: https://dict.leo.org/grammatik/englisch/adjv_usage_flat.php?lang=de#id=5.3.1.b
2024-11-01 07:57:10 +01:00
Martin Richtarsky
b913d9dd1a docs/FAQ: Clean up entries regarding SSH settings
Link to recommended ones
2024-11-01 07:43:47 +01:00
TW
5da1ff166f
Merge pull request #8505 from ThomasWaldmann/rel200b13
release 2.0.0b13
2024-10-31 23:54:09 +01:00
Thomas Waldmann
bd5060887c
pyinstaller: add borghash to hidden imports 2024-10-31 22:19:30 +01:00
Thomas Waldmann
66e17ff6c8
build_usage, build_man 2024-10-31 20:50:06 +01:00
Thomas Waldmann
63c74ca313
update CHANGES 2024-10-31 20:45:33 +01:00
TW
3a66fd78c2
Merge pull request #8504 from ThomasWaldmann/debug-show-chunksindex-stats
chunks index: show hashtable stats at debug log level, fixes #506
2024-10-31 20:28:05 +01:00
Thomas Waldmann
1ec66edeff
chunks index: show hashtable stats at debug log level, fixes #506 2024-10-31 20:07:09 +01:00
TW
1f00d29d19
Merge pull request #8502 from ThomasWaldmann/borghash
replace old hashindex code by borghash + small wrapper
2024-10-31 19:26:49 +01:00
Thomas Waldmann
c37c78f6be
change xxh64 seed for ChunkIndex to invalidate old cache contents
borg2 < beta 12 used the old hashindex code to serialize the ChunkIndex.

beta 12 uses borghash now and the serialization format is different.
2024-10-31 17:47:22 +01:00
Thomas Waldmann
601fc48388
require borghash 2024-10-31 17:18:34 +01:00
Thomas Waldmann
06c44b0284
hashindex: cimport -> import 2024-10-31 15:29:58 +01:00
Thomas Waldmann
1fa2b9a1a0
vagrant: fix macos1012 box, try 5 2024-10-29 18:12:17 +01:00
Thomas Waldmann
af8d2583a5
vagrant: fix macos1012 box, try 4 2024-10-29 14:44:37 +01:00
Thomas Waldmann
66f06f156d
vagrant: fix macos1012 box, try 3 2024-10-28 23:16:50 +01:00
Thomas Waldmann
3fb543dd2b
vagrant: fix macos1012 box, try 2 2024-10-28 21:35:33 +01:00
TW
7a2d174d4e
Merge pull request #8497 from ThomasWaldmann/vagrant-pyenv-reduce
vagrant: reduce pythons built, fix macos box
2024-10-28 21:17:11 +01:00
Thomas Waldmann
3a7881f8dd
vagrant: fix macos1012 box (curl, ca-certificates, openssl@3) 2024-10-28 21:10:28 +01:00
Thomas Waldmann
2ca8ef33e1
vagrant: pyenv: only install python 3.12
on macOS, installing older Pythons seems to uninstall OpenSSL 3 and only 1.1 is left.

also, building all these pythons and misc. openssl versions takes forever and we
only need 3.12 for the binary build. testing on misc. python versions is regularly
done one github actions CI.
2024-10-28 10:41:30 +01:00
TW
b428f8496d
Merge pull request #8494 from ThomasWaldmann/fix-macos-vagrant
avoid broken pip 24.2
2024-10-28 00:45:46 +01:00
TW
c7c204e713
Merge pull request #8492 from ThomasWaldmann/fix-archive-size-transfer
work around missing size/nfiles archive metadata, fixes #8491
2024-10-27 13:16:13 +01:00
Thomas Waldmann
43ec9fc7f3
avoid broken pip 24.2
- it is broken on old macOS
- python 3.12.5/6/7 has bundled pip 24.2
2024-10-27 13:04:51 +01:00
Thomas Waldmann
cea2d5809d
work around missing size/nfiles archive metadata, fixes #8491 2024-10-27 01:19:08 +02:00
Thomas Waldmann
ec11ac259b
hashindex: remove permit_compact arguments, not used 2024-10-26 21:53:53 +02:00
Thomas Waldmann
f59e0249be
hashindex: move common code to Mixin class 2024-10-26 20:16:23 +02:00
Thomas Waldmann
742fe74132
hashindex: inherit from MutableMapping, implement __iter__ 2024-10-26 20:06:33 +02:00
Thomas Waldmann
fb22e76573
adapt to borghash recent api cleanup 2024-10-26 19:25:14 +02:00
Thomas Waldmann
9775adf52b
implement .clear 2024-10-26 19:09:12 +02:00
Thomas Waldmann
68143d6f99
hashindex: remove .compact
our on disk formats only store used keys/values,
so they are always compact on-disk.
2024-10-26 00:47:43 +02:00
Thomas Waldmann
3c794fa980
hashindex: simplify .pop 2024-10-26 00:37:00 +02:00
Thomas Waldmann
bdf2602e7c
hashindex: simplify .get 2024-10-26 00:30:32 +02:00
Thomas Waldmann
d2fe067647
import directly from borghash 2024-10-26 00:18:36 +02:00
Thomas Waldmann
b7035f188b
remove _endian.h, not used anymore 2024-10-25 19:19:02 +02:00
Thomas Waldmann
ab08eea196
remove hashindex tests from selftests
there isn't much left anyway, testing the core hashtable
functionality now happens in borghash project.

Also: switch these tests to pytest.
2024-10-25 19:14:57 +02:00
Thomas Waldmann
03596e3651
remove unused _hashindex.c, update setup.py
also the hash_sizes.py script, which was used for _hashindex.c.
2024-10-25 19:03:38 +02:00
Thomas Waldmann
5996b45b1d
hashindex: cleanup .pyi 2024-10-25 18:29:41 +02:00
Thomas Waldmann
bacb923571
hashindex: cleanups, docstrings 2024-10-25 18:20:54 +02:00
Thomas Waldmann
2c9a5a7bb7
legacyrepository: remove quota tracking tests, fix other tests 2024-10-25 18:09:12 +02:00
Thomas Waldmann
7fffb0dbb1
hashindex: add NSIndex1 write support, fix iteritems
to get the unit tests working, we better have write support for the
borg 1.x format.

iteritems grew support for the marker kwarg.
2024-10-25 18:02:56 +02:00
Thomas Waldmann
64bda1a636
misc cleanups
- remove more hashindex tests
- remove IndexBase, _hashindex.c remainders
- remove early borg2 NSIndex
- remove hashindex_variant (we only support borg 1.x repo index
  aka NSIndex1, everything else uses the borghash based stuff)
- adapt code / tests so they use NSIndex1 (not NSIndex)
- minor fixes
- NSIndex1 can read the old borg 1.x on-disk format, but not write it.
- NSIndex1 can read/write the new borghash on-disk format.
- adapt legacyrepository code to work with NSIndex1 (segment, offset)
  values instead of NSIndex (segment, offset, size).
2024-10-25 17:03:49 +02:00
Martin Richtarsky
f656f6b1f2 docs: Small changes regarding compression
- Mention zstd as the best general choice when not using lz4
  (as often acknowledged by public benchmarks)
- Mention 'auto' more prominently as a good heuristic to improve
  speed while retaining good compression
- Link to compression options
2024-10-25 07:44:26 +02:00
Thomas Waldmann
57e46cdfe5
remove NSIndex1a 2024-10-25 03:33:27 +02:00
Thomas Waldmann
7bb6b3ebfe
NSIndex1: use borghash.HashTableNT
Also:
- have a small wrapper class NSIndex1 around HashTableNT to
  adapt API difference and add some special methods.
- keep old code as NSIndex1a
2024-10-25 03:29:46 +02:00
Thomas Waldmann
ca582b640c
FuseVersionsIndex: use borghash.HashTableNT
Also:
- have a small wrapper class FuseVersionsIndex around HashTableNT to
  adapt API difference and add some special methods.
2024-10-24 23:59:53 +02:00
Thomas Waldmann
ad5b18008d
ChunkIndex: use borghash.HashTableNT
Also:
- remove most hashindex tests, borghash has such tests
- have a small wrapper class ChunkIndex around HashTableNT to
  adapt API difference and add some special methods.

Note: I needed to manually copy the .pxd files from borghash
into cwd, because they were not found:
- ./borghash.pxd
- borghash/_borghash.pxd
2024-10-24 23:35:32 +02:00
TW
f7f2f23a7c
Merge pull request #8489 from ThomasWaldmann/fix-8485
lock after checking repo exists, fixes #8485
2024-10-24 02:41:29 +02:00
TW
44aab3fca6
Merge pull request #8488 from ThomasWaldmann/py313
CI: use "3.13" (w/o "-dev")
2024-10-24 00:16:31 +02:00
TW
defb7237ed
Merge pull request #8487 from ThomasWaldmann/fix-8486
prune: fix exception when NAME is given, fixes #8486
2024-10-24 00:13:23 +02:00
Thomas Waldmann
9130baf973
lock after checking repo exists, fixes #8485 2024-10-24 00:06:45 +02:00
Thomas Waldmann
e1347ef9ab
CI: use "3.13" (w/o "-dev") 2024-10-23 23:21:18 +02:00
Thomas Waldmann
75b8030ed5
prune: fix exception when NAME is given, fixes #8486 2024-10-23 22:51:35 +02:00
Martin Richtarsky
411f6f3222 docs: Remove --bypass-lock 2024-10-22 08:44:56 +02:00
TW
d510555b1b
Merge pull request #8481 from ThomasWaldmann/updates-changes
update CHANGES
2024-10-19 04:11:33 +02:00
Thomas Waldmann
b6eb5b239f
update CHANGES 2024-10-19 03:49:28 +02:00
TW
b00ae897f1
Merge pull request #8477 from ThomasWaldmann/non-existing-repo-errors
simple error msg for non-existing repo, fixes #8475
2024-10-16 18:41:18 +02:00
Thomas Waldmann
a49de25fe3
simple error msg for non-existing repo, fixes #8475
do not show a traceback for this (expected) case.
2024-10-16 17:13:53 +02:00
TW
dfbd3b7d5f
Merge pull request #8472 from ThomasWaldmann/borgstore010
changes needed for borgstore 0.1.0
2024-10-15 21:56:08 +02:00
Thomas Waldmann
7be254efe5
github CI: temporarily disabled windows CI, #8474 2024-10-15 20:36:17 +02:00
Thomas Waldmann
f6f8c678e8
msys2: use pyinstaller 6.10.0 2024-10-15 19:06:34 +02:00
Thomas Waldmann
e8dbcb3bfa
msys2: install rclone 2024-10-15 19:05:27 +02:00
Thomas Waldmann
703c98dbc9
create: catch StoreBackendAlreadyExists
Don't show traceback if a repo at the given location already exists.
2024-10-15 14:30:11 +02:00
Thomas Waldmann
ffdc9581d9
"file:" Location: use absolute path 2024-10-15 01:21:41 +02:00
Thomas Waldmann
6adf18d97c
update URL docs 2024-10-14 23:30:12 +02:00
Thomas Waldmann
858fbae9a9
Location: simplify regexes, parsing
There were still some relicts from pre-borgstore / borg 1.x in there:
- patterns about "::", used to be separator between repository and archive.
- patterns for //server/share (not supported by borgstore)

Also: unified ssh+sftp and file+socket processing.
2024-10-14 23:16:24 +02:00
Thomas Waldmann
835b2657cd
new ssh: URLs, see #8372
ssh://user@host:port/rel/path
ssh://user@host:port//abs/path

remove the /./ and /~/ hacks.
2024-10-14 19:59:13 +02:00
Thomas Waldmann
72fc028142
to_key_filename: generate different filenames for rel/abs paths 2024-10-14 19:59:11 +02:00
Thomas Waldmann
d60303eb8c
new sftp: URLs, see #8372
sftp://user@host:port/rel/path
sftp://user@host:port//abs/path
2024-10-14 19:59:10 +02:00
Thomas Waldmann
83414b037d
new rclone: URLs, fixes #8446
rclone:remote:path
2024-10-14 19:58:38 +02:00
Thomas Waldmann
4e576d51c7
repo-create: write empty ChunkIndex to repo/cache/, docs 2024-10-14 19:57:59 +02:00
Thomas Waldmann
7f79b65e39
require borgstore ~= 0.1.0 2024-10-13 21:10:47 +02:00
TW
dd7ce48bd5
Merge pull request #8470 from ThomasWaldmann/assert-rewrite
call register_assert_rewrite before importing borg.testsuite
2024-10-12 19:39:32 +02:00
Thomas Waldmann
2b06ac50a1
move conftest one level higher
if it is inside borg.testsuite, we can't rewrite asserts in there.
2024-10-12 18:26:48 +02:00
Thomas Waldmann
450375167e
call register_assert_rewrite before importing borg.testsuite 2024-10-12 18:05:17 +02:00
TW
e376b7f2fa
Merge pull request #8469 from ThomasWaldmann/special-tags
implement special tags, @PROT for protecting archives
2024-10-10 13:37:39 +02:00
Thomas Waldmann
3fb5d3f227
recreate: do not recreate protected archives 2024-10-10 00:35:12 +02:00
Thomas Waldmann
9d187d61ce
delete/prune: do not delete/prune protected archives 2024-10-10 00:34:42 +02:00
Thomas Waldmann
bfd316694d
implement special tags, see #953
special tags start with @ and have clobber protection,
so users can't accidentally remove them using borg tag --set.
it is possible though to still use --set, but one must also
give all special tags that the archive(s) already have.

there is only a known set of allowed special tags:
@PROT - protects archives against archive pruning or archive deletion
setting unknown tags beginning with @ is disallowed.
2024-10-10 00:09:39 +02:00
TW
3cae96cc99
Merge pull request #8468 from ThomasWaldmann/check-improvements
Check improvements
2024-10-09 19:04:47 +02:00
TW
65d0ce66c1
Merge pull request #8467 from ThomasWaldmann/tar-improvements
import-tar/export-tar improvements
2024-10-09 19:04:32 +02:00
Thomas Waldmann
7288f4f94d
check (archives part): use cached ChunkIndex from check (repository part) 2024-10-09 14:30:32 +02:00
Thomas Waldmann
bc24d01928
check (repository part): build and cache a ChunkIndex 2024-10-09 01:28:14 +02:00
Thomas Waldmann
bd22d1fbbb
check: clarify what is meant by remote repository 2024-10-08 23:43:40 +02:00
Thomas Waldmann
e0fdaa440f
import-tar/export-tar: add xattr support for PAX format, #2521 2024-10-08 20:33:24 +02:00
Thomas Waldmann
2ed5d6b101
export-tar: switch default to PAX format
Python 3.8's tarfile module did the same.
2024-10-08 01:49:10 +02:00
TW
d7d59b59de
Merge pull request #8460 from ThomasWaldmann/json-no-changes-master
Suppress modified changes for files which weren't actually modified in JSON output.
2024-10-06 13:48:55 +02:00
TW
ee386d0bef
Merge pull request #8459 from ThomasWaldmann/prune-quarterly-master
Add quarterly pruning strategy.
2024-10-06 12:12:13 +02:00
Thomas Waldmann
1e4314f367
win32: do not test for ctime difference
ctime is file creation time on windows and is not updated on "touch".
2024-10-06 00:12:12 +02:00
TW
c5e48c700b
Merge pull request #8463 from ThomasWaldmann/borgfs-dir-names
mount: create unique directory names, fixes #8461
2024-10-05 23:59:51 +02:00
Thomas Waldmann
f624f76c13
mount: only append archive id when needed 2024-10-05 21:14:30 +02:00
Thomas Waldmann
84245ef2bf
mount: create unique directory names, fixes #8461 2024-10-05 20:52:26 +02:00
TW
91c0def38a
Merge pull request #8458 from ThomasWaldmann/doc-updates
Doc updates
2024-10-05 19:03:30 +02:00
William D. Jones
64e7095578
Ensure that 0B changes are hidden from text diffs too. 2024-10-05 18:28:42 +02:00
William D. Jones
399c3f679d
Add test to make sure 0-added,0-removed modified changes aren't in JSON output. 2024-10-05 17:19:57 +02:00
William D. Jones
16dc660d1d
Remove 0-added,0-removed modified entries from JSON output. 2024-10-05 17:06:34 +02:00
William D. Jones
d54eefd9f4
Add quarterly pruning strategy. (#8337)
Add 13weekly and 3monthly quarterly pruning strategies.
2024-10-05 16:02:14 +02:00
Thomas Waldmann
3d3fc24af3
docs: mount: document on-demand loading, perf tips, fixes #7173 2024-10-05 14:40:32 +02:00
Thomas Waldmann
b69edd4ae1
docs: borg/borgfs detects internally under which name it was invoked, fixes #8207 2024-10-05 14:23:21 +02:00
Thomas Waldmann
414f18a354
docs: better link modern return codes, fixes #8370 2024-10-05 14:12:53 +02:00
Thomas Waldmann
4bdb3c30f9
binary: using the directory build is faster, fixes #8008 2024-10-05 14:01:58 +02:00
Thomas Waldmann
a793d44f5b
update (c) year 2024-10-05 13:53:16 +02:00
TW
ea619e759d
Merge pull request #8452 from ThomasWaldmann/rename-test-files
Rename test files
2024-10-04 20:51:57 +02:00
Thomas Waldmann
090ee523ad
docs: update "Running the tests (using the pypi package)", fixes #6386 2024-10-04 19:04:43 +02:00
Thomas Waldmann
f795d64538
clean up tool.pytest.ini_options 2024-10-04 18:58:11 +02:00
Thomas Waldmann
40dc9dadb4
rename test files, fix imports/names 2024-10-04 18:56:52 +02:00
TW
b2bdf5e20e
Merge pull request #8450 from ThomasWaldmann/rel200b12
Release 2.0.0b12
2024-10-03 12:47:38 +02:00
Thomas Waldmann
4b7ab4f087
build_usage / build_man 2024-10-03 12:30:58 +02:00
Thomas Waldmann
cb691417ac
update CHANGES 2024-10-03 12:30:56 +02:00
TW
c308f76ddc
Merge pull request #8449 from ThomasWaldmann/tag-command
tag: set, add, remove tags
2024-10-03 11:53:13 +02:00
TW
349e6e37ef
Merge pull request #8447 from ThomasWaldmann/fix-canonical-path-rclone
Location.canonical_path: some fixes, see #8446
2024-10-03 01:00:11 +02:00
Thomas Waldmann
ae0e794355
repo-list: show tags 2024-10-03 00:22:32 +02:00
Thomas Waldmann
e274860983
tag: set, add, remove tags 2024-10-02 23:52:39 +02:00
Thomas Waldmann
136d3dc20e
Location.canonical_path: use empty host if host is None, see #8446
% borg repo-info
Location: rclone:///./pcloud:justtesting
2024-10-02 18:52:47 +02:00
Thomas Waldmann
333663c39c
Location.canonical_path: fix protocol, see #8446
% borg repo-info
Location: rclone://None/./pcloud:justtesting
...
2024-10-02 18:46:01 +02:00
TW
789ffb0c1b
Merge pull request #8438 from ThomasWaldmann/vagrant-updates2
Vagrant updates 2
2024-10-02 17:40:07 +02:00
Thomas Waldmann
e5fe1ddd00
vagrant: use Python 3.11.3
3.11.2 had a compile failure on macos1012.
2024-10-02 17:38:00 +02:00
Thomas Waldmann
0aed3cc2cb
vagrant: macos: give more memory
sometimes the VM just got stuck (usually when building/testing openssl 3),
maybe more RAM helps?
2024-10-02 17:37:59 +02:00
Thomas Waldmann
f7d0cbeeed
vagrant: use bento/ubuntu-24.04 for now 2024-10-02 17:37:54 +02:00
TW
54fac33e69
Merge pull request #8445 from ThomasWaldmann/rclone-docs-fixes
rclone docs fixes
2024-10-02 17:29:02 +02:00
Thomas Waldmann
ecd0cd07e2
docs: fix typo 2024-10-02 17:28:21 +02:00
Thomas Waldmann
940ec7b455
docs: point to rclone docs 2024-10-02 17:27:42 +02:00
TW
8cd951f324
Merge pull request #8436 from ThomasWaldmann/analyze-cmd
analyze: changed chunks per directory
2024-10-02 17:22:08 +02:00
Thomas Waldmann
de439ee839
analyze: sum up changed chunks per parent directory 2024-10-02 16:14:44 +02:00
TW
5a87b41e37
Merge pull request #8444 from ThomasWaldmann/refresh-lock-many-unchanged-files
Refresh lock at more places
2024-10-02 14:13:39 +02:00
Thomas Waldmann
d99107197e
repository: also refresh the lock in other repo methods
get/put_manifest and store_* methods.
2024-10-02 13:05:59 +02:00
Thomas Waldmann
f1100f3c86
create: fix repo lock getting stale when processing lots of unchanged files, fixes #8442
as a side effect, maybe also better keeps the ssh / tcp connection alive,
if there is a bit of traffic every 60s.
2024-10-02 12:49:39 +02:00
TW
29d16f5c41
Merge pull request #8441 from ThomasWaldmann/fix-close-store-on-exception
make sure the store gets closed in case of exceptions, fixes #8413
2024-10-02 11:07:34 +02:00
TW
e2198abd03
Merge pull request #8439 from ThomasWaldmann/fix-msgpack-max-buffer-size
msgpack: increase max_buffer_size to ~4GiB
2024-10-01 21:24:16 +02:00
Thomas Waldmann
32600793b3
make sure the store gets closed in case of exceptions, fixes #8413 2024-10-01 21:23:29 +02:00
Thomas Waldmann
e251162998
msgpack: increase max_buffer_size to ~4GiB
as borg now uses repository.store_load and .store_save to load
and save the chunks cache, we need a rather high limit here.

this is a quick fix, the real fix might be using chunks of the
data (preferably <= MAX_OBJECT_SIZE), so there is less to unpack
at once.
2024-10-01 19:57:16 +02:00
TW
86c889cfeb
Merge pull request #8437 from ThomasWaldmann/vagrant-updates
Vagrant updates
2024-09-30 20:41:16 +02:00
Thomas Waldmann
358ceab64d
pin pip to 24.1 until #8415 is fixed 2024-09-30 20:09:48 +02:00
Thomas Waldmann
7a0540db7b
vagrant: install rust on *BSD 2024-09-30 17:37:49 +02:00
Thomas Waldmann
c3a63bd2b2
use python 3.12.6 for binary builds 2024-09-30 17:33:06 +02:00
TW
1700c7a4ea
Merge pull request #8435 from ThomasWaldmann/check-archive-timestamp
check: also display archive timestamp
2024-09-29 00:52:23 +02:00
TW
069cbb44ee
Merge pull request #8434 from ThomasWaldmann/levels-config-for-borgstore
give borgstore.Store a complete levels configuration, fixes #8432
2024-09-28 23:05:23 +02:00
Thomas Waldmann
2e37b1a15c
check: also display archive timestamp 2024-09-28 22:58:44 +02:00
Thomas Waldmann
0d269e7f85
give borgstore.Store a complete levels configuration, fixes #8432
also:
- add BORG_STORE_DATA_LEVELS=2 env var
- use BORG_STORE_DATA_LEVELS=0 to speed up tests
2024-09-28 21:16:56 +02:00
TW
156d33e69c
Merge pull request #8429 from ThomasWaldmann/improve-matching
AND-matching also on host, user, tags
2024-09-28 20:42:08 +02:00
Thomas Waldmann
f082df7f33
allow -a / --match-archives multiple times, ANDed
e.g.: borg delete -a home -a user:kenny -a host:kenny-pc
2024-09-27 00:19:15 +02:00
Thomas Waldmann
b8b05141ee
implement --match-archives user:USERNAME host:HOSTNAME 2024-09-26 23:22:11 +02:00
Thomas Waldmann
d30fa6f28e
implement --match-archives tags:TAG1,TAG2,...
also: reduce code duplication
2024-09-26 23:09:23 +02:00
TW
2a01d29cda
Merge pull request #8428 from ThomasWaldmann/tags-fixes
fixes for tags infrastructure PR
2024-09-26 23:02:23 +02:00
Thomas Waldmann
d5b4a696bb
fixes for tags infrastructure PR 2024-09-26 22:41:21 +02:00
TW
70977a323b
Merge pull request #8426 from ThomasWaldmann/archive-tags-metadata
tags: low-level infrastructure for archive tags
2024-09-26 21:24:06 +02:00
TW
9c9a75bdf9
Merge pull request #8421 from ThomasWaldmann/rel200b11
Release 2.0.0 beta11
2024-09-26 20:06:30 +02:00
Thomas Waldmann
89c346b935
tags: low-level infrastructure for archive tags
Read or modify this set, only add validated str to it:

Archive.tags: Optional[set[str]]

borg info [--json] <archive> displays a list of comma-separated archive tags (currently always empty).
2024-09-26 19:16:43 +02:00
TW
3c1f173738
Merge pull request #8422 from ThomasWaldmann/list-more-archive-metadata
List more archive metadata
2024-09-26 17:07:16 +02:00
Thomas Waldmann
9b3a0023c3
repo-list: add hostname/username/comment to default format, reorder, adjust
borg 1.x encouraged users to put everything into the archive name:
- name of the dataset
- timestamp (usually used to make the archive name unique)
- maybe also hostname (when backing up to same repo from multiple hosts)
- maybe also username (when backing up to same repo from multiple users)

borg2 now discourages users from putting the timestamp into the name,
because we rather want same name within a series of archives - thus,
the field width for the name can be narrower.

the ID of the archive is now the only unique identifier, thus it is
moved to the leftmost place.
256bits (64 hex digits) was a bit much and as borg can also deal with
abbreviated IDs, we only show 32bits (8 hex digits) by default.

the ID is followed by the timestamp (also quite "interesting", because
it usually differs for different archives).

then following are: archive name, user name, host name - these might be
always the same if there is only one series of archives in a repo.

use 2 blanks separating the fields for better readability.
2024-09-26 15:53:36 +02:00
Thomas Waldmann
1b680531ee
repo-list --short: only print archive IDs
Needed to change this because listing just the
archive names is pretty useless if names are not
unique.

The short list is likely mostly used by scripts to
iterate over all archives, so outputting IDs is
better.
2024-09-26 09:10:52 +02:00
Thomas Waldmann
fb496bf1b7
build_usage build_man 2024-09-26 07:57:01 +02:00
Thomas Waldmann
439024cba6
update CHANGES 2024-09-26 07:54:38 +02:00
TW
84615385ce
Merge pull request #8420 from ThomasWaldmann/catch-be-error
catch BackendError raised by Store(), see #8373
2024-09-26 07:06:12 +02:00
Thomas Waldmann
628990d32c
fix markup error in change log 2024-09-25 23:53:15 +02:00
Thomas Waldmann
c3038e129d
catch BackendError raised by Store(), see #8373 2024-09-25 23:45:27 +02:00
TW
5be2485627
Merge pull request #8412 from ThomasWaldmann/update-changes
update CHANGES
2024-09-25 23:31:21 +02:00
TW
fa7a935baa
Merge pull request #8419 from ThomasWaldmann/upgrade-pyinstaller
upgrade pyinstaller to 6.10.0, fixes #8366
2024-09-25 23:31:04 +02:00
Thomas Waldmann
328cd22a13
update CHANGES 2024-09-25 23:25:34 +02:00
Thomas Waldmann
ae85f64536
upgrade pyinstaller to 6.10.0 2024-09-25 23:21:32 +02:00
TW
656124e001
Merge pull request #8418 from ThomasWaldmann/update-requirements-locked
update development.lock.txt
2024-09-25 22:48:35 +02:00
TW
fd1a7ddb76
Merge pull request #8417 from ThomasWaldmann/ids-per-chunk
increase IDS_PER_CHUNK, fixes #6945
2024-09-25 22:48:16 +02:00
Thomas Waldmann
1f866ce6c6
update development.lock.txt 2024-09-25 21:14:42 +02:00
Thomas Waldmann
015e3a43aa
increase IDS_PER_CHUNK, fixes #6945 2024-09-25 20:57:28 +02:00
TW
67b62b5989
Merge pull request #8411 from ThomasWaldmann/optimize-repo-list-usage
bugfix: remove superfluous repository.list() call
2024-09-25 11:06:09 +02:00
Thomas Waldmann
1436bbba1a
bugfix: remove superfluous repository.list() call
Because it ended the loop only when .list() returned an
empty result, this always needed one call more than
necessary.

We can also detect that we are finished, if .list()
returns less than the limit we gave to it.

Also: reduce code duplication by using repo_lister func.
2024-09-24 23:43:08 +02:00
TW
7d02fe2b8f
Merge pull request #8403 from ThomasWaldmann/cache-chunkindex
chunks index caching
2024-09-24 23:37:29 +02:00
Thomas Waldmann
36e3d63474
chunks index caching, fixes #8397
borg compact now uses ChunkIndex (a specialized, memory-efficient data structure),
so it needs less memory now. Also, it saves that chunks index to cache/chunks in
the repository.

When the chunks index is needed, it is first tried to get it from cache/chunks.
If that fails, fall back to building the chunks index via repository.list(),
which can be rather slow and immediately cache the resulting ChunkIndex in the
repo.

borg check --repair currently just deletes the chunks cache, because it might
have deleted some invalid chunks in the repo.

cache.close now saves the chunks index to cache/chunks in repo if it
was modified.
thus, borg create will update the cached chunks index with new chunks.

cache/chunks_hash can be used to validate cache/chunks (and also to validate /
invalidate locally cached copies of that).
2024-09-24 22:25:00 +02:00
TW
1e6f71f2f5
Merge pull request #8408 from helmutg/faq-slow-fat
FAQ: Why is backing up an unmodified FAT filesystem slow on Linux?
2024-09-23 13:46:46 +02:00
Helmut Grohne
70f173caa7 FAQ: Why is backing up an unmodified FAT filesystem slow on Linux? 2024-09-23 10:36:56 +02:00
TW
527454840b
Merge pull request #8405 from ThomasWaldmann/support-rclone-borgstore
add support for rclone:// repositories (via borgstore)
2024-09-22 23:27:27 +02:00
Thomas Waldmann
bd6caf835d
add support for rclone:// repositories (via borgstore) 2024-09-22 22:26:07 +02:00
TW
4d8954ecbb
Merge pull request #8404 from ThomasWaldmann/fix-build-files-cache
cache: fix crash in _build_files_cache
2024-09-22 01:34:21 +02:00
Thomas Waldmann
e5e685fd1f
cache: fix crash in _build_files_cache 2024-09-22 00:36:30 +02:00
TW
b862f2b95f
Merge pull request #8389 from ThomasWaldmann/files-cache-from-archive
files cache improvements
2024-09-21 15:17:29 +02:00
Thomas Waldmann
ec9d412756
fix race condition with data loss potential, fixes #3536
we discard all files cache entries referring to files
with timestamps AFTER we started the backup.

so, even in case we would back up an inconsistent file
that has been changed while we backed it up, we would
not have a files cache entry for it and would fully
read/chunk/hash it again in next backup.
2024-09-21 11:34:34 +02:00
Thomas Waldmann
b60378cf0e
fix race condition with data loss potential, fixes #3536
if we detect the conditions for this (rare) race,
abort reading the file and retry.

The caller (_process_any) will do up to MAX_RETRIES
before giving up. If it gives up, a warning is logged
and the file is not written to the archive and won't
be memorized in the files cache either.

Thus, the file will be read/chunked/hashed again at
the next borg create run.
2024-09-21 11:34:31 +02:00
TW
275e5e136c
Merge pull request #8399 from ThomasWaldmann/storelocking-updates
storelocking: fixes / cleanups
2024-09-20 14:28:01 +02:00
Thomas Waldmann
31e5318e66
storelocking: fixes / cleanups
- on explicit request, update .last_refresh_dt inside _create_lock / _delete_lock
- reset .last_refresh_dt if we kill our own lock
- be more precise, have exactly the datetime of the lock in .last_refresh_dt
- cosmetic: do refresh/stale time comparisons always in the same way
2024-09-20 11:49:40 +02:00
Thomas Waldmann
c100e7b1f5
files cache: update ctime, mtime of known and "unchanged" files, fixes #4915 2024-09-20 00:44:55 +02:00
Thomas Waldmann
a891559578
files cache improvements, fixes #8385, fixes #5658
- changes to locally stored files cache:

  - store as files.<H(archive_name)>
  - user can manually control suffix via env var
  - if local files cache is not found, build from previous archive.
- enable rebuilding the files cache via loading the previous
  archive's metadata from the repo (better than starting with
  empty files cache and needing to read/chunk/hash all files).
  previous archive == same archive name, latest timestamp in repo.
- remove AdHocCache (not needed any more, slow)
- remove BORG_CACHE_IMPL, we only have one
- remove cache lock (this was blocking parallel backups to same
  repo from same machine/user).

Cache entries now have ctime AND mtime.

Note: TTL and age still needed for discarding removed files.
      But due to the separate files caches per series, the TTL
      was lowered to 2 (from 20).
2024-09-20 00:40:49 +02:00
TW
385eeeb4d5
Merge pull request #8398 from ThomasWaldmann/repo-compress-using-chunkindex
repo-compress: use chunkindex rather than repository.list()
2024-09-19 19:42:41 +02:00
Thomas Waldmann
f1a39a059e
repo-compress: use chunkindex rather than repository.list()
repository.list is slow, so rather use the chunkindex,
which might be cached in future. currently, it also uses
repository.list, but at least we can solve the problem
at one place then.
2024-09-19 18:59:03 +02:00
TW
3fd1587dd7
Merge pull request #8396 from ThomasWaldmann/storelocking-debug-logging
storelocking: add debug logging
2024-09-19 16:38:26 +02:00
Thomas Waldmann
d322889972
storelocking: avoid raising a NotLocked exception while releasing the lock while handling an exception 2024-09-19 15:15:22 +02:00
Thomas Waldmann
6a283200f2
storelocking: add debug logging 2024-09-19 15:15:20 +02:00
TW
8d37c00f7b
Merge pull request #8395 from ThomasWaldmann/msys-updates
msys2: disable SETUPTOOLS_USE_DISTUTILS=stdlib hack
2024-09-19 13:29:21 +02:00
Thomas Waldmann
4c1a0b1ca0
msys2: disable SETUPTOOLS_USE_DISTUTILS=stdlib hack
The msys2 changelog says it is only needed for setuptools < 70.2.0:

https://www.msys2.org/docs/python/#known-issues

https://setuptools.pypa.io/en/stable/history.html#v70-2-0
2024-09-19 12:36:18 +02:00
TW
11b72efffe
Merge pull request #8394 from ThomasWaldmann/list-refresh-lock-frequently
repository.list: refresh lock more frequently
2024-09-19 12:19:29 +02:00
Thomas Waldmann
2a20ebeec7
repository.list: refresh lock more frequently
under all circumstances, we must avoid that the lock
gets stale due to not being refreshed in time.

there is some internal rate limiting in _lock_refresh,
so calling it often should be no problem.
2024-09-19 11:38:49 +02:00
TW
97d1e18626
Merge pull request #8393 from ThomasWaldmann/fix-compact-nonunique-names
fixes for non-unique archive names
2024-09-19 01:52:08 +02:00
Thomas Waldmann
03b139ee53
ArchiveFormatter: fix for non-unique archive names
For Archive(), always use the archive id, not the archive name!
2024-09-19 00:58:45 +02:00
Thomas Waldmann
eb75390240
tests: fix for non-unique archive names
For Archive(), always use the archive id, not the archive name!
2024-09-19 00:58:32 +02:00
Thomas Waldmann
948bc4cdf9
mount: fix for non-unique archive names
For Archive(), always use the archive id, not the archive name!
2024-09-19 00:58:21 +02:00
Thomas Waldmann
f5b3ab66e9
transfer: fix for non-unique archive names
For Archive(), always use the archive id, not the archive name!
2024-09-19 00:58:05 +02:00
Thomas Waldmann
4bce862d95
diff: fix for non-unique archive names
For Archive(), always use the archive id, not the archive name!

Also: remove with_archive decorator usage to get more consistent code.
2024-09-19 00:57:04 +02:00
Thomas Waldmann
6b68b5a4a7
compact: fix for non-unique archive names
For Archive(), always use the archive id, not the archive name!

Also: sorting by timestamp, improved output.
2024-09-19 00:56:25 +02:00
TW
61dd29b815
Merge pull request #8391 from ThomasWaldmann/fix-hashing-time-test
remove the hashing/chunking time tests
2024-09-18 19:39:55 +02:00
Thomas Waldmann
2b69e71465
remove the hashing/chunking time tests
frequently failing on fast machines.
2024-09-18 19:01:05 +02:00
TW
29c7ce4e1f
Merge pull request #8379 from ThomasWaldmann/backup-series
backup series, fixes #7930
2024-09-18 15:03:27 +02:00
Thomas Waldmann
1bc5902718
docs: update about archive series
in borg 1.x, we used to put a timestamp into the archive name to make
it unique, because borg1 required that.

borg2 does not require unique archive names, but it encourages you
to even use an identical archive name within the same SERIES of archives.
that makes matching (e.g. for prune, but also at other places) much
simpler and borg KNOWS which archives belong to the same series.
2024-09-18 14:05:12 +02:00
Thomas Waldmann
a4d2fc8dd7
remote: allow get_manifest method (bugfix)
LegacyRepository of borg2 knows this method.
2024-09-17 20:18:47 +02:00
Thomas Waldmann
dd78b774a0
transfer: checking name is not enough, check name/id and name/ts 2024-09-17 20:18:45 +02:00
Thomas Waldmann
426d1c7dda
manifest: reorder methods, no other changes 2024-09-17 20:18:44 +02:00
Thomas Waldmann
77fc3fb884
manifest: use empty archives/<archive_hex_id>
for the archives directory, we only need to know the archive IDs,
everything else can be fetched from the ArchiveItem in the repo.

so we store empty files into archives/* with the archiv ID as name.

this makes some "by-id" operations much easier and we don't have to
deal with a useless "store_key" anymore.

removed .delete method - we can't delete by name anymore as we
allow duplicate names for the series feature. everything uses
delete_by_id() now.

also: simplify, clean up, refactor
2024-09-17 20:18:40 +02:00
Thomas Waldmann
6ce5f2f230
manifest: use id from directory, fetch other metadata from archive 2024-09-17 20:18:38 +02:00
Thomas Waldmann
bb5cf96fe8
check: fix/enhance code, rewrite test
- we should always output name and id when talking about an archive
- no problem anymore if names in archives directory are "duplicate"
- use "by-id" archives directory entry delete function
- rewrite/simplify test for borg check --undelete-archives
2024-09-17 18:17:07 +02:00
Thomas Waldmann
81a27c1dbe
info/delete/prune: allow positional NAME argument
so if one works with backup series, one can just do:

borg prune --keep-daily 30 seriesname

seriesname will then do a precise match on the archive names
and select that series.
2024-09-17 18:16:36 +02:00
Thomas Waldmann
8237e6beca
NAME is the series, archive id is the hash
aid:<archive-id-prefix> can be used for -a / --match-archives
to match on the archive id (prefix) instead of the name.

NAME positional argument now also supports matching (and aid:),
but requires that there is exactly ONE result.
2024-09-17 18:16:31 +02:00
TW
ed31131fb6
Merge pull request #8384 from ThomasWaldmann/archive-inode
create: also archive inode number, fixes #8362
2024-09-17 12:50:54 +02:00
Thomas Waldmann
ae4abdfe1c
create: also archive inode number, fixes #8362
we could use this if we use the "previous archive" instead of the "files cache"
to determine whether a file is unchanged.
2024-09-17 11:49:05 +02:00
TW
e4b5a59be0
Merge pull request #8383 from ThomasWaldmann/sftp-url-docs
docs: user@ and :port are optional in sftp and ssh URLs
2024-09-17 10:06:54 +02:00
TW
4e05e78e35
Merge pull request #8382 from sothix/8264-windows-ci-broken
Fix for #8264 Windows CI broken and #8381 Windows build failing
2024-09-17 10:03:55 +02:00
Thomas Waldmann
82a1d38bcc
docs: user@ and :port are optional in sftp and ssh URLs 2024-09-17 10:01:33 +02:00
Thomas Waldmann
8790371ac8
map EISDIR to BackupPermissionError class also
macOS and Linux give EISDIR, while Windows gives EPERM when trying to
open a file for writing, if the filename is already taken by an existing
directory.

now all OSes should give the same RC in this case.
2024-09-16 12:01:41 +02:00
Thomas Waldmann
de249f611e
CI: enable windows build 2024-09-15 22:56:06 +02:00
sothix
f11dc50070 Pip Fix 2024-09-15 23:35:24 +10:00
TW
c278a8e859
Merge pull request #8377 from AfroThundr3007730/AfroThundr3007730/issue8361
Update repository URLs in docs to use new syntax
2024-09-14 13:45:33 +02:00
Eddie Carswell
9fe3cb686f
Update repository URLs in docs to use new syntax
Fixes #8361

Signed-off-by: Eddie Carswell <eddiecarswell13@yahoo.com>
2024-09-11 22:03:59 -05:00
TW
5de5367092
Merge pull request #8364 from ThomasWaldmann/rel200b10
Release 2.0.0 beta 10
2024-09-09 23:25:22 +02:00
Thomas Waldmann
bb31b42310
build_usage build_man 2024-09-09 16:58:06 +02:00
Thomas Waldmann
58fe5ad02a
update CHANGES 2024-09-09 16:51:12 +02:00
TW
64a20cc9d8
Merge pull request #8363 from ThomasWaldmann/remove-config-cmd-docs
remove "borg config" docs
2024-09-09 14:02:35 +02:00
Thomas Waldmann
3ff33684c6
remove "borg config" docs
the config command was already removed before.
2024-09-09 13:42:31 +02:00
TW
00694774fb
Merge pull request #8358 from ThomasWaldmann/repo-commands-rename
repo commands renamed r* -> repo-*
2024-09-09 13:38:38 +02:00
Thomas Waldmann
cfd35b4bd6
update CHANGES 2024-09-09 11:22:38 +02:00
TW
275dabbc23
Merge pull request #8360 from ThomasWaldmann/borgstore-requirement
require borgstore~=0.0.1
2024-09-09 02:13:16 +02:00
Thomas Waldmann
46878c3bd8
require borgstore ~= 0.0.1
so we can do borgstore releases:

- 0.0.x == compatible fixes, would match
- 0.1.0 could be incompatible changes, would not match
2024-09-09 00:51:13 +02:00
Thomas Waldmann
7f1fc0cf63
docs: build_man 2024-09-08 18:11:44 +02:00
Thomas Waldmann
ecb838d5e7
src: fix man page names 2024-09-08 18:11:41 +02:00
Thomas Waldmann
78c7aabbb6
docs: fix usage docs and references for repo-* commands 2024-09-08 18:06:26 +02:00
Thomas Waldmann
04dfadbbd6
cli: rename r* commands to repo-*
also:
- adapt tests
- adapt BuildMan manpage generation
- adapt help strings / doc strings
- docs
2024-09-08 18:06:24 +02:00
Thomas Waldmann
a7bfd4aec8
src: renamed r*_epilog attrs to repo_*_epilog, fixed references 2024-09-08 16:13:43 +02:00
Thomas Waldmann
149ff7541d
src: renamed do_r* methods to do_repo_*, fixed imports 2024-09-08 16:09:41 +02:00
Thomas Waldmann
51d019c1ba
src: renamed build_parser_r* methods to build_parser_repo_*, fixed imports 2024-09-08 16:06:20 +02:00
Thomas Waldmann
4fe6d7fd19
src: renamed R*MixIn archiver classes to Repo*MixIn, fixed imports 2024-09-08 15:37:41 +02:00
Thomas Waldmann
f8d07e7d16
src: renamed r* archiver modules to repo_*, fixed imports 2024-09-08 15:33:11 +02:00
TW
ea08e49210
Merge pull request #8332 from ThomasWaldmann/use-borgstore
use borgstore and other big changes
2024-09-08 15:16:24 +02:00
Thomas Waldmann
3794e32890
--append-only and --storage-quota are not supported (yet?) 2024-09-08 12:32:35 +02:00
Thomas Waldmann
b50ed04ffc
build_usage / build_man 2024-09-08 12:02:17 +02:00
Thomas Waldmann
7442cbf8cf
update CHANGES 2024-09-08 12:01:10 +02:00
Thomas Waldmann
682aedba50
check --repair --undelete-archives: bring archives back from the dead
borg delete and borg prune do a quick and dirty archive deletion,
just removing the archives directory entry for them.

--undelete-archives can still find the archive metadata objects
by completely scanning the repository and re-create missing
archives directory entries.

but only until borg compact would remove all unused data.

if only the manifest is missing or corrupted, do not run that
scan, it is not required for the manifest anymore.
2024-09-08 12:01:06 +02:00
Thomas Waldmann
bc1f90b641
check: do not create addtl. archives dir entries if we already have one
if the manifest file is missing, check generated *.1 *.2 ... archives although an entry for the correct name and id was already
present. BUG!

this is because if the manifest is lost, that does not imply
anymore that the complete archives directory is also lost, as it
did in borg 1.x.

Also improved log messages a bit.
2024-09-08 12:01:05 +02:00
Thomas Waldmann
a509a0c463
locking: no traceback on lock timeout (expected) 2024-09-08 12:01:03 +02:00
Thomas Waldmann
0e183b225d
shared locking for many borg commands
not for check and compact, these need an exclusive lock.

to try parallel repo access on same machine, same user,
one needs to use a non-locking cache implementation:

export BORG_CACHE_IMPL=adhoc

this is slow due the missing files cache in that implementation,
but unproblematic because no caches/indexes are persisted.
2024-09-08 12:01:01 +02:00
Thomas Waldmann
8412168555
check: only write to repo if --repair is given
old borg just didn't commit the transaction and
thus caused a transaction rollback if not in
repair mode.

we can't do that anymore, thus we must avoid
modifying the repo if not in repair mode.
2024-09-08 12:01:00 +02:00
Thomas Waldmann
ef7dd76da1
manifest: no read-modify-write for borgstore archives list
previously, borg always read all archives entries, modified the
list in memory, wrote back to the repository (similar as borg 1.x
did).

now borg works directly with archives/* in the borgstore.
2024-09-08 12:00:58 +02:00
Thomas Waldmann
b56c81bf62
manifest.archives: refactor api
Archives was built with a dictionary-like api,
but in future we want to go away from a
read-modify-write archives list.
2024-09-08 12:00:57 +02:00
Thomas Waldmann
b82ced274f
refactor: move archives related code from Manifest to Archives class 2024-09-08 12:00:54 +02:00
Thomas Waldmann
60e88efa94
repository: catch store backend exception, re-raise as repo exception 2024-09-08 12:00:53 +02:00
Thomas Waldmann
ace97fadec
docs: updates / removing outdated stuff 2024-09-08 12:00:50 +02:00
Thomas Waldmann
b14c050f69
rspace: manage reserved space in repository 2024-09-07 22:05:05 +02:00
Thomas Waldmann
1cd2f4dca3
locking: deal with potential auto-expire during suspend 2024-09-07 22:05:04 +02:00
Thomas Waldmann
7bf0f47fea
check repository: implement --max-duration and checkpoints, fixes #6039 2024-09-07 22:05:02 +02:00
Thomas Waldmann
60a592d50f
with-lock: refresh repo lock while subprocess is running, fixes #8347
otherwise the lock might become stale and could get
killed by any other borg process.

note: ThreadRunner class written by PyCharm AI and
only needed small enhancements. nice.
2024-09-07 22:05:00 +02:00
Thomas Waldmann
dc9fff9953
locking: ignore+delete locks of dead processes 2024-09-07 22:04:58 +02:00
Thomas Waldmann
86dc673649
compact: fix dsize computation if wanted chunks are present in repo 2024-09-07 22:04:56 +02:00
Thomas Waldmann
551834acfc
rcompress: not supported for legacy repos 2024-09-07 22:04:55 +02:00
Thomas Waldmann
e2aa9d56d0
build_chunkindex_from_repo: reduce code duplication 2024-09-07 22:04:53 +02:00
Thomas Waldmann
07ab6e02f4
hashindex types: remove some unused stuff 2024-09-07 22:04:52 +02:00
Thomas Waldmann
15c70397c1
ChunkIndex: remove unused .merge method
LocalCache used this to assemble a new overall chunks index from multiple
chunks.archive.d's single-archive chunks indexes.
2024-09-07 22:04:50 +02:00
Thomas Waldmann
ddf6812703
ChunkIndex: remove .incref method 2024-09-07 22:04:49 +02:00
Thomas Waldmann
ccc84c7a4e
cache: renamed .chunk_incref -> .reuse_chunk, boolean .seen_chunk
reuse_chunk is the complement of add_chunk for already existing chunks.

It doesn't do refcounting anymore.

.seen_chunk does not return the refcount anymore, but just whether the chunk exists.

If we add a new chunk, it immediately sets its refcount to MAX_VALUE, so
there is no difference anymore between previously existing chunks and new
chunks added. This makes the stats even more useless, but we have less complexity.
2024-09-07 22:04:47 +02:00
Thomas Waldmann
f9d2e6827b
ArchiveChecker: don't do precise refcounting here
That's the job of borg compact and not needed inside borg check.
check only needs to know if a chunk is present in the repo.
2024-09-07 22:04:46 +02:00
Thomas Waldmann
e9c42a7d6b
ArchiveChecker: .rebuild_refcounts -> .rebuild_archives 2024-09-07 22:04:44 +02:00
Thomas Waldmann
266e6caa80
ArchiveChecker: remove unused possibly_superseded code
We don't care about unused or superseded repo objects any more here,
borg compact will deal with them.
2024-09-07 22:04:43 +02:00
Thomas Waldmann
bafbf625e7
ArchiveChecker.verify_data: simplify / optimize
.init_chunks has just built self.chunks using repository.list(), so don't
call that again, but just iterate over self.chunks.

also some other changes, making the code much simpler.
2024-09-07 22:04:41 +02:00
Thomas Waldmann
ef47666627
cache/hashindex: remove decref method, don't try to remove chunks on exceptions
When the AdhocCache(WithFiles) queries chunk IDs from the repo to build the chunks
index, it won't know their refcount and thus all chunks in the index have their
refcount at the MAX_VALUE (representing "infinite") and that would never decrease
nor could that ever reach zero and get the chunk deleted from the repo.

Only completely new chunks first written in the current borg run have a valid
refcount.

In some exception handlers, borg tried to clean up chunks that won't be used
by an item by decref'ing them. That is either:
- pointless due to refcount being at MAX_VALUE
- inefficient, because the user might retry the backup and would need to
  transmit these chunks to the repo again.

We'll just rely on borg compact ONLY to clean up any unused/orphan chunks.
2024-09-07 22:04:40 +02:00
Thomas Waldmann
d27b7a7981
cache: remove transactions, load files/chunks cache on demand 2024-09-07 22:04:38 +02:00
Thomas Waldmann
57268909f8
upgrade black to 24.x 2024-09-07 22:04:36 +02:00
Thomas Waldmann
a40978ae1b
blacken the code 2024-09-07 22:04:35 +02:00
Thomas Waldmann
ec1d89f477
compact: better stats
- compression factor
- dedup factor
- repo size

All values are approx. values without considering overheads.
2024-09-07 22:04:34 +02:00
Thomas Waldmann
c67cf07522
Repository.list: return [(id, stored_size), ...]
Note: LegacyRepository still returns [id, ...] and so does RemoteRepository.list,
if the remote repo is a LegacyRepository.

also: use LIST_SCAN_LIMIT
2024-09-07 22:03:56 +02:00
Thomas Waldmann
a15cd1e493
repository: remove __len__ and __contains__ 2024-09-07 22:01:21 +02:00
Thomas Waldmann
1a382a8bcf
set repository._location only 2024-09-07 22:01:19 +02:00
Thomas Waldmann
3408e942de
add sftp: / borgstore to quickstart docs 2024-09-07 22:01:18 +02:00
Thomas Waldmann
22b68b0199
add sftp: to repository url format docs 2024-09-07 22:01:16 +02:00
Thomas Waldmann
ec8a127b01
BORG_REPO env var: behave the same when unset or when set to empty string 2024-09-07 22:01:14 +02:00
Thomas Waldmann
7714b6542a
support sftp: repositories via borgstore 2024-09-07 22:01:12 +02:00
Thomas Waldmann
05739aaa65
refactor: rename repository/locking classes/modules
Repository -> LegacyRepository
RemoteRepository -> LegacyRemoteRepository
borg.repository -> borg.legacyrepository
borg.remote -> borg.legacyremote

Repository3 -> Repository
RemoteRepository3 -> RemoteRepository
borg.repository3 -> borg.repository
borg.remote3 -> borg.remote

borg.locking -> borg.fslocking
borg.locking3 -> borg.storelocking
2024-09-07 22:01:11 +02:00
Thomas Waldmann
84bd2b20d5
rcreate: refer to borgstore rather than filesystem directory 2024-09-07 22:01:09 +02:00
Thomas Waldmann
15e759c506
rcompress: fix help and comments
no "on-disk order" anymore.
2024-09-07 22:01:08 +02:00
Thomas Waldmann
8455c95003
info: do not output deduplicated_size
No precise refcounting, can't compute that inexpensively.
2024-09-07 22:01:06 +02:00
Thomas Waldmann
0b85b1a8bd
parseformat: remove dsize and unique_chunks placeholder
We don't have precise refcounts, thus we can't compute these.
2024-09-07 22:01:04 +02:00
Thomas Waldmann
c5023da729
transfer: rather talk of presence than refcount 2024-09-07 22:01:02 +02:00
Thomas Waldmann
20c180c317
debug: remove refcount-obj command
borg doesn't do precise refcounting anymore, so this is pretty useless.
2024-09-07 22:01:01 +02:00
Thomas Waldmann
2be98c773b
check: update comment / help 2024-09-07 22:01:00 +02:00
Thomas Waldmann
d9f24def6a
remove unused remote.RepositoryServer 2024-09-07 22:00:59 +02:00
Thomas Waldmann
e23231b2c4
remove Repository3.commit
didn't do anything anyway in this implementation.
2024-09-07 22:00:56 +02:00
Thomas Waldmann
5e3f2c04d5
remove archive checkpointing
borg1 needed this due to its transactional / rollback behaviour:
if there was uncommitted stuff in the repo, next repo opening automatically
rolled back to last commit. thus we needed checkpoint archives to reference
chunks and commit the repo.

borg2 does not do that anymore, unused chunks are only removed when the
user invokes borg compact.

thus, if a borg create gets interrupted, the user can just run borg create
again and it will find some chunks are already in the repo, making progress
even if borg create gets frequently interrupted.
2024-09-07 22:00:54 +02:00
Thomas Waldmann
c2890efdd1
docs: update the repository filesystem docs
In the end, it will all depend on the borgstore backend that will be used,
so we better point to the borgstore project for details.
2024-09-07 22:00:52 +02:00
Thomas Waldmann
5c325e3254
repository3.list: more efficient implementation 2024-09-07 22:00:50 +02:00
Thomas Waldmann
68e64adb9f
cache: add log msg to _load_chunks_from_repo
For big repos, this might take a while, so at least have messages on debug level.
2024-09-07 22:00:49 +02:00
Thomas Waldmann
6605f588cf
remove the repository.flags call / feature
this heavily depended on having a repository index where the flags get stored.

we don't have that with borgstore.
2024-09-07 22:00:48 +02:00
Thomas Waldmann
60edc8255f
repository/repository3: remove .scan method
This was an implementation specific "in on-disk order" list method that made sense
with borg 1.x log-like segment files only.

But we now store objects separately, so there is no "in on-disk order" anymore.
2024-09-07 22:00:46 +02:00
Thomas Waldmann
1189fc3495
debug dump-repo-objs: remove --ghost
This was used for an implementation detail of the borg 1.x
repository code, dumping uncommitted objects. Not needed any more.

Also remove local repository method scan_low_level, it was only used by --ghost.
2024-09-07 22:00:45 +02:00
Thomas Waldmann
bfbf3ba7aa
repository3.check: implement --repair
Tests were a bit tricky as there is validation on 2 layers now:
- repository3 does an xxh64 check, finds most corruptions already
- on the archives level, borg also does an even stronger cryptographic check
2024-09-07 22:00:43 +02:00
Thomas Waldmann
cb9ff3b490
fuse/mount code and test fixes 2024-09-07 22:00:41 +02:00
Thomas Waldmann
3e7a4cd814
make ruff happy 2024-09-07 22:00:40 +02:00
Thomas Waldmann
1231c961fb
blacken the code 2024-09-07 22:00:39 +02:00
Thomas Waldmann
d59306f48b
rinfo: remove size stats related docs, not shown any more 2024-09-07 22:00:38 +02:00
Thomas Waldmann
dcde48490e
remove CacheStatsMixin 2024-09-07 22:00:36 +02:00
Thomas Waldmann
fc6d459875
cache: replace .stats() by a dummy
Dummy returns all-zero stats from that call.

Problem was that these values can't be computed from the chunks cache
anymore. No correct refcounts, often no size information.

Also removed hashindex.ChunkIndex.summarize (previously used by the above mentioned
.stats() call) and .stats_against (unused) for same reason.
2024-09-07 22:00:35 +02:00
Thomas Waldmann
0306ba9a63
get rid of the CacheSynchronizer
Lots of low-level code written back then to optimize runtime of some
functions.

We'll solve this differently by doing less stats, esp. if it is expensive to compute.
2024-09-07 22:00:33 +02:00
Thomas Waldmann
7a93890602
archive.calc_stats: remove unique size computation 2024-09-07 22:00:32 +02:00
Thomas Waldmann
d6a70f48f2
remove LocalCache
Note: this is the default cache implementation in borg 1.x,
it worked well, but there were some issues:

- if the local chunks cache got out of sync with the repository,
  it needed an expensive rebuild from the infos in all archives.
- to optimize that, a local chunks.archive.d cache was used to
  speed that up, but at the price of quite significant space needs.

AdhocCacheWithFiles replaced this with a non-persistent chunks cache,
requesting all chunkids from the repository to initialize a simplified
non-persistent chunks index, that does not do real refcounting and also
initially does not have size information for pre-existing chunks.

We want to move away from precise refcounting, LocalCache needs to die.
2024-09-07 22:00:31 +02:00
Thomas Waldmann
4c052cd65d
delete: just remove archive from manifest, let borg compact clean up later.
much faster and easier now, similar to what borg delete --force --force used to do.

considering that speed, no need for checkpointing anymore.

--stats does not work that way, thus it was removed. borg compact now shows some stats.
2024-09-07 22:00:29 +02:00
Thomas Waldmann
17ea118155
check: remove orphan chunks detection/cleanup
This is now done in borg compact, so borg check does not need to care.
2024-09-07 22:00:28 +02:00
Thomas Waldmann
8ef517161d
compact: reimplement "borg compact" as garbage collection
It also outputs some statistics and warns about missing/reappeared chunks.
2024-09-07 22:00:27 +02:00
Thomas Waldmann
8c2cbdbb55
compact: remove "borg compact", not needed any more
All chunks are separate objects in borgstore.
2024-09-07 22:00:25 +02:00
Thomas Waldmann
c292ee25c5
rcompress: use get/put_manifest 2024-09-07 22:00:24 +02:00
Thomas Waldmann
b637542dcf
repository3/manifest: tests reenabled, fixes 2024-09-07 22:00:23 +02:00
Thomas Waldmann
8b9c052acc
manifest: store archives separately one-by-one into archives/*
repository:
- api/rpc support for get/put manifest
- api/rpc support to access the store
2024-09-07 22:00:21 +02:00
Thomas Waldmann
72d0caeb6b
locking3: store-based repo locking
Features:
- exclusive and non-exclusive locks
- acquire timeout
- lock auto-expiry (after 30mins of inactivity), lock refresh
- use tz-aware datetimes (in utc timezone) in locks

Also:
- document lock acquisition rules in the src
- increased default BORG_LOCK_WAIT to 10s
- better document with-lock test

Stale locks are ignored and automatically deleted.
Default: stale == 30 Minutes old.

lock.refresh() can be called frequently to avoid that an acquired lock becomes stale.
It does not do much if the last real refresh was recently.
After stale/2 time it checks and refreshes the locks in the store.

Update the repository3 code to call refresh frequently:
- get/put/list/scan
- inside check loop
2024-09-07 22:00:20 +02:00
Thomas Waldmann
c740fd718b
transfer: fix upgrades from borg 1.x by adding a --from-borg1 option
borg transfer is primarily a general purpose archive transfer function
from borg2 to related borg2 repos.

but for upgrades from borg 1.x, we also need to support:
- rcreate with a borg 1.x "other repo"
- transfer with a borg 1.x "other repo"
2024-09-07 22:00:17 +02:00
TW
ffd1280d5b
Merge pull request #8345 from ThomasWaldmann/py313
Python 3.13
2024-08-29 14:31:05 +02:00
Thomas Waldmann
a8381673b0
support / test on Python 3.13 2024-08-29 00:00:52 +02:00
Thomas Waldmann
d95cacd624
implement Repository3.check
It uses xxh64 hashes of the meta and data parts to verify their validity.
On a server with borg, this can be done server-side without the borg key.

The new RepoObj header has meta_size, data_size, meta_hash and data_hash.
2024-08-23 23:55:12 +02:00
Thomas Waldmann
d30d5f4aec
Repository3 / RemoteRepository3: implement a borgstore based repository
Simplify the repository a lot:

No repository transactions, no log-like appending, no append-only, no segments,
just using a key/value store for the individual chunks.

No locking yet.

Also:

mypy: ignore missing import
there are no library stubs for borgstore yet, so mypy errors without that option.

pyproject.toml: install borgstore directly from github
There is no pypi release yet.

use pip install -e . rather than python setup.py develop
The latter is deprecated and had issues installing the "borgstore from github" dependency.
2024-08-23 23:55:09 +02:00
TW
ea718b98f2
Merge pull request #8314 from ruben-rodriguez/master
docs: align /etc/backups path references in automated backups deployment guide
2024-08-02 21:31:19 +02:00
TW
e7533944ad
Merge pull request #8315 from ThomasWaldmann/cleanups-master
remove outdated comment, fixes #4240
2024-08-02 21:30:30 +02:00
Ruben Rodriguez
6978584de6
docs: align /etc/backups path in all references 2024-08-01 15:31:38 +02:00
Thomas Waldmann
3a5ee93401
remove outdated comment, fixes #4240 2024-07-31 15:25:54 +02:00
TW
6039349932
Merge pull request #8312 from dtugend/doc-TIMESPAN
Add TIMESPAN to doc
2024-07-31 10:57:17 +02:00
Dominik Tugend
e715b9f5af Add TIMESPAN to doc
- Closes borgbackup/borg#8310
2024-07-30 23:49:50 +02:00
TW
364eb87ae2
Merge pull request #8286 from pktiuk/patch-1
Add Open Collective to FUNDING.yml
2024-07-27 00:37:42 +02:00
Thomas Waldmann
69ce4bd9ee
add github sponsors
also: reorder
2024-07-26 23:51:36 +02:00
TW
929c642b6e
Merge pull request #8304 from ThomasWaldmann/improve-healing-test-master
improve borg check --repair healing tests, see #8302
2024-07-23 22:31:46 +02:00
Thomas Waldmann
c6f95de492
improve borg check --repair healing tests, see #8302
test the healing more thoroughly:
- preservation of correct chunks list in .chunks_healthy
- check that .chunks_healthy is removed after healing
- check that doing another borg check --repair run does not find
  something to heal, again.

also did a datatype consistency fix for item.chunks_healthy list
members: they are now post processed in the same way as item.chunks,
so they have type ChunkListEntry rather than simple tuple.
2024-07-23 20:49:24 +02:00
TW
83aed450e9
Merge pull request #8293 from ThomasWaldmann/rel200b9
Release 2.0.0b9
2024-07-20 18:34:55 +02:00
Thomas Waldmann
84e87239bc
fix pypi repo name in upload script
it needs to be like this to support a ~/.pypirc like this,
containing a separate upload token for the borgbackup project:

[distutils]
index-servers =
    borgbackup
    ...

[borgbackup]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-...(token)...
2024-07-20 17:47:59 +02:00
Thomas Waldmann
7aabe8204c
fix binary_archiver tests for modern exit codes 2024-07-20 00:39:37 +02:00
Paweł Kotiuk
f777263997 Add Open Collective and Liberapay to FUNDING.yml
Source: https://www.borgbackup.org/support/fund.html
2024-07-19 20:41:06 +00:00
Thomas Waldmann
edfca29b97
build_usage / build_man 2024-07-19 20:40:15 +02:00
Thomas Waldmann
6778f2976a
update CHANGES 2024-07-19 20:39:32 +02:00
TW
4fe94bf77e
Merge pull request #8291 from ThomasWaldmann/key-export-filename-master
key export fixes (master)
2024-07-19 20:32:53 +02:00
Thomas Waldmann
4e6238e7d3
key export: fix exception handling
export_paperkey also must not get an already existing directory.
2024-07-19 19:55:14 +02:00
Thomas Waldmann
5eecdfa133
key export: fix crash when no path is given
In this case, the export functions output to stdout.

Also: add a note why this code is needed.
2024-07-19 19:48:25 +02:00
Thomas Waldmann
6211a3dc79
key export: move examples to docs 2024-07-19 19:44:38 +02:00
TW
4312a74c33
Merge pull request #8290 from ThomasWaldmann/modern-exit-codes-by-default
make BORG_EXIT_CODES="modern" the default, fixes #8110
2024-07-19 19:03:13 +02:00
Thomas Waldmann
ecddbc6691
make BORG_EXIT_CODES="modern" the default. 2024-07-19 17:31:36 +02:00
TW
3c480d9057
Merge pull request #8289 from ThomasWaldmann/beta-notes-master
Beta testing notes / binary readme
2024-07-19 15:13:56 +02:00
TW
995ec3036a
Merge pull request #8288 from ThomasWaldmann/vagrant-machines-master
Vagrant machines updates (port to master)
2024-07-19 14:44:07 +02:00
Thomas Waldmann
044acfd5dd
add docs/binaries/00_README.txt
I usually just uploaded that into the GH release assets,
but let's also have it in git.
2024-07-19 14:43:30 +02:00
Thomas Waldmann
16c52040e4
README: add note about beta testing
not: "in production testing"
2024-07-19 14:41:37 +02:00
Thomas Waldmann
a6fdb4dec0
vagrant: netbsd/openbsd: add version number 2024-07-19 14:16:22 +02:00
Thomas Waldmann
296c674fdf
vagrant: macos: add version number to call param 2024-07-19 14:16:07 +02:00
Thomas Waldmann
f4367d66d8
vagrant: darwin -> macos
Also: add macOS version number.
2024-07-19 14:15:15 +02:00
Thomas Waldmann
445dd69eba
vagrant: adapt fetch-binaries script 2024-07-19 14:14:58 +02:00
Thomas Waldmann
0b660e0e75
vagrant: get rid of the "64" suffix for VM names.
We only have 64bit machines anyway. And even in the unlikely
case we would add 32bit machines, we could suffix them by "32".
2024-07-19 14:14:22 +02:00
Thomas Waldmann
273aaaf572
vagrant: use freebsd(13|14)_64 as VM name 2024-07-19 14:13:13 +02:00
Thomas Waldmann
3f5cb32328
add freebsd 13 box, fixes #8266
users of TrueNAS do not have fbsd 14 yet.
2024-07-19 14:11:57 +02:00
TW
0f83d0c51f
Merge pull request #8287 from ThomasWaldmann/update-changes-master
Update changes
2024-07-19 00:02:00 +02:00
Thomas Waldmann
b1249ebe20
update CHANGES 2024-07-18 23:52:39 +02:00
Thomas Waldmann
4c76b67873
vagrant: use Python 3.11.9 2024-07-18 23:49:59 +02:00
Thomas Waldmann
70d1758e04
vagrant: use pyinstaller 6.7.0 2024-07-18 23:48:19 +02:00
TW
66b62c6fc9
Merge pull request #7846 from ThomasWaldmann/files-cache-with-size
files cache with size
2024-07-18 23:33:10 +02:00
Thomas Waldmann
619a06a5ba
BORG_CACHE_IMPL defaults to "adhocwithfiles" now
Also: support a "cli" env var value, that does not determine
the implementation from the env var, but rather from cli options (similar to as it was before adding BORG_CACHE_IMPL).
2024-07-18 22:51:17 +02:00
Thomas Waldmann
5a500cddf8
rename NewCache -> AdHocWithFilesCache 2024-07-18 22:14:00 +02:00
TW
55bf40db3b
Merge pull request #8285 from borgbackup/dependabot/pip/requirements.d/setuptools-70.0.0
build(deps-dev): bump setuptools from 69.2.0 to 70.0.0 in /requirements.d
2024-07-16 02:11:23 +02:00
dependabot[bot]
0fccd0bc0a
build(deps-dev): bump setuptools in /requirements.d
Bumps [setuptools](https://github.com/pypa/setuptools) from 69.2.0 to 70.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v69.2.0...v70.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 19:27:15 +00:00
Thomas Waldmann
78954b6487
skip tests not working with specific cache implementations 2024-07-15 12:45:17 +02:00
Thomas Waldmann
616af8daa8
BORG_CACHE_IMPL environment variable added
BORG_CACHE_IMPL allows users to choose the client-side cache implementation from 'local', 'newcache' and 'adhoc'.
2024-07-15 12:45:16 +02:00
Thomas Waldmann
72be8eff15
add comments to test_unknown_feature_on_cache_sync 2024-07-15 12:45:15 +02:00
Thomas Waldmann
c7249583e7
fix test_cache_chunks
- skip test_cache_chunks if there is no persistent chunks cache file
- init self.chunks for AdHocCache
- remove warning output from AdHocCache.__init__, it gets mixed with JSON output and fails the JSON decoder.
2024-07-15 12:45:13 +02:00
Thomas Waldmann
561dcc8abf
Refactor cache sync options and introduce new cache preference
Add new borg create option '--prefer-adhoc-cache' to prefer the
AdHocCache over the NewCache implementation.

Adjust a test to match the previous default behaviour (== use the
AdHocCache) with --no-cache-sync.
2024-07-15 12:45:12 +02:00
Thomas Waldmann
85688e7543
keep timestamp only in security dir
removed some code borg had for backwards compatibility with
old borg versions (that had timestamp only in the cache).

now the manifest timestamp is only checked against the manifest-timestamp
file in the security dir, simplifying the code.
2024-07-15 12:45:09 +02:00
Thomas Waldmann
89d867ea30
keep key_type only in security dir
removed some code borg had for backwards compatibility with
old borg versions (that had key_type only in the cache).

now the repo key_type is only checked against the key-type
file in the security dir, simplifying the code.
2024-07-15 12:45:08 +02:00
Thomas Waldmann
cf8c3a3ae7
keep previous repo location only in security dir
removed some code borg had for backwards compatibility with
old borg versions (that had previous_location only in the
cache).

now the repo location is only checked against the location
file in the security dir, simplifying the code and also
fixing a related test failure with NewCache.

also improved test_repository_move to test for aborting in
case the repo location changed unexpectedly.
2024-07-15 12:45:06 +02:00
Thomas Waldmann
fbfa7cf7bf
fix test_recreate_rechunkify
We can not use unique_chunks counter with NewCache,
thus we use a simpler (and weaker) assertion.
2024-07-15 12:45:05 +02:00
Thomas Waldmann
e3a0c4f375
fix check_cache and test_check_cache
NewCache and AdHocCache do not have a persistent chunks index,
so both check_cache and test_check_cache are pointless.
2024-07-15 12:45:03 +02:00
Thomas Waldmann
ab6049e269
fix test_list_chunk_counts
NewCache does not do precise refcounting, thus it does not know about
unique chunks.

For now, let's just test num_chunks, but not unique_chunks.
2024-07-15 12:45:01 +02:00
Thomas Waldmann
c73f6d4ff3
fix test_delete
NewCache does not do precise refcounting, thus chunks won't be deleted
from the repo at "borg delete" time.

"borg check --repair" would remove such chunks IF they are orphans.
2024-07-15 12:45:00 +02:00
Thomas Waldmann
86adc04da4
fix test_debug_refcount_obj for misc. refcounts 2024-07-15 12:44:59 +02:00
Thomas Waldmann
5136fa8fe3
fix test part that only works with LocalCache 2024-07-15 12:44:57 +02:00
Thomas Waldmann
25a7a1443a
skip tests requiring the chunks index (archive)
Only LocalCache implements these.
2024-07-15 12:44:55 +02:00
Thomas Waldmann
4cd9bc8a6b
check: do not consider orphan chunks a problem
if we use AdHocCache or NewCache, we do not have precise refcounting.
thus, we do not delete repo objects as their refcount does not go to zero.

check --repair will just remove the orphans.
2024-07-15 12:44:53 +02:00
Thomas Waldmann
e2a1999c59
implement NewCache
Also:
- move common code to ChunksMixin
- always use ._txn_active (not .txn_active)

Some tests are still failing.
2024-07-15 12:44:52 +02:00
Thomas Waldmann
cb8d6f8e4a
AdHocCache has no cache persistence
thus:

- no cache.path
- skip on-disk cache corruption tests for AdHocCache
2024-07-15 12:44:50 +02:00
Thomas Waldmann
876c08f654
tolerate missing chunks with delete --force
if a chunk is missing in repo, it will also be missing in a ad-hoc
built chunks index.
2024-07-15 12:44:49 +02:00
Thomas Waldmann
d466005682
refactor files cache code into FilesCacheMixin class 2024-07-15 12:44:47 +02:00
Thomas Waldmann
98162fbb42
create --no-cache-sync-forced option
when given, force using the AdHocCache.
2024-07-15 12:44:44 +02:00
Thomas Waldmann
de342581d6
fix AdHocCache.add_chunk signature (ctype, clevel kwargs) 2024-07-15 12:44:43 +02:00
Thomas Waldmann
17fce18b44
always give id and size to chunk_incref/chunk_decref
incref: returns (id, size), so it needs the size if it can't
get it from the chunks index. also needed for updating stats.

decref: caller does not always have the chunk size (e.g. for
metadata chunks),
as we consider 0 to be an invalid size, we call with size == 1
in that case. thus, stats might be slightly off.
2024-07-15 12:44:41 +02:00
Thomas Waldmann
4488c077a7
files cache: add chunk size information
the files cache used to have only the chunk ids,
so it had to rely on the chunks index having the
size information - which is problematic with e.g.
the AdhocCache (has size==0 for all not new chunks) and blocked using the files cache there.
2024-07-15 12:44:34 +02:00
TW
dc25205287
Merge pull request #8284 from ThomasWaldmann/fix-8256
fix error handling (master)
2024-07-15 12:43:24 +02:00
Thomas Waldmann
126a346296
delete: fix error handling with Ctrl-C 2024-07-15 00:49:39 +02:00
Thomas Waldmann
0ae65a08c4
rcompress: fix error handling with Ctrl-C 2024-07-15 00:48:22 +02:00
Thomas Waldmann
10b38789d6
delete: fix error handling when no archive is specified, fixes #8256 2024-07-15 00:38:24 +02:00
TW
246727f12d
Merge pull request #8281 from Aztorius/no-cache-option
Add BORG_USE_CHUNKS_ARCHIVE env var, fixes #8280
2024-07-13 22:34:20 +02:00
William Bonnaventure
de5d130dda Update docs for BORG_USE_CHUNKS_ARCHIVE 2024-07-13 21:26:18 +02:00
William Bonnaventure
fb7a8f2d85 Add BORG_USE_CHUNKS_ARCHIVE option 2024-07-13 21:26:13 +02:00
TW
f5c9e2509f
Merge pull request #8276 from ThomasWaldmann/ci-windows-fix-master
github CI: windows msys2 build: broken, disable it for now, see #8264
2024-07-07 15:40:47 +02:00
Thomas Waldmann
1e38525853
github CI: windows msys2 build: broken, disable it for now, see #8264 2024-07-07 14:36:54 +02:00
TW
24afee29c2
Merge pull request #8272 from wzyboy/fix/typo
docs: fix typo
2024-07-06 20:37:56 +02:00
William Bonnaventure
c3fb27f463
Automatic rebuild cache on exception, fixes #5213 (#8257)
Try to rebuild cache if an exception is raised, fixes #5213

For now, we catch FileNotFoundError and FileIntegrityError.

Write cache config without manifest to prevent override of manifest_id.
This is needed in order to have an empty manifest_id.
This empty id triggers the re-syncing of the chunks cache by calling sync() inside LocalCache.__init__()

Adapt and extend test_cache_chunks to new behaviour:

- a cache wipe is expected now.
- borg detects the corrupt cache and wipes/rebuilds the cache.
- check if the in-memory and on-disk cache is as expected (a rebuilt chunks cache).
2024-07-06 18:05:01 +02:00
Zhuoyun Wei
7c2fdf2d1d
docs: fix typo 2024-07-05 10:46:39 -07:00
TW
aada9859ff
Merge pull request #8248 from dertuxmalwieder/patch-1
Fixed openSUSE dependencies in installation.rst
2024-06-07 17:37:40 +02:00
Cthulhux
a0f23f97e1
Update installation.rst
Moved..
2024-06-07 03:40:17 +02:00
Cthulhux
de21d79e3d
Fixed openSUSE dependencies in installation.rst
Tested with today's Tumbleweed
2024-06-06 22:32:41 +02:00
TW
1f7cc48320
Merge pull request #8244 from tree-wall/patch-1
Installation: update Arch Linux repo name
2024-06-03 12:19:15 +02:00
tree-wall
7bc6f90dd3
Installation: update Arch Linux repo name
The "community" repository was merged into the "extra" repo last year.

https://archlinux.org/news/git-migration-completed/
2024-06-02 19:21:48 +01:00
TW
f7c18cd2c8
Merge pull request #8240 from ThomasWaldmann/fix-pytest-master
fix pytest_report_header, fixes #8232
2024-05-31 16:40:20 +02:00
Thomas Waldmann
00962f9d5d
fix pytest_report_header, fixes #8232 2024-05-31 14:30:19 +02:00
TW
819e294c3f
Merge pull request #8237 from ThomasWaldmann/remove-experimental-master
recreate: remove experimental status
2024-05-29 17:22:08 +02:00
Thomas Waldmann
9fbc4bc4e7
recreate: remove experimental status
We have this since quite a while and there were no major complaints.
2024-05-29 16:42:58 +02:00
TW
e3f565623d
Merge pull request #8228 from ThomasWaldmann/allow-msgpack110-master
allow msgpack 1.1.0
2024-05-20 22:43:22 +02:00
Thomas Waldmann
d43892d474
allow msgpack 1.1.0
tests with 1.1.0rc1 were successful, thus I assume 1.1.0 will also work ok.
2024-05-20 19:56:38 +02:00
TW
1525c72549
Merge pull request #8215 from ThomasWaldmann/fix-cythonize-import-error-reporting-master
setup.py: fix import error reporting for cythonize import, see #8208 (master)
2024-05-12 18:40:52 +02:00
Thomas Waldmann
ce2a824ec9
cosmetic: blacken setup.py 2024-05-12 16:13:31 +02:00
Thomas Waldmann
8a73344352
setup.py: detect noexec build fs issue, see #8208
That "failed to map segment from shared object" error msg is not
very helpful. Add a hint that the filesystem needs to be +exec
(== not noexec mounted, like it might be the case for /tmp on
some systems).
2024-05-12 16:13:28 +02:00
Thomas Waldmann
b067f0fba2
setup.py: fix import error reporting for cythonize import, see #8208
Looks like borg's setup.py has hidden the real cause of a cythonize ImportError.

There are basically 2 cases:
- either there is no Cython installed, then the import fails because the module can not be found, or
- there is some issue within Cython and the import fails due to that.

It's important not to hide the real cause, especially if we run into case 2.

case 1 is kind of expected and frequent, case 2 is rare.
2024-05-12 16:13:26 +02:00
TW
5e36ba789a
Merge pull request #8214 from ThomasWaldmann/fix-ci-macos-openssl-master
github CI: fix PKG_CONFIG_PATH for openssl 3.0
2024-05-12 16:12:19 +02:00
Thomas Waldmann
7baf8beed6
github CI: fix PKG_CONFIG_PATH for openssl 3.0 2024-05-12 15:25:27 +02:00
Vladimir Malinovskii
0c1df415d7
changed insufficiently reserved length for log message (#8152)
changed log message reserved length
2024-04-06 20:24:10 +02:00
TW
411c763fb8
Merge pull request #8182 from ThomasWaldmann/fix-test-ht-master
format_timedelta: use 3 decimal digits (ms)
2024-04-04 13:31:58 +02:00
Thomas Waldmann
54a85bf56d
format_timedelta: use 3 decimal digits (ms)
maybe this fixes the frequently failing test.
also, giving ms makes more sense than 10ms granularity.
2024-04-04 12:45:28 +02:00
TW
4d2eb0cb1b
Merge pull request #8181 from ThomasWaldmann/github-actions-update-master
update github actions
2024-04-03 19:33:35 +02:00
Thomas Waldmann
d893b899fc
update github actions
(avoid deprecation warnings)
2024-04-03 18:26:35 +02:00
TW
fb4b4cfeb8
Merge pull request #8180 from ThomasWaldmann/update-requirements-master
update development.lock.txt
2024-04-03 17:52:24 +02:00
Thomas Waldmann
bb50246bc4
update development.lock.txt 2024-04-03 17:13:18 +02:00
TW
c5abfe1ee9
Merge pull request #8178 from ThomasWaldmann/acl-error-handling-master
improve acl_get / acl_set error handling (master)
2024-04-03 17:02:14 +02:00
Thomas Waldmann
4e5bf28473
Linux: refactor acl_get 2024-04-02 01:38:31 +02:00
Thomas Waldmann
64b7b5fdd4
FreeBSD: check first if kind of ACL can be set on a file 2024-04-02 01:38:30 +02:00
Thomas Waldmann
4ebb5cdf3c
FreeBSD: simplify numeric_ids check 2024-04-02 01:38:28 +02:00
Thomas Waldmann
7df170c946
FreeBSD: added tests, only get default ACL from dirs 2024-04-02 01:38:27 +02:00
Thomas Waldmann
d3694271eb
FreeBSD: acl_get: raise OSError if lpathconf fails
Previously:
- acl_get just returned for lpathconf returning EINVAL
- acl_get silently ignored all other lpathconf errors and
  implied it is not a NFS4 acl

Now:
- not sure why the EINVAL silent return was done, but it seems
  wrong. guess it could be the system not implementing a check
  for nfs4. but in that case guess we still would like to get
  the default and access ACL!? Thus, I removed the silent return.
- raise OSError for all lpathconf errors

Cosmetic: add a nfs4_acl boolean, so the code reads better.
2024-04-02 01:38:26 +02:00
Thomas Waldmann
30f4518058
FreeBSD: acl_get: add an acl_extended_* call
... to implement same semantics as on linux (only store ACL
if it defines permissions other than those defined by the
traditional file permissions).

Looks like there is no call working with an fd on FreeBSD.
2024-04-02 01:38:24 +02:00
Thomas Waldmann
4cc4516c59
Linux: acl_set bug fix: always fsencode path
We use path when raising OSErrors, even if we have an fd.
2024-04-02 01:38:23 +02:00
Thomas Waldmann
96cac5f381
Linux: acl_get: use "nofollow" variant of acl_extended_file call
This is NOT a bug fix, because the previous code contained a
check for symlinks before that line - because symlinks can not
have ACLs under Linux.

Now, this "is it a symlink" check is removed to simplify the
code and the "nofollow" variant of acl_extended_file* is used
to look at the symlink fs object (in the symlink case).

It then should tell us that this does NOT have an extended ACL
(because symlinks can't have ACLs) and so we return there.

Overall the code gets simpler and looks less suspect.
2024-04-02 01:38:21 +02:00
Thomas Waldmann
beac2fa9ae
Linux: acl_get: raise OSError for errors in acl_extended_* call
Previously, these conditions were handled the same (just return):
- no extended acl here
- some error happened (e.g. ACLs unsupported, bad file descriptor, file not found, permission error, ...)

Now there will be OSErrors for the error cases.
2024-04-02 01:38:20 +02:00
Thomas Waldmann
1269c852bf
create/extract: ignore OSError if ACLs are not supported (ENOTSUP)
but do not silence other OSErrors.
2024-04-02 01:38:18 +02:00
Thomas Waldmann
bafea3b5de
platform tests: misc. minor cleanups
- remove unused global / import
- use is_linux and is_darwin
- rename darwin acl test method
2024-04-02 01:38:17 +02:00
Thomas Waldmann
d5396feebd
improve are_acls_working function
- ACLs are not working, if ENOTSUP ("Operation not supported") happens
- fix check for macOS
  On macOS borg uses "acl_extended", not "acl_access" and
  also the ACL text format is a bit different.
2024-04-02 01:38:15 +02:00
Thomas Waldmann
b3554cdc0f
raise OSError if acl_to_text / acl_from_text returns NULL
Also did a small structural refactors there.
2024-04-02 01:38:14 +02:00
Thomas Waldmann
a75945ed0d
improve acl_get / acl_set error handling, see #4049 2024-04-02 01:38:12 +02:00
TW
7f15c14fc6
Merge pull request #8176 from ThomasWaldmann/vagrant-updates-master
Vagrant updates (master)
2024-04-01 22:17:26 +02:00
TW
7dd0403bd3
Merge pull request #8177 from ThomasWaldmann/debounce-sigint-master
fix Ctrl-C / SIGINT behaviour for pyinstaller-made binaries, fixes #8155 (master)
2024-04-01 22:17:10 +02:00
Thomas Waldmann
c157db739b
fix Ctrl-C / SIGINT behaviour for pyinstaller-made binaries, fixes #8155 2024-04-01 20:41:47 +02:00
Thomas Waldmann
f28084d773
vagrant: ubuntu lunar -> noble VM
Noble should become stable / LTS soon.
2024-04-01 20:36:06 +02:00
Thomas Waldmann
b25caafc94
vagrant: remove buster VM
It's already outdated now and its libxxhash
does not support pkg-config discovery.
2024-04-01 20:32:24 +02:00
Thomas Waldmann
ffc1e3ef6f
vagrant: use pyinstaller 6.5.0 2024-04-01 20:28:56 +02:00
Thomas Waldmann
7ac7c79563
use python 3.11.8 for binary builds 2024-04-01 20:26:17 +02:00
Thomas Waldmann
4ff0ba48f8
vagrant: openindiana updates 2024-04-01 20:22:30 +02:00
TW
6de9ca87cf
Merge pull request #8149 from ThomasWaldmann/gh-actions-update-master
github CI: misc updates (master)
2024-03-15 19:06:09 +01:00
Thomas Waldmann
670cb6eb3f
github CI: misc updates
- macOS: run on macos-14 (on Apple Silicon!)
- macOS: use OpenSSL 3.0 from brew
- macOS: run with Python 3.11
- pip install -e .: add -v
- use up-to-date github actions
- remove libb2 references - since borg 1.2, we use blake2 indirectly via python stdlib
2024-03-15 18:19:15 +01:00
TW
b82bf4a232
Merge pull request #8136 from ThomasWaldmann/msgpack-cython-updates-master
msgpack and cython updates (master)
2024-03-02 15:15:41 +01:00
Thomas Waldmann
03e964271e
require Cython 3.0.3 at least, fixes #8133
The fix for the Python 3.12 memory leak issue was
in Cython 3.0.3+.
2024-03-02 14:28:36 +01:00
Thomas Waldmann
a507a2cb3b
allow msgpack 1.0.8, fixes #8133 2024-03-02 14:27:07 +01:00
TW
c9c5b4db85
Merge pull request #8128 from ThomasWaldmann/ebusy-master
create: deal with EBUSY, fixes #8123
2024-02-25 13:25:45 +01:00
Thomas Waldmann
eb79b1f13f
create: deal with EBUSY, fixes #8123
I put it into same class as EPERM and EACCES:
BackupPermissionError: borg is not permitted to access the file.
2024-02-25 12:17:09 +01:00
TW
db75521b79
Merge pull request #8129 from ThomasWaldmann/docs-fix-markup
docs: remove tabs
2024-02-25 12:16:28 +01:00
Thomas Waldmann
6121d3d2e6
docs: remove tabs 2024-02-25 12:14:52 +01:00
TW
e40690f6d7
Merge pull request #8124 from stephan13360/master
add non-root deployment strategy
2024-02-25 00:27:22 +01:00
Stephan Herbers
274cd8f121 add restore considerations paragraph 2024-02-24 21:17:22 +01:00
Stephan Herbers
96ae9f73eb Apply suggestions from code review
Co-authored-by: NetSysFire <59517351+NetSysFire@users.noreply.github.com>
2024-02-24 21:17:09 +01:00
Stephan Herbers
a06c42cf1f add non-root deployment strategy 2024-02-24 21:17:01 +01:00
TW
7074c0220b
Merge pull request #8119 from ThomasWaldmann/benchmark-crud-options-master
benchmark: inherit options --rsh --remote-path, fixes #8099
2024-02-22 23:29:33 +01:00
Thomas Waldmann
da285b15d2
benchmark: inherit options --rsh --remote-path, fixes #8099 2024-02-22 21:48:13 +01:00
TW
6be1035d8b
Merge pull request #8115 from ThomasWaldmann/new-rc-fixes-master
return value fixes (master)
2024-02-21 23:39:43 +01:00
Thomas Waldmann
a13b5d1b79
benchmark: fix return value, fixes #8113 2024-02-21 13:20:55 +01:00
TW
334bfcda04
Merge pull request #8111 from ThomasWaldmann/rel200b8
release 2.0.0b8
2024-02-21 01:58:01 +01:00
Thomas Waldmann
b04dcf4cbd
libacl: work with older versions, too
this was recently set to a relatively high minimum version when
locating it via pkgconfig was added. this broke the binary builds
on buster and bullseye.

i don't think borg requires a specific libacl version as long as
the api is compatible, so i now set this to 2.2.47 (from 2008).
2024-02-20 21:40:43 +01:00
Thomas Waldmann
b69c937cb7
build_man 2024-02-20 17:12:43 +01:00
Thomas Waldmann
3160f5063a
build_usage 2024-02-20 17:11:43 +01:00
Thomas Waldmann
0612001aa3
update release date in changes.rst 2024-02-20 17:06:53 +01:00
Thomas Waldmann
86c8031dc5
fix comment in setup.py 2024-02-20 17:04:16 +01:00
TW
643d2d2d05
Merge pull request #8109 from ThomasWaldmann/update-changes-master
update CHANGES
2024-02-20 16:59:30 +01:00
Thomas Waldmann
9524c20b47
update CHANGES 2024-02-20 16:29:14 +01:00
TW
514cef5a63
Merge pull request #8107 from ThomasWaldmann/slashdot-hack-master
slashdot hack (master)
2024-02-20 12:56:40 +01:00
Thomas Waldmann
e7bd18d7f3
create: add the slashdot hack, fixes #4685 2024-02-20 04:08:09 +01:00
TW
f94cdee94a
Merge pull request #8106 from ThomasWaldmann/more-errors-msgids-master
more specific errors / msgids (master)
2024-02-20 03:23:22 +01:00
Thomas Waldmann
43a20b052e
add ConnectionBrokenWithHint for BrokenPipeErrors and similar, see #7016
no traceback, but error message and specific exit code.
2024-02-20 00:17:55 +01:00
Thomas Waldmann
45815554ce
check_can_create_repository: deal with PermissionErrors, see #7016
borg init calls this. If there is a PermissionError, it is
usually fs permission issue at path or its parent directory.

Don't give a traceback, but rather an error msg and a specific exit code.
2024-02-20 00:07:43 +01:00
TW
7bed7b86d4
Merge pull request #8105 from ThomasWaldmann/corrupted-key-errmsg-master
better error msg for corrupted key data, fixes #8016
2024-02-19 23:30:38 +01:00
Thomas Waldmann
83c069ce5a
better error msg for corrupted key data, fixes #8016 2024-02-19 19:23:48 +01:00
TW
2d31b027c7
Merge pull request #8104 from ThomasWaldmann/error-msg-bad-nonce-file2-master
refactor: use less binascii
2024-02-19 03:02:02 +01:00
Thomas Waldmann
334fbab897
refactor: use less binascii
our own hex_to_bin / bin_to_hex is more comfortable to use.

also: optimize remaining binascii usage / imports.
2024-02-19 02:16:19 +01:00
TW
3bfd7652cd
Merge pull request #8102 from ThomasWaldmann/error-msg-bad-nonce-file-master
give clean error msg for invalid nonce file, see #7967
2024-02-18 15:21:52 +01:00
Thomas Waldmann
ab0b111af0
give clean error msg for invalid nonce file, see #7967
this is a fwd port from 1.4-maint. as we don't have nonce files
any more in master, only the generally useful stuff has been ported.

- add Error / ErrorWithTraceback exception classes to RPC layer.
- add hex_to_bin helper
2024-02-18 14:47:52 +01:00
TW
b65888f057
Merge pull request #8101 from ThomasWaldmann/fix-commanderror-args-master
fix CommandError args, fixes 8029
2024-02-18 14:33:35 +01:00
Thomas Waldmann
930ecd845a
fix CommandError args, fixes 8029
this is a fwd port from 1.4-maint and most of it was
already done in master, so only a minor change in here.
2024-02-18 14:18:33 +01:00
TW
74129e539b
Merge pull request #8100 from ThomasWaldmann/fix-with-lock-exceptions-master
borg with-lock: catch exception, print error msg, fixes #8022
2024-02-18 14:07:37 +01:00
kmille
1f5cc355a3
borg with-lock: catch exception, print error msg, fixes #8022 2024-02-18 13:36:10 +01:00
TW
ad3f1365f5
Merge pull request #8098 from ThomasWaldmann/new-rc-master
optional more specific return codes (master)
2024-02-18 13:18:36 +01:00
Thomas Waldmann
ed28eb9e03
fix: Error/CommandError have a output format for 1 argument 2024-02-18 04:40:32 +01:00
Thomas Waldmann
d7e2e2cea9
fix mypy error 2024-02-17 23:01:46 +01:00
Thomas Waldmann
a0a07ab464
use get_reset_ec to internally re-init ec/warnings
if we do multiple calls to Archiver.do_something(),
we need to reset the ec / warnings after each call,
otherwise they will keep growing (in severity, in length).
2024-02-17 22:37:44 +01:00
Thomas Waldmann
b53c86cf4c
refactor (re-)init of exit_code and warnings_list globals
stop directly accessing the variables from other modules.

prefix with underscore to indicate that these shall
only be used within this module and every other user
shall call the respective functions.
2024-02-17 22:29:18 +01:00
Thomas Waldmann
abe6545853
do not return the rc from Archiver methods
this is not needed and getting rid of it makes
the code / behaviour simpler to understand:

if a fatal error is detected, we throw an exception.

if we encounter something warning worthy, we emit and collect the warning.

in a few cases, we directly call set_ec to set the
exit code as needed, e.g. if passing it through
from a subprocess.

also:
- get rid of Archiver.exit_code
- assert that return value of archiver methods is None
- fix a print_warning call to use the correct formatting method
2024-02-17 22:07:47 +01:00
Thomas Waldmann
5caf747011
update frontends.rst error/warning list 2024-02-15 18:17:18 +01:00
Thomas Waldmann
2e05c234b6
BackupErrors get caught and give warning RCs
also: use more union operators rather than .union()
2024-02-15 18:15:10 +01:00
Thomas Waldmann
97dd287584
raise BackupOSError subclasses 2024-02-15 17:53:53 +01:00
Thomas Waldmann
9ac4672254
add NotFoundWarning 2024-02-15 17:04:21 +01:00
Thomas Waldmann
4adc782100
print_warning*: support warning msgids, fixes #7080 2024-02-14 02:22:35 +01:00
Thomas Waldmann
5168a97782
extend errorlist script to warnings, update docs 2024-02-14 02:04:44 +01:00
Thomas Waldmann
982aeb56a7
more detailled warnings for source file OSErrors 2024-02-14 02:00:19 +01:00
Thomas Waldmann
e8fa4986cc
BackupError->BackupWarning, BackupOSError->BackupOSWarning 2024-02-14 01:59:08 +01:00
Thomas Waldmann
900a1674df
move Backup*Error to errors module 2024-02-14 01:40:55 +01:00
Thomas Waldmann
c704e5ea9e
new warnings infrastructure to support modern exit codes
- implement updating exit code based on severity, including modern codes
- extend print_warning with kwargs wc (warning code) and wt (warning type)
- update a global warnings_list with warning_info elements
- create a class hierarchy below BorgWarning class similar to Error class
- diff: change harmless warnings about speed to rc == 0
- delete --force --force: change harmless warnings to rc == 0

Also:

- have BackupRaceConditionError as a more precise subclass of BackupError
2024-02-14 01:26:12 +01:00
Thomas Waldmann
b18e613627
get rid of some rare error classes, use RTError instead 2024-02-13 23:44:02 +01:00
Thomas Waldmann
0504dee0d9
fix dealing with remote repo Locking Exceptions
previously, this was handled in RPCError handler and always resulted in rc 2.

now re-raise Lock Exceptions locally, so it gives rc 2 (legacy) or 7x (modern).
2024-02-13 23:33:30 +01:00
Thomas Waldmann
cb8b718a96
refactor set_ec usage
- msgpack version check: raise Error instead of calling set_ec
2024-02-13 23:16:46 +01:00
Thomas Waldmann
bec02a36c8
use print_warning also in borg delete ::archive --force --force 2024-02-13 23:13:25 +01:00
Thomas Waldmann
9de07ebd46
update "modern" error RCs (docs and code) 2024-02-13 22:58:02 +01:00
Thomas Waldmann
34bbce8e71
scripts/errorlist.py: improve error list docs generation
- also output modern rc and traceback yes/no
- recursive list of Error subclasses
2024-02-13 19:56:32 +01:00
Thomas Waldmann
1b09d0efd7
BORG_EXIT_CODES=modern can be set to get more specific process exit codes
If not set, it will default to "legacy" (always return 2 for errors).

This commit only changes the Error exception class and its subclasses.

The more specific exit codes need to be defined via .exit_mcode in the subclasses.
2024-02-13 19:53:17 +01:00
TW
0e859a6d2d
Merge pull request #8096 from ThomasWaldmann/update-changes-master
update CHANGES
2024-02-13 19:30:19 +01:00
Thomas Waldmann
3a85433ffb
update CHANGES 2024-02-13 18:20:10 +01:00
TW
3b43770ca6
Merge pull request #8091 from ThomasWaldmann/fix-long-desc-master
sdist: dynamically compute readme (long_description)
2024-02-11 00:32:40 +01:00
Thomas Waldmann
dd9358f1e2
sdist: dynamically compute readme (long_description)
The long_desc_from_readme() was not called, it just read the
whole README.rst until "readme" was declared dynamic.
2024-02-10 18:06:49 +01:00
TW
77e13ad752
Merge pull request #8087 from ThomasWaldmann/less-setuppy-master
use less setup.py (master)
2024-02-10 00:16:39 +01:00
Thomas Waldmann
8eba627b29
scripts: make.py clean implementation 2024-02-09 17:37:46 +01:00
Thomas Waldmann
4d424de69e
scripts: update docs about make.py 2024-02-09 17:37:44 +01:00
Thomas Waldmann
59bca06630
scripts: rename gendocs.py to make.py 2024-02-09 17:37:43 +01:00
Thomas Waldmann
48afc4c519
requirements are defined in pyproject.toml 2024-02-09 17:37:42 +01:00
Thomas Waldmann
38ba1c383a
docs: do not refer to setup.py installation method
Invoking setup.py is deprecated.
2024-02-09 17:37:40 +01:00
Thomas Waldmann
b64f6e3335
scripts/gendocs.py: make it work
remove unused html_write function

gendocs: update developer docs
2024-02-09 17:37:38 +01:00
TW
8cfbd3ea3e
Merge pull request #8083 from ThomasWaldmann/increase-gh-actions-timeout-master
gh actions: increase timeout
2024-02-09 03:28:14 +01:00
Thomas Waldmann
b34a99f337
git mv setup_docs.py scripts/gendocs.py 2024-02-09 02:53:17 +01:00
Thomas Waldmann
9d913b0e82
setup.py: remove build_usage and build_man as setup.py command 2024-02-09 02:50:19 +01:00
Thomas Waldmann
7d77985601
setup.py: move long_desc_from_readme definition to here 2024-02-09 02:38:47 +01:00
TW
a4c8d52ca0
Merge pull request #8086 from ThomasWaldmann/index-check-value-errors-master
check: fix return code for index entry value discrepancies
2024-02-09 02:29:46 +01:00
TW
03e4494d84
Merge pull request #8084 from ThomasWaldmann/init-message-master
init: better borg key export instructions
2024-02-09 02:29:32 +01:00
TW
5ee1eeaa4f
Merge pull request #8082 from ThomasWaldmann/remote-version-master
implement "borg version", fixes #7829
2024-02-09 02:29:15 +01:00
TW
75840d4ef9
Merge pull request #8085 from ThomasWaldmann/docs-tests-pypi-pkg-master
docs: how to run the testsuite using the dist package
2024-02-09 00:44:18 +01:00
Thomas Waldmann
f43c1f56e9
check: fix return code for index entry value discrepancies
Also: use ERROR loglevel for these (not WARNING).

A different amount of index entries was already logged as error
and led to "error_found = True" in repository.check.

Different values in the rebuilt index vs. the on-disk index were
only logged on warning level, but did not lead to error_found = True.

Guess there is no reason why these should not be errors and lead to
error_found = True, so this was fixed in this commit.

Minor related change: change report_error function args, so it can be
called like logger.error - including giving a format AND args.
2024-02-09 00:43:06 +01:00
Thomas Waldmann
33393946b5
docs: how to run the testsuite using the dist package 2024-02-09 00:36:58 +01:00
Thomas Waldmann
08bf0f741c
init: better borg key export instructions 2024-02-09 00:33:06 +01:00
Thomas Waldmann
8944129806
gh actions: increase timeout
especially the macos workers are sometimes extremely slow.
2024-02-09 00:22:16 +01:00
Thomas Waldmann
b6a23ee1bc
implement "borg version", fixes #7829
Additional new command "borg -r <REPO> version" which shows client and server version.
2024-02-09 00:16:29 +01:00
TW
ca7338f5b6
Merge pull request #8080 from ThomasWaldmann/update-changes-master
update CHANGES
2024-02-08 23:50:32 +01:00
Thomas Waldmann
25adac4fb4
update CHANGES 2024-02-08 23:28:22 +01:00
TW
c59b8fa079
Merge pull request #8046 from ThomasWaldmann/logging-msg-param-master
borg.logger: use same method params as python logging
2024-01-16 03:08:08 +01:00
Thomas Waldmann
ba2e8f2dec
borg.logger: use same method params as python logging 2024-01-15 21:40:27 +01:00
TW
2787da205c
Merge pull request #6052 from stephengroat/patch-1
Create and use Brewfile
2024-01-14 19:49:28 +01:00
Thomas Waldmann
08bb028bae
Brewfile: don't install osxfuse cask by default. 2024-01-14 17:49:21 +01:00
Thomas Waldmann
576ee3532c
docs: fix markup errors 2024-01-14 17:27:21 +01:00
Stephen
438f1ddef7
docs: add brew bundle instructions (macOS) 2024-01-14 17:14:42 +01:00
Stephen
5c5df6458a
github CI (macOS): use brew bundle install (uses Brewfile) 2024-01-14 15:30:08 +01:00
Stephen
b8e5df9410
Create Brewfile 2024-01-14 15:29:50 +01:00
TW
a2ef268724
Merge pull request #8038 from ThomasWaldmann/vagrant-updates-master
Vagrant updates (master)
2024-01-10 22:40:46 +01:00
TW
64fee10417
Merge pull request #8039 from ThomasWaldmann/fetch-binaries-master
add script for fetching borg binaries from VMs, fixes #7989
2024-01-10 22:40:29 +01:00
Thomas Waldmann
cb62981ae7
add script for fetching borg binaries from VMs, fixes #7989 2024-01-10 22:33:44 +01:00
Thomas Waldmann
a9ea8aa67d
vagrant: use openssl 3.0 on macOS 2024-01-10 22:29:11 +01:00
Thomas Waldmann
eec78802bf
vagrant: remove outdated comment 2024-01-10 22:26:31 +01:00
Thomas Waldmann
86d6fcfe0a
vagrant: use generic/openbsd7 box 2024-01-10 22:25:36 +01:00
Thomas Waldmann
5480906c06
vagrant: netbsd: test on py311 only
the netbsd vagrant machine tends to segfault, guess due to some kernel or virtualbox issue.

 thus, rather only do 1 tox run, so there is less output to review.
2024-01-10 22:24:47 +01:00
Thomas Waldmann
f5a6d61e56
vagrant: use python 3.9.4 for tests
same as in 1.4-maint branch
2024-01-10 22:21:49 +01:00
Thomas Waldmann
140e079496
vagrant: remove debian 9 "stretch" box
there are multiple issues with that box:
- debian 9 is out of support by debian, out of even lts support since 2022
- it has a OpenSSL 1.x natively (and our source based install also used 1.x) - that is also out of support and noone will care for it.

Also, borg2 will still take a while, so it would be
even more outdated at release time as it already
is now.
2024-01-10 22:19:57 +01:00
Thomas Waldmann
c96fe77d2e
vagrant: use freebsd 14, fixes #6871 2024-01-10 22:14:09 +01:00
Thomas Waldmann
a6f224f031
vagrant: use the latest python 3.11.7 for binary builds 2024-01-10 22:10:54 +01:00
ebabcock93
73a416830a
docs: add typical PR workflow to development docs, fixes #7495 (#7656) 2024-01-10 00:56:18 +01:00
TW
812eb352f6
Merge pull request #7955 from ThomasWaldmann/improve-session-key-gen-master
crypto: use a one-step kdf for session keys, fixes #7953
2024-01-04 18:42:22 +01:00
kmille
865de9fcee
improve docs for borg with-lock (#8024)
docs: add example for borg with-lock
2024-01-03 23:42:29 +01:00
TW
2803c7358b
Merge pull request #8021 from ThomasWaldmann/move-conftest.py-master
move conftest.py to src/borg/testsuite, see #6386
2024-01-02 21:54:41 +01:00
Thomas Waldmann
e1fbd7d42e
fix mypy complaints 2024-01-02 20:57:42 +01:00
TW
5379f1b9bd
Merge pull request #8020 from ThomasWaldmann/latest-pyinstaller-master
use pyinstaller 6.3.0
2024-01-02 20:50:22 +01:00
Thomas Waldmann
6720ab3aab
move conftest.py to src/borg/testsuite, see #6386
there, it will be packaged and installed, so
that when one runs the testsuite after installing
the pypi package, it will find the conftest.py.
2024-01-02 20:39:14 +01:00
Thomas Waldmann
723994a2f1
use pyinstaller 6.3.0 2024-01-02 20:33:34 +01:00
TW
f6d19a33d4
Merge pull request #8019 from ThomasWaldmann/drop-setup-requires-master
use pip and build
2024-01-02 20:29:01 +01:00
TW
ee02c54488
Merge pull request #8018 from ThomasWaldmann/use-cython3-master
use and require cython3
2024-01-02 20:09:27 +01:00
TW
9583540fa1
Merge pull request #8017 from ThomasWaldmann/do-not-accept-empty-paths-master
PATH: do not accept empty strings, fixes #4221
2024-01-02 20:02:43 +01:00
Thomas Waldmann
1a544845a2
use less setup.py, use pip and build
todo: clean clean2 build_usage build_man
2024-01-02 19:50:59 +01:00
Thomas Waldmann
66eb086c4a
fix msys build
forward port to get code in sync with 1.4-maint.

use "pip install -e ." before invoking pyinstaller, so we have
the _version.py built by setuptools_scm and also it compiled the
extension modules, so pyinstaller can pick them up.

msys2 hack:

https://stackoverflow.com/questions/76079590/error-plat-name-must-be-one-of-win32-win-amd64-win-arm32-win-arm6
2024-01-02 19:46:48 +01:00
Thomas Waldmann
5ca4703a47
use and require cython3 2024-01-02 19:30:14 +01:00
Thomas Waldmann
73284db53f
PATH: do not accept empty strings, fixes #4221 2024-01-02 19:17:55 +01:00
TW
1432f547fe
Merge pull request #7968 from strugee/patch-1
Fix typo
2023-12-17 18:46:35 +01:00
AJ Jordan
f3ae0467b5
Fix typo 2023-12-17 01:13:43 -05:00
Thomas Waldmann
74c34ba7c6
docs: update security docs about new one-step KDF 2023-12-02 20:35:16 +01:00
Thomas Waldmann
a4602c6f61
remove unused hkdf_hmac_sha512 and related tests 2023-12-02 20:35:14 +01:00
Thomas Waldmann
64ce6d5923
crypto: use a one-step kdf for session keys, fixes #7953
also:
- fixes, simplifies, speeds up _get_session_key
- convert sessionid memoryview to bytes before calling _get_cipher,
to avoid TypeError in (crypt_key + sessionid + domain) operation.
- add docstring and comments
2023-12-02 20:33:07 +01:00
TW
42f04e91a1
Merge pull request #7962 from ThomasWaldmann/update-changes-master
add 1.2.7 changes
2023-12-02 18:01:54 +01:00
Thomas Waldmann
0f074fa2b6
add 1.2.7 changes 2023-12-02 18:01:00 +01:00
TW
6a511fd68a
Merge pull request #7944 from Gelma/typos
Fix typos
2023-12-02 00:45:21 +01:00
Thomas Waldmann
fe17ce2bba
fix typos
Thanks go to:
Author: Andrea Gelmini <andrea.gelmini@gelma.net>
2023-12-01 21:58:26 +01:00
TW
443245a547
Merge pull request #7947 from ad8e/master
Remove period after command, for clarification. Port to master
2023-11-27 18:13:05 +01:00
TW
223d189ff7
Merge pull request #7951 from ThomasWaldmann/allow-platformdirs4-master
allow platformdirs 4, fixes #7950
2023-11-27 18:09:12 +01:00
Thomas Waldmann
b0f7b05f43
CI: also trigger if a .toml file changes
Usually this might be pyproject.toml.
2023-11-27 17:23:36 +01:00
Thomas Waldmann
0e7b87c1ba
allow platformdirs 4, fixes #7950 2023-11-27 17:12:50 +01:00
Kevin Yin
4f92f9462e
Port changes to master 2023-11-23 07:48:26 -08:00
TW
6a5feaffac
Merge pull request #7941 from ThomasWaldmann/lockroster-remove-fix-master
LockRoster.modify: no KeyError if element was already gone, fixes #7937
2023-11-18 20:32:17 +01:00
Thomas Waldmann
2d86b7e1ac
add type annotation for mypy 2023-11-18 18:31:43 +01:00
Thomas Waldmann
046f9fe392
LockRoster.modify: no KeyError if element was already gone, fixes #7937
The intention of LockRoster.modify(key, REMOVE) is to remove self.id.

Using set.discard will just ignore it if self.id is not present there anymore.

Previously, using set.remove triggered a KeyError that has been frequently
seen in tracebacks of teardowns involving Repository.__del__ and Repository.__exit__.

I added a REMOVE2 op to serve one caller that needs to get the KeyError if
self.id was not present.

Thanks to @herrmanntom for the workaround!
2023-11-18 17:39:30 +01:00
TW
7c20bb52d1
Merge pull request #7936 from zDEFz/patch-2
make SERIAL backup method compatible to borg2
2023-11-13 20:38:42 +01:00
zDEFz
c4decb4fff
make SERIAL backup method compatible to borg2 2023-11-13 20:23:52 +01:00
zDEFz
6bbd327dc2
Added backup by serial method documentation (#7932)
docs: create disk/partition sector backup by disk serial number
2023-11-13 13:45:19 +01:00
TW
8ebeb3ccc7
Merge pull request #7929 from sophie-h/wip/sohpie-h/docs-rebuild-refcounts
docs: Add "check.rebuild_refcounts" message
2023-11-10 00:01:14 +01:00
Sophie Herold
cdc6154200 docs: Add "check.rebuild_refcounts" message 2023-11-09 21:32:01 +01:00
TW
d4a54f26aa
Merge pull request #7925 from ThomasWaldmann/update-requirements-master
update requirements.d/development.lock.txt
2023-11-09 01:22:45 +01:00
TW
3de808b4e5
Merge pull request #7924 from ThomasWaldmann/fix-subcommand-env-master
create --*-from-command: run subcommands with a clean environment, fixes #7916
2023-11-09 00:43:57 +01:00
Thomas Waldmann
e1af3ca7d8
update requirements.d/development.lock.txt 2023-11-09 00:17:33 +01:00
Thomas Waldmann
f3ddaaf001
create --*-from-command: run subcommands with a clean environment, fixes #7916
When borg invokes a system command, it needs to prepare the environment
for that. This is especially important when using a pyinstaller-made
borg fat binary that works with a modified env var LD_LIBRARY_PATH -
system commands may crash with that.

borg already had calls to prepare_subprocess_env at some places (e.g.
when invoking ssh for the remote repo connection), but they were
missing for:

borg create --content-from-command ...
borg create --paths-from-command ...
2023-11-09 00:04:03 +01:00
TW
e78146f453
Merge pull request #7914 from ThomasWaldmann/docs-upgrade-chkpt-tam-master
CVE-2023-36811 upgrade docs: consider checkpoint archives, fixes #7802
2023-11-06 15:06:20 +01:00
Thomas Waldmann
62114466e4
CVE-2023-36811 upgrade docs: consider checkpoint archives, fixes #7802
The traceback seen there came from borg not showing a .checkpoint archive
that didn't have a valid TAM and thus the user not see it / fix it:

https://github.com/borgbackup/borg/issues/7802#issuecomment-1793860606
2023-11-06 14:34:15 +01:00
TW
e431b838f4
Merge pull request #7910 from ThomasWaldmann/fix-shadow-index-master
Fix shadow index (master)
2023-11-05 20:17:48 +01:00
TW
d9fde26243
Merge pull request #7907 from ThomasWaldmann/update-docs-master
Update docs (master)
2023-11-05 19:08:43 +01:00
TW
fba3e388aa
Merge pull request #7909 from ThomasWaldmann/sort-by-aliases-master
--sort-by: support "archive" as alias of "name", fixes #7873
2023-11-05 19:08:25 +01:00
TW
b246e306bd
Merge pull request #7908 from ThomasWaldmann/fix-inv-pattern-errorhandling-master
Fix arg parsing error handling (master)
2023-11-05 19:08:08 +01:00
Thomas Waldmann
57f3dd1dae
check --repair: recreate shadow index, see #6687
before this fix, borg check --repair just created an
empty shadow index, which can lead to incomplete
entries if entries are added later.

and such incomplete (but present) entries can lead to
compact_segments() resurrecting old PUTs by accidentally
dropping related DELs.
2023-11-05 18:45:22 +01:00
Thomas Waldmann
7892e4212b
check --repair: test if shadow index is recreated
still failing here, because it is not.
2023-11-05 18:41:31 +01:00
Thomas Waldmann
5d28992b51
shadow index: add more comments 2023-11-05 18:30:00 +01:00
Thomas Waldmann
3ba533ac50
shadow index updates: simplify and more comments
no functional change here.
2023-11-05 18:28:48 +01:00
Thomas Waldmann
6d9513f507
update shadow index when doing a double-put, fixes #5661
this fixes the test added in previous commit (avoids
that the PUT reappears after index rebuild).
2023-11-05 18:25:06 +01:00
Thomas Waldmann
3b1c0df7c8
test the shadowing-by-double-put behaviour, see #5661
the new test is currently failing due to a bug in the
repository code.
2023-11-05 18:22:57 +01:00
Thomas Waldmann
fa1e9df0d1
--sort-by: support "archive" as alias of "name", fixes #7873 2023-11-05 18:05:27 +01:00
Thomas Waldmann
77cf77ec38
fix rc and msg if arg parsing throws an exception, fixes #7885
get_args() exception handling before this fix only dealt with
subclasses of "Error", but we have to expect other exceptions
there, too.

In any case, if we have some fatal exception here, we must
terminate with rc 2.

ArgumentTypeError: emit a short error message - usually this is
a user error, invoking borg in a wrong way.

Other exceptions: full info and traceback.
2023-11-05 17:58:02 +01:00
Thomas Waldmann
f86a13c438
fix invalid pattern argument error msg 2023-11-05 17:54:07 +01:00
Thomas Waldmann
613fdcd6fa
copy 1.2.x changelog notes from 1.2-maint 2023-11-05 17:48:30 +01:00
Thomas Waldmann
8f7f836eff
copy 1.x upgrade notes from 1.2-maint 2023-11-05 17:46:14 +01:00
Thomas Waldmann
774c899b7e
update 1.x change log, cve notes
fixes #7816
fixes #7813
2023-11-05 17:43:24 +01:00
Thomas Waldmann
4325656f4c
docs: not only attack/unsafe, can also be a fs issue, fixes #7853 2023-11-05 17:36:31 +01:00
TW
1f48e500f2
Merge pull request #7906 from ThomasWaldmann/blacken-master
blacken master branch
2023-11-05 14:38:15 +01:00
Thomas Waldmann
c7f0d779bf
blacken master branch 2023-11-05 13:33:25 +01:00
TW
0da4fff38b
Merge pull request #7905 from FelixSchwarz/py313-unistdh
Python 3.13: include `unistd.h` in `_chunker.c`
2023-11-05 13:26:17 +01:00
Felix Schwarz
c350c1b36d include unistd.h in _chunker.c
With Python 3.13, Python.h no longer includes the <unistd.h> standard header file:
https://docs.python.org/3.13/whatsnew/3.13.html#id8
2023-11-05 11:48:16 +01:00
TW
d25cc1b0d1
Merge pull request #7884 from ThomasWaldmann/fix-transfer-zlib-legacy
zlib legacy decompress fixes (master)
2023-10-25 00:07:21 +02:00
Thomas Waldmann
f0e9999768
zlib legacy decompress: fix tests 2023-10-24 23:33:42 +02:00
Thomas Waldmann
0ac525bb05
zlib legacy decompress: call check_fix_size method
so we also have the decompressed size in the metadata.
2023-10-24 19:45:21 +02:00
Thomas Waldmann
0cfdf6da91
zlib legacy decompress: return meta dict, fixes #7883
for the other compression methods, this is done in
the base class, but the zlib legacy does not call
that method as it also removes the header bytes,
which zlib legacy does not have.
2023-10-24 19:37:24 +02:00
TW
e1c75e8542
Merge pull request #7875 from steelman/acl_pc
linux: use pkgconfig to find libacl
2023-10-24 17:08:14 +02:00
Łukasz Stelmach
c68a158ffb linux: use pkgconfig to find libacl
Using pkgconfig gives a more meaningful error message in case libacl
development files are missing.
2023-10-24 15:00:21 +02:00
TW
9108039786
Merge pull request #7865 from ThomasWaldmann/fix-xattr-mypy-master
mypy: ignore attr-defined for errno.ENOATTR/ENODATA
2023-10-10 21:36:21 +02:00
TW
8e9c44b353
Merge pull request #7863 from ThomasWaldmann/remove-bountysource-badge-master
remove bountysource badge (master)
2023-10-10 21:01:42 +02:00
Thomas Waldmann
b78f330024
mypy: ignore attr-defined for errno.ENOATTR/ENODATA 2023-10-10 20:50:25 +02:00
Thomas Waldmann
871da25865
remove bountysource badge 2023-10-10 20:31:21 +02:00
TW
75d8abc47b
Merge pull request #7862 from ThomasWaldmann/misc-updates-master
misc. updates (master)
2023-10-10 19:48:32 +02:00
Thomas Waldmann
f7e8462bd0
vagrant: use generic/debian9 box, fixes #7579
the debian/stretch64 was broken and never fixed.
2023-10-10 17:41:58 +02:00
Thomas Waldmann
3fdbd541db
update development.lock.txt
there was some breakage with py312, so better use current tooling.
2023-10-10 17:41:16 +02:00
Thomas Waldmann
82440a2a38
github CI: test on py312 (w/o -dev) 2023-10-10 17:38:39 +02:00
Thomas Waldmann
fc0dbe2913
vagrant: install py312 via pyenv 2023-10-10 17:37:34 +02:00
Thomas Waldmann
26be8a6fe9
allow setuptools_scm >= 8 again
8.0.4 got a fix, so we can allow it again.
2023-10-10 17:35:03 +02:00
TW
adfab2b6d7
Merge pull request #7859 from debuglevel/patch-1
feat(docs): use virtualenv on Cygwin
2023-10-10 14:12:01 +02:00
Marc Kohaupt
a6b016f894
feat(docs): use virtualenv on Cygwin
Hint for Cygwin users to make sure they use a virtual environment.
Not using a virtual environment will be likely troublesome if there is already a Python installed on Windows.
2023-10-09 12:35:33 +02:00
TW
d4ea88433c
Merge pull request #7855 from ytec-nl/master
Prevent CLI argument issues in scripts/glibc_check.py
2023-10-09 01:16:00 +02:00
Ceesjan Luiten
7afa8d4626 Prevent CLI argument issues 2023-10-07 19:58:41 +02:00
TW
8fc0944950
Merge pull request #7830 from ThomasWaldmann/typed-repoobjs
replace TAMs by typed repo objects, fixes #7670
2023-09-30 21:46:51 +02:00
TW
4a688ee4f4
Merge pull request #7851 from ThomasWaldmann/allow-msgpack107-master
allow msgpack 1.0.7 (master)
2023-09-28 15:36:40 +02:00
Thomas Waldmann
cdcab4df68
allow msgpack 1.0.7 2023-09-28 14:31:03 +02:00
TW
e4669ec316
Merge pull request #7843 from ThomasWaldmann/offline-docs-master
readthedocs: also build offline docs, fixes #7835
2023-09-25 15:23:36 +02:00
Thomas Waldmann
80b08aff35
readthedocs: also build offline docs, fixes #7835 2023-09-25 15:21:50 +02:00
Thomas Waldmann
bd1d734591
docs: removed TAMs, introduce typed repo objects 2023-09-24 20:11:00 +02:00
Thomas Waldmann
d1fde11645
tests: borg check must not add a spoofed archive to manifest
also: do a small optimisation in borg check:

if the type of the repo object is not ROBJ_ARCHIVE_META, we
can skip the object, it can not contain valid archive meta data.

if the type is correct, this is already a sufficient check, so
we can be quite sure that there will be valid archive metadata
in the object.
2023-09-24 20:10:58 +02:00
Thomas Waldmann
6b4697b479
tests: borg check notices/repairs a spoofed manifest 2023-09-24 20:10:57 +02:00
Thomas Waldmann
170380c657
raise IntegrityError if ro_type is not as expected 2023-09-24 20:10:56 +02:00
Thomas Waldmann
cb4676048a
remove remainders of TAM support 2023-09-24 20:10:54 +02:00
Thomas Waldmann
1cf62d8fc7
remove manifest TAMs 2023-09-24 20:10:53 +02:00
Thomas Waldmann
6a68ad5cd6
remove archive TAMs 2023-09-24 20:10:51 +02:00
Thomas Waldmann
1b6f928917
ro_type: typed repo objects, see #7670
writing: put type into repoobj metadata
reading: check wanted type against type we got

repoobj metadata is encrypted and authenticated.
repoobj data is encrypted and authenticated, also (separately).
encryption and decryption of both metadata and data get the
same "chunk ID" as AAD, so both are "bound" to that (same) ID.

a repo-side attacker can neither see cleartext metadata/data,
nor successfully tamper with it (AEAD decryption would fail).

also, a repo-side attacker could not replace a repoobj A with a
differently typed repoobj B without borg noticing:
- the metadata/data is cryptographically bound to its ID.
  authentication/decryption would fail on mismatch.
- the type check would fail.

thus, the problem (see CVEs in changelog) solved in borg 1 by the
manifest and archive TAMs is now already solved by the type check.
2023-09-24 20:10:50 +02:00
TW
506718e82f
Merge pull request #7837 from ThomasWaldmann/remove-recreate-recompress
Remove recreate --recompress option
2023-09-24 18:16:35 +02:00
Thomas Waldmann
0fcd3e9479
add_chunk: remove overwrite parameter 2023-09-23 00:10:35 +02:00
Thomas Waldmann
15c24cbe7e
recreate: remove --recompress option
For many use cases, the repo-wide "rcompress" is more efficient.

Also, recreate --recompress calls add_chunk with overwrite=True,
which is unsupported with the AdHocCache.
2023-09-23 00:01:39 +02:00
TW
a9e625d11f
Merge pull request #7834 from ThomasWaldmann/fix-unreadable-dir-cleanup-master
fix post-test permission issues
2023-09-21 00:34:04 +02:00
Thomas Waldmann
2195558eea
fix post-test permission issues 2023-09-20 22:45:57 +02:00
TW
84fc938e3c
Merge pull request #7832 from ThomasWaldmann/exclude-compiled-files
pyproject.toml: exclude source files which have been compiled, fixes #7828
2023-09-18 01:51:28 +02:00
Thomas Waldmann
4b1dac78f5
pyproject.toml: exclude source files which have been compiled, fixes #7828 2023-09-18 01:03:57 +02:00
TW
c686dc84ae
Merge pull request #7824 from ThomasWaldmann/rel200b7
release 2.0.0b7
2023-09-14 23:52:32 +02:00
Thomas Waldmann
a7067ebbaa
vagrant: upgrade source dependencies of stretch VM 2023-09-14 22:41:44 +02:00
Thomas Waldmann
75f8391bb6
vagrant: upgrade to pyinstaller 5.13.2 2023-09-14 19:26:01 +02:00
Thomas Waldmann
b2e8ad0257
vagrant: upgrade to python 3.11.5 2023-09-14 17:01:54 +02:00
Thomas Waldmann
3f75950226
build_usage / build_man 2023-09-14 15:52:08 +02:00
Thomas Waldmann
7e15b6488a
update CHANGES 2023-09-14 15:48:18 +02:00
TW
4e8cc050c2
Merge pull request #7823 from ThomasWaldmann/allow-msgpack-106-master
allow msgpack 1.0.6 (which has py312 wheels), fixes #7810
2023-09-14 15:34:52 +02:00
Thomas Waldmann
12e224613e
test_is_slow_msgpack: skip test on expected slow msgpack environments 2023-09-14 14:47:30 +02:00
Thomas Waldmann
95e75b90f1
allow msgpack 1.0.6 (which has py312 wheels), fixes #7810 2023-09-14 13:47:31 +02:00
TW
2943d1c11e
Merge pull request #7592 from ThomasWaldmann/py312
support / test on Python 3.12
2023-09-14 04:38:57 +02:00
Thomas Waldmann
bc9ce99e9b
allow msgpack 1.0.6(rc1) 2023-09-14 04:08:25 +02:00
Thomas Waldmann
1ed7f29572
avoid tarfile deprecation warning for py312 2023-09-14 03:04:36 +02:00
Thomas Waldmann
c4327c2819
add wheel to build-system requirements 2023-09-14 03:04:35 +02:00
Thomas Waldmann
1175fbcfd9
support / test on Python 3.12 2023-09-14 03:04:28 +02:00
TW
6bb24ded05
Merge pull request #7817 from bket/openssl-3.0
OpenBSD only: switch to OpenSSL-3.0
2023-09-12 17:36:30 +02:00
TW
9986bcc9c2
Merge pull request #7819 from ThomasWaldmann/remove-twine-master
remove twine from requirements
2023-09-12 17:02:13 +02:00
Thomas Waldmann
34b33d2706
remove twine from requirements
twine is only needed at release time, no need
for all developers or all test runs to install
this.

also, some requirement of twine needs a rust
compiler, so if there is no rust compiler,
automated runs will abort due to that.
2023-09-12 16:02:10 +02:00
Björn Ketelaars
83d4fca4d2 OpenBSD only: switch to OpenSSL-3.0 2023-09-11 21:43:35 +02:00
TW
a089448841
Merge pull request #7811 from ThomasWaldmann/update-locked-requirements-master
update requirements.d/development.lock.txt
2023-09-05 15:47:42 +02:00
Thomas Waldmann
2593ea0149
update requirements.d/development.lock.txt 2023-09-05 14:22:00 +02:00
TW
e40674ed3d
Merge pull request #7807 from ThomasWaldmann/update-changes-master
update CHANGES
2023-09-05 14:17:57 +02:00
Thomas Waldmann
c883181609
update CHANGES
also:: add a note about required TAMs.
2023-09-05 13:50:59 +02:00
TW
0ac750dcd5
Merge pull request #7809 from ThomasWaldmann/move-to-pyprojecttoml-master
Move to pyproject.toml
2023-09-05 13:47:27 +02:00
Thomas Waldmann
55f0798b15
fix src code formatting
not sure why this changed!?
2023-09-05 00:34:03 +02:00
Thomas Waldmann
61e96eb51f
pyproject.toml: move project metadata 2023-09-05 00:01:40 +02:00
Thomas Waldmann
a91b7d2787
pyproject.toml: move mypy options 2023-09-04 23:27:10 +02:00
Thomas Waldmann
34cadfdc4e
pyproject.toml: move pytest options 2023-09-04 23:16:20 +02:00
TW
5cce0d7504
Merge pull request #7808 from ThomasWaldmann/ruff-master
replace flake8 by ruff
2023-09-04 23:03:05 +02:00
Thomas Waldmann
98796a2f0d
replace flake8 by ruff 2023-09-04 22:15:42 +02:00
TW
1fd8b52f6b
Merge pull request #7650 from ThomasWaldmann/remove-force-tam-not-required
TAM: always generate and verify
2023-09-04 20:33:52 +02:00
Thomas Waldmann
a0f5264cbd
rlist: remove support for {tam} placeholder
archives are now always TAM-authenticated.
2023-09-03 22:27:24 +02:00
Thomas Waldmann
2d78fa89a5
always implicitly require archive TAMs
they must be there since the upgrade to borg 1.2.6 (or other
borg versions that also have a fix for CVE-2023-36811).
2023-09-03 22:02:35 +02:00
Thomas Waldmann
21d4407170
always implicitly require manifest TAMs
remove a lot of complexity from the code that was just there to
support legacy borg versions < 1.0.9 which did not TAM authenticate
the manifest.

since then, borg writes TAM authentication to the manifest,
even if the repo is unencrypted.
if the repo is unencrypted, it did not check the somehow pointless
authentication that was generated without any secret, but
if we add that fake TAM, we can also verify the fake TAM.

if somebody explicitly switches off all crypto, they can not
expect authentication.

for everybody else, borg now always generates the TAM and also
verifies it.
2023-09-03 22:01:46 +02:00
TW
4ded3620c5
Merge pull request #7805 from ThomasWaldmann/fwd-port-tam-cve-fixes-master
some fwd ports of the archive-TAM/CVE related code/docs
2023-09-03 20:49:50 +02:00
Thomas Waldmann
aaafc36d97
update upgrade instruction in changes_1.x.rst 2023-09-03 17:27:44 +02:00
Thomas Waldmann
1338646b9d
check: improve logging for TAM issues, fixes #7797 2023-09-03 17:15:09 +02:00
TW
270f33b7ed
Merge pull request #7800 from ThomasWaldmann/fix-zstd-docs
docs: remove zstd compat hint
2023-09-02 15:42:50 +02:00
Thomas Waldmann
32d7222e67
docs: remove zstd compat hint
borg2 repos are not compatible with borg1 anyway,
so no need to mention that.
2023-09-02 14:30:34 +02:00
TW
3eb070191d
Merge pull request #7789 from ThomasWaldmann/archive-tam-verify-master
Archive tam verify security fix (master)
2023-08-30 18:29:05 +02:00
Thomas Waldmann
f334ef1b4d
fix CVE timeline, fix markup 2023-08-30 15:58:12 +02:00
Thomas Waldmann
449cd51b73
document vulnerability, repo upgrade procedure 2023-08-30 02:32:50 +02:00
Thomas Waldmann
56da398711
add tests for archive TAMs 2023-08-30 02:28:57 +02:00
Thomas Waldmann
5cd2060345
rebuild_refcounts: keep archive ID, if possible
rebuild_refcounts verifies and recreates the TAM.
Now it re-uses the salt, so that the archive ID does not change
just because of a new salt if the archive has still the same data.
2023-08-30 01:13:52 +02:00
Thomas Waldmann
95b5604422
TAM msgs: be more specific: archives vs. manifest 2023-08-30 00:58:03 +02:00
Thomas Waldmann
b23e6cb73d
list: support {tam} placeholder. check archive TAM.
list: shows either "verified" or "none", depending on
whether a TAM auth tag could be verified or was
missing (old archives from borg < 1.0.9).

when loading an archive, we now try to verify the archive
TAM, but we do not require it. people might still have
old archives in their repos and we want to be able to
list such repos without fatal exceptions.
2023-08-30 00:58:02 +02:00
Thomas Waldmann
277b0b81a8
cache sync: check archive TAM 2023-08-30 00:58:00 +02:00
Thomas Waldmann
462c1bdf2e
check: rebuild_refcounts verify and recreate TAM
This part of the archive checker recreates the Archive
items (always, just in case some missing chunks needed
repairing).

When loading the Archive item, we now verify the TAM.
When saving the (potentially modified) Archive item,
we now (re-)generate the TAM.

Archives without a valid TAM are dropped rather than TAM-authenticated
when saving them. There shouldn't be any archives without a valid TAM:

- borg writes an archive TAM since long (1.0.9)
- users are expected to TAM-authenticate archives created
  by older borg when upgrading to borg 1.2.5.

Also:

Archive.set_meta: TAM-authenticate new archive

This is also used by Archive.rename and .recreate.
2023-08-30 00:57:33 +02:00
Thomas Waldmann
bfead4b288
fixup with msgpack data types related fixes 2023-08-29 22:32:30 +02:00
Thomas Waldmann
a2ee13fd34
check: rebuild_manifest must verify archive TAM 2023-08-29 21:10:32 +02:00
TW
6aa350aeb4
Merge pull request #7780 from ThomasWaldmann/update-changes-master
update CHANGES
2023-08-27 21:05:27 +02:00
Thomas Waldmann
760d01ee0c
update CHANGES 2023-08-27 20:41:40 +02:00
TW
b3be2d30b5
Merge pull request #7779 from ThomasWaldmann/cy302
lock cython to 3.0.2
2023-08-27 19:42:33 +02:00
Thomas Waldmann
b6712cd8b7
lock cython to 3.0.2 2023-08-27 17:05:48 +02:00
TW
981c562268
Merge pull request #7777 from ThomasWaldmann/freebsd-acl-tests-master
freebsd: add some ACL tests, fixes #7745
2023-08-27 13:46:51 +02:00
Thomas Waldmann
aa5168a21e
use skipif_acls_not_working decorator for freebsd also
use platform-specific ACLs to check.
for unsupported platform, just return False.
2023-08-27 05:07:56 +02:00
Thomas Waldmann
9c1088c95c
linux: move ACL definitions to platform_linux test module
they are only used from there.
2023-08-27 05:06:17 +02:00
Thomas Waldmann
7f8eba4fbf
freebsd: add some ACL tests, fixes #7745
enable ACL support in freebsd vagrant machine's filesystem
2023-08-27 05:05:55 +02:00
TW
678501a6ff
Merge pull request #7778 from ThomasWaldmann/get-dir-create-arg-master
get_*_dir: add/use create argument
2023-08-27 03:58:56 +02:00
Thomas Waldmann
836b517451
get_*_dir tests: use create=False
In these tests, we only compare paths, but we do not
need to create these paths for that. By not trying to
create them, we can avoid permission issues, e.g. under
fakeroot.
2023-08-27 03:23:50 +02:00
Thomas Waldmann
590b0c68e6
get_*_dir: add create=True kw argument
... and only call ensure_dir if create is True.
2023-08-27 03:15:12 +02:00
TW
d3062674d9
Merge pull request #7776 from ThomasWaldmann/pyi-5.13.1-master
vagrant: use pyinstaller 5.13.1
2023-08-26 18:52:00 +02:00
Thomas Waldmann
535a024008
vagrant: use pyinstaller 5.13.1 2023-08-26 18:51:09 +02:00
TW
8ed6ec5889
Merge pull request #7774 from ThomasWaldmann/ci-ubuntu2204-master
ci: run on ubuntu 22.04
2023-08-26 15:58:58 +02:00
Thomas Waldmann
057aec407d
ci: run on ubuntu 22.04 2023-08-26 15:11:17 +02:00
TW
b8e855164b
Merge pull request #7775 from ThomasWaldmann/docs-fixes-master
docs: fix borg delete examples, fixes #7759
2023-08-26 15:07:05 +02:00
TW
97388277e2
Merge pull request #7773 from ThomasWaldmann/cython3-master
use cython 3 (master)
2023-08-26 14:55:53 +02:00
Thomas Waldmann
e9e74a1113
docs: fix borg delete examples, fixes #7759 2023-08-26 14:51:27 +02:00
TW
928af177bb
Merge pull request #7771 from ThomasWaldmann/docs-work
docs related work
2023-08-26 14:36:15 +02:00
Thomas Waldmann
d80d2decc0
development.lock.txt: use Cython 3.0.1
note: pyproject.yaml already uses Cython3 because it is not
version restricted and the cy3 pypi package is not beta any more.
2023-08-26 14:11:52 +02:00
Thomas Waldmann
04ff8d6524
fix README 2023-08-26 13:55:59 +02:00
Thomas Waldmann
d2d6e6092b
CI: test building the docs 2023-08-26 13:44:51 +02:00
Thomas Waldmann
fc7cd92ee2
docs: tox -e docs tests building the docs 2023-08-26 13:36:10 +02:00
TW
e8e1a3a37c
Merge pull request #7770 from ThomasWaldmann/improve-rcreate-docs-master
docs: improve rcreate / related repos docs
2023-08-24 13:11:39 +02:00
Thomas Waldmann
b1c38ef23e
docs: improve rcreate / related repos docs 2023-08-24 12:42:24 +02:00
TW
1c8da8f98a
Merge pull request #7750 from ThomasWaldmann/fix-unreadable-parent-of-root-master
do not try to read parent dir of recursion root (master)
2023-07-30 01:18:27 +02:00
Ted Lawson
f29fd80311
platform_freebsd.py dummy test file (#7748) 2023-07-30 01:17:56 +02:00
Thomas Waldmann
08e09999d9
remove unused "flags_root" open flags 2023-07-29 23:34:52 +02:00
Thomas Waldmann
c99b849abe
create: do not try to read parent dir of recursion root, fixes #7746 2023-07-29 23:31:16 +02:00
Thomas Waldmann
3e640a38c0
add a test for unreadable parent dir, see #7746 2023-07-29 23:21:10 +02:00
TW
1e7dec1541
Merge pull request #7742 from bigtedde/remove-BaseTestCase
PR: Remove BaseTestCase from `testsuite/`
2023-07-29 22:14:33 +02:00
bigtedde
a09c8ad940 reverted import grouping 2023-07-29 09:40:24 -07:00
bigtedde
dc83735e1d Merge remote-tracking branch 'upstream/master' into remove-BaseTestCase 2023-07-28 12:31:24 -07:00
bigtedde
ffebd8b044 parametrize helper.py 2023-07-28 12:30:27 -07:00
TW
5df49ee707
Merge pull request #7743 from bigtedde/platform-pytest
PR: `testsuite/platform.py` conversion to pytest + remove `BaseTestCase`
2023-07-28 20:19:45 +02:00
bigtedde
8eed958829 seperated platform tests into seperate modules 2023-07-27 15:38:21 -07:00
bigtedde
be53037b9d linux tests converted, renamed tests for consistency 2023-07-27 11:45:58 -07:00
bigtedde
d2dd792164 mac and posix tests converted, removed BaseTestCase and unittest 2023-07-26 21:59:12 -07:00
bigtedde
7b753453e5 removed BaseTestCase from chunker_slow.py 2023-07-26 14:59:45 -07:00
bigtedde
67334c4e83 removed BaseTestCase from helpers.py 2023-07-26 14:50:52 -07:00
bigtedde
d2f32986f3 removed TestCaseBase from testsuite/archive.py 2023-07-26 12:18:25 -07:00
TW
f33efc0a10
Merge pull request #7740 from ThomasWaldmann/black-and-flake8
simplify flake8 config, fix some complaints
2023-07-26 02:17:58 +02:00
Thomas Waldmann
aa0d12a09c
fix E402 2023-07-26 01:24:36 +02:00
Thomas Waldmann
5013121bd8
fix E501 2023-07-26 01:24:20 +02:00
Thomas Waldmann
6151b369c4
fix E741 2023-07-26 01:24:00 +02:00
Thomas Waldmann
35ac39b751
fix F401 2023-07-26 01:23:37 +02:00
Thomas Waldmann
3017701958
simplify flake8 configuration
we use black since a while, so some stuff does not need to be ignored any more.
2023-07-25 23:56:31 +02:00
TW
c0001fb6ea
Merge pull request #7738 from ThomasWaldmann/fix-disk-full-test-master
fix test_disk_full, fixes #7617
2023-07-25 22:49:50 +02:00
Thomas Waldmann
b0497499cc
fix test_disk_full, fixes #7617
- master branch has different free space requirements from 1.2-maint,
  so we now use a 700MB filesystem
- used pytest.mark.parametrize for the test passes, kind of a progress
  display
- fix bug in rcreate call, encryption arg is needed
- fix bug in lock file cleanup
- added repo space cleanup
- updated docstring with current linux instructions (ubuntu)
- stopped using the "reserved" files, the "input" files are good enough
  to get some space freed.
-
2023-07-25 22:13:36 +02:00
TW
a592cf4d02
Merge pull request #7736 from ThomasWaldmann/tests-cleanup
remove unused methods of BaseTestCase
2023-07-25 15:54:17 +02:00
Thomas Waldmann
b97c3d3a55
simplify BaseTestCase.assert_raises 2023-07-25 15:14:46 +02:00
Thomas Waldmann
a2e7854911
simplify changedir with @contextmanager 2023-07-25 15:12:32 +02:00
Thomas Waldmann
02fcabe31f
remove unused methods of BaseTestCase
also: clean up imports / comments
2023-07-25 15:07:53 +02:00
TW
5babcf475c
Merge pull request #7735 from ThomasWaldmann/tests-with-env-var
tests: remove usage of environment_variable context manager, fixes #1002
2023-07-25 14:24:49 +02:00
Thomas Waldmann
b8a52a4769
tests: remove usage of environment_variable context manager
rather use monkeypatch.setenv/delenv.
2023-07-25 13:29:02 +02:00
Ted Lawson
2e59a702f6
cmd function now creates repo_location argument (#7734)
f'repo={repo_location}' moved to 'cmd' function
2023-07-24 23:54:47 +02:00
TW
e1cd38a0df
Merge pull request #7722 from bigtedde/archiver-tests
Archiver folder - all tests converted from unittest to pytest
2023-07-23 15:07:03 +02:00
bigtedde
6f35f5b0a4 simplified remote repo check 2023-07-22 23:39:10 -07:00
bigtedde
b8b80c5fef get_kind added to ArchiverSetup 2023-07-20 21:32:23 -07:00
bigtedde
683bf7275a redundent comments 2023-07-20 21:04:32 -07:00
TW
989b4fe88b
Merge pull request #7730 from ThomasWaldmann/authenticated_no_key-master
BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos without key, fixes #7700
2023-07-20 18:34:50 +02:00
Thomas Waldmann
d5ffa59c91
bugfix: skip TAM check with BORG_WORKAROUNDS=authenticated_no_key
This is an emergency workaround for authenticated repos
if the user has lost the borg key.

We can't compute the TAM key without the borg key, so just
skip all the TAM stuff.
2023-07-20 17:54:33 +02:00
Thomas Waldmann
3051473168
BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos without key, fixes #7700 2023-07-20 17:17:28 +02:00
bigtedde
0fa103460b removed 'prefix' 2023-07-19 17:24:15 -07:00
bigtedde
975a094e6e generate_archiver_tests added: generate tests by specifying kinds of archivers 2023-07-19 16:23:42 -07:00
bigtedde
7f1847ef85 typehint and initialize variable in ArchiverSetup init 2023-07-16 15:47:36 -07:00
bigtedde
8a5664dcfd remote archiver prefix check 2023-07-16 14:01:06 -07:00
bigtedde
fcddbc6356 Fixed: camelcase, generate test dupe, init vars declerations, general cleanup 2023-07-16 13:33:54 -07:00
bigtedde
0c899a7985 extract_cmd cleanup 2023-07-13 20:14:04 -04:00
bigtedde
bbb5340e8c diff_cmd cleanup 2023-07-13 19:52:59 -04:00
bigtedde
535b336b14 delete_cmd cleanup 2023-07-13 19:37:32 -04:00
bigtedde
3a7ee07cf3 debug_cmds cleanup 2023-07-13 19:33:56 -04:00
bigtedde
225fdb0b72 increased readability in delete_cmd 2023-07-13 17:29:11 -04:00
bigtedde
eb37f4b9aa corrupted_archiver changed from fixture to function call 2023-07-13 17:26:12 -04:00
bigtedde
7fea384fa7 removed print statement from transfer_cmd 2023-07-13 17:16:30 -04:00
bigtedde
9a8d5da822 ValueError added in 'open_repository' 2023-07-13 15:51:58 -04:00
bigtedde
73c178d628 cleanup create_cmd 2023-07-13 15:42:50 -04:00
bigtedde
b2d8210e5d testsuite/benchmark.py - 'cmd' -> 'cmd_fixture' 2023-07-13 11:45:59 -04:00
bigtedde
f502941137 check_cmd cleaned up 2023-07-13 11:27:18 -04:00
bigtedde
fdb21af6e6 cleanup bypass_lock_option tests 2023-07-13 11:09:12 -04:00
Ted Lawson
33645ad38a
Repo tests - conversion to pytest (#7626) 2023-07-11 01:40:51 +02:00
Ted Lawson
7df34fc4a6
Archive pytest conversion (#7661)
parameterized stats_progress and timestamp_parsing tests
2023-07-11 01:14:51 +02:00
TW
56dfc6dc04
Merge pull request #7567 from azrdev/patch-1
automated-local.rst: use GPT UUID for consistent udev rule
2023-07-11 00:06:25 +02:00
TW
52db16b3eb
Merge pull request #7714 from PhrozenByte/docs-check-rewrite
Docs: Rewrite `borg check` docs
2023-07-11 00:00:07 +02:00
Daniel Rudolf
2647673dc8
Docs: Improve borg check docs 2023-07-10 22:41:24 +02:00
bigtedde
1e5c62f1a1 test_unix_socket fix 2023-07-09 22:12:03 -04:00
bigtedde
912df41c4a test_unix_socket fix 2023-07-09 21:42:37 -04:00
bigtedde
62bfd5e13a create_cmd changes 2023-07-09 18:32:02 -04:00
bigtedde
2c5f6645b4 changed socket path to secure temp file 2023-07-09 17:46:50 -04:00
bigtedde
ed02164b68 fixed fuse_mount CM 2023-07-09 17:32:31 -04:00
bigtedde
f1af13e544 removed unittest skips 2023-07-09 17:06:30 -04:00
bigtedde
efc4481996 removed erroneous test from init 2023-07-09 16:40:53 -04:00
bigtedde
6cb87e5ff7 transfer_cmd converted 2023-07-09 16:31:44 -04:00
bigtedde
751bac0fb7 tar_cmds converted 2023-07-09 15:57:01 -04:00
bigtedde
6ca4e15c4b fixed issue in test_unix_socket 2023-07-09 15:27:41 -04:00
bigtedde
9a8fb00c10 serve_cmd converted 2023-07-09 15:05:27 -04:00
bigtedde
5cdbf03110 rlist_cmd converted 2023-07-09 14:57:13 -04:00
bigtedde
a9cf42f6e3 rlist_cmd 2023-07-09 14:56:12 -04:00
bigtedde
116428cd4f rinfo_cmd converted 2023-07-09 14:41:12 -04:00
bigtedde
0f160cda29 return_codes converted 2023-07-09 14:34:06 -04:00
bigtedde
227f43958f rename_cmd converted 2023-07-09 11:57:57 -04:00
bigtedde
c68e0b9936 recreate_cmd converted 2023-07-09 11:50:24 -04:00
bigtedde
673cd4718e rcreate_cmd converted 2023-07-09 11:13:15 -04:00
bigtedde
a3bfc4d390 rdelete_cmd converted 2023-07-09 10:43:51 -04:00
bigtedde
216f13831e rcompress_cmd converted 2023-07-08 17:43:30 -04:00
bigtedde
a4fc546c8a prune_cmd converted 2023-07-08 17:28:32 -04:00
TW
4dfce1cca4
Merge pull request #7719 from bket/fix_test
Fix failing test on OpenBSD
2023-07-08 02:20:07 +02:00
bigtedde
7e14361700 patterns converted 2023-07-07 17:50:44 -04:00
bigtedde
0a104a3435 mount_cmds converted 2023-07-07 17:48:29 -04:00
bigtedde
91dd71e3b1 lock_cmds converted 2023-07-07 16:49:01 -04:00
bigtedde
08ab71669a list_cmd converted 2023-07-07 16:40:39 -04:00
bigtedde
3cccf19671 key_cmds converted 2023-07-07 15:53:49 -04:00
bigtedde
725149cb8b info_cmd converted, edited generate tests comment 2023-07-07 15:26:50 -04:00
bigtedde
b5901eb0a6 merge upstream changes 2023-07-07 15:16:11 -04:00
bigtedde
a438176b85 help_cmd converted 2023-07-07 10:08:25 -05:00
Björn Ketelaars
1074089d37 Fix failing test on OpenBSD
A borgbackup-2.0.0b6 test fails on OpenBSD with the message below.

```
=================================== FAILURES ===================================
_____________________________ test_get_runtime_dir _____________________________

path = '/run/user/55/borg', mode = 511, pretty_deadly = True

    def ensure_dir(path, mode=stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO, pretty_deadly=True):
        """
        Ensures that the dir exists with the right permissions.
        1) Make sure the directory exists in a race-free operation
        2) If mode is not None and the directory has been created, give the right
        permissions to the leaf directory. The current umask value is masked out first.
        3) If pretty_deadly is True, catch exceptions, reraise them with a pretty
        message.
        Returns if the directory has been created and has the right permissions,
        An exception otherwise. If a deadly exception happened it is reraised.
        """
        try:
>           os.makedirs(path, mode=mode, exist_ok=True)

build/lib.openbsd-7.3-amd64-cpython-310/borg/helpers/fs.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
```

If `$XDG_RUNTIME_DIR` is not set `platformdirs.user_runtime_dir()`
returns one of 3 different paths
(https://github.com/platformdirs/platformdirs/pull/201). Proposed fix is
to check if `get_runtime_dir()` returns one of these paths.
2023-07-07 15:38:13 +02:00
TW
7914e38160
Merge pull request #7712 from ThomasWaldmann/manifest-item_keys
manifest: move item_keys into config dict, fixes #7710
2023-07-07 00:58:27 +02:00
TW
cfbfe2423f
Merge pull request #7676 from RayyanAnsari/paths-win
Properly normalise paths on Windows
2023-07-07 00:42:03 +02:00
TW
e63775a316
Merge pull request #7711 from ThomasWaldmann/doc-updates-master
doc updates (master)
2023-07-07 00:30:16 +02:00
TW
29d73f4f41
Merge pull request #7715 from FelixSchwarz/py312-utcfromtimestamp
replace "datetime.utcfromtimestamp" to avoid deprecation warnings with Python 3.12
2023-07-06 23:47:03 +02:00
Felix Schwarz
ae0b3d2fff replace "datetime.utcfromtimestamp" with custom helper to avoid deprecation warnings when using Python 3.12 2023-07-06 21:46:19 +02:00
Daniel Rudolf
a661da13ee
Docs: Improve explanation of borg check --max-duration's side effects 2023-07-06 00:42:57 +02:00
Daniel Rudolf
9d59146de4
Docs: Remove technical description from borg check docs 2023-07-06 00:19:48 +02:00
Daniel Rudolf
9edbf4e931
Docs: Rewrite borg check docs
Fixes #7578
2023-07-06 00:17:55 +02:00
bigtedde
5bc1bbd3a3 extract_cmd converted 2023-07-04 19:35:48 -05:00
bigtedde
95d48c054a disk_full converted 2023-07-04 18:38:10 -05:00
Thomas Waldmann
51e68c24e4
manifest: move item_keys into config dict, fixes #7710
also: manifest.version == 2 now
2023-07-05 01:11:24 +02:00
bigtedde
dfaea063a5 diff_cmd converted 2023-07-04 17:15:15 -05:00
Thomas Waldmann
8db8fd601b
docs: OS X -> macOS 2023-07-04 23:59:44 +02:00
Thomas Waldmann
be731334c3
docs: update macOS hint about full disk access 2023-07-04 23:55:06 +02:00
bigtedde
99bf56cfcd delete_cmd converted 2023-07-04 16:53:06 -05:00
Thomas Waldmann
96c3c90230
docs: remove hint about item_keys in manifest 2023-07-04 23:46:53 +02:00
Thomas Waldmann
ddd93c5828
docs: remove --chunker-params hint to borg < 1.0 2023-07-04 23:41:17 +02:00
Thomas Waldmann
89cfd083ba
docs: minor fixes/update to notes 2023-07-04 23:36:41 +02:00
bigtedde
d18525ae49 debug_cmds added 2023-07-04 16:35:09 -05:00
Thomas Waldmann
84b1ad6948
docs: remove info about borg 1.0 files per dir 2023-07-04 23:32:36 +02:00
bigtedde
2cf784d5c6 combined all tests into one single Archiver folder PR 2023-07-04 15:35:51 -05:00
Rayyan Ansari
7e0cdd7c5e testsuite: Enable test_archived_paths on Windows 2023-07-04 19:44:22 +01:00
Rayyan Ansari
54b654e3b1 fs: Properly normalise paths on Windows
Use forward slashes and integrate the drive letter into the path.
2023-07-04 19:44:22 +01:00
Thomas Waldmann
5fb4cc3b4b
docs: no signature upload on pypi any more
but we upload it on github releases,
so people can check it.
2023-07-04 20:20:35 +02:00
Thomas Waldmann
15781efab3
docs: CI only on github actions now 2023-07-04 20:11:26 +02:00
TW
e695683095
Merge pull request #7699 from ThomasWaldmann/remove-coala-master
remove coala (outdated)
2023-07-02 20:19:36 +02:00
Thomas Waldmann
80188d3bdf
remove coala (outdated)
last coala release (0.11.0) is now over 6y old.

when using pip install coala, a ton of stuff gets installed (expected)
and a part of that downgrades some stuff we use to outdated, incompatible
versions.

when trying to run coala with python 3.11, it just crashes because the
last release was made for py35/py36 (as seen in their setup.py).

a lot of PRs and tickets pile up at the coala project on github,
but noone is maintaining it.
2023-07-02 17:25:51 +02:00
TW
a7d8b02e4e
Merge pull request #7697 from ThomasWaldmann/docs-master
docs updates (master)
2023-07-01 18:55:45 +02:00
Thomas Waldmann
e142776040
update CHANGES 2023-07-01 16:42:15 +02:00
Thomas Waldmann
53991f2e51
move upgrade / compat. notes to own section, see #7546 2023-07-01 16:28:17 +02:00
Thomas Waldmann
deed47824f
mount -olocal: how to show mount in finder's sidebar, fixes #5321 2023-07-01 16:07:31 +02:00
TW
cd678a032d
Merge pull request #7696 from ThomasWaldmann/macfuse-volname-master
mount: make up volname if not given (macOS), fixes #7690
2023-07-01 16:02:28 +02:00
TW
c3cc33fd27
Merge pull request #7695 from ThomasWaldmann/fix-4110-master
extract: fix false warning about pattern never matching, fixes #4110
2023-07-01 16:02:04 +02:00
Thomas Waldmann
bd9af62c07
mount: make up volname if not given (macOS), fixes #7690
macFUSE supports a volname mount option to give what
finder displays on desktop / in directory list.

if the user did not specify it, we make something up,
because otherwise it would be "macFUSE Volume 0 (Python)".
2023-07-01 15:35:03 +02:00
Thomas Waldmann
2aecdb91d4
extract: fix false warning about pattern never matching, fixes #4110 2023-07-01 15:31:00 +02:00
TW
c539b404f6
Merge pull request #7688 from TimWolla/patch-1
Improve the documentation for `--keep-within`
2023-07-01 14:54:19 +02:00
Tim Düsterhus
a6f452a050 Improve the documentation for --keep-within
Move the explanation below the general explanation of the `--keep-*` option
behavior rephrase the last sentence to make it clear that it works like the
other options that were explained in the previous paragraph.

Resolves #7687
2023-06-30 15:23:07 +02:00
TW
f43fcd3bdb
Merge pull request #7686 from ThomasWaldmann/fwd-ports
misc fwd ports
2023-06-30 00:20:01 +02:00
Thomas Waldmann
58d3dbcec0
keyfile: improve key sanity check, fixes #7561
check key file structure, make sure the binary key
is not way too short (or zero) length.

if key file looks strange, emit warnings.
2023-06-29 23:13:29 +02:00
Thomas Waldmann
ec1f2dfbf1
--files-cache=size: fix crash, fixes #7658 2023-06-29 23:09:24 +02:00
Thomas Waldmann
4326813c05
do not upload gpg signature to pypi, fixes #7649 2023-06-29 23:06:28 +02:00
Thomas Waldmann
81c3cb957e
list: fix --pattern examples, fixes #7611
- pattern needs to start with + - !
- first match wins
- the default is to list everything, thus a 2nd pattern
  is needed to exclude everything not matched by 1st pattern.
2023-06-29 23:04:21 +02:00
TW
b37c38afa9
Merge pull request #7685 from ThomasWaldmann/gha-reduce-master
github actions CI: misc improvements
2023-06-29 22:59:08 +02:00
Thomas Waldmann
06fa81aeb0
trivial change to trigger CI 2023-06-29 20:06:26 +02:00
Thomas Waldmann
cab8e5d013
github actions CI: win/mac both need linux succeed first, fixes #7684
also:
- XDISTN=6, 3 cores on macOS machines
- XDISTN=4, 2 cores on windows/linux machines
2023-06-29 19:59:39 +02:00
Thomas Waldmann
e9f766dbbf
gha: remove outdated borg2 branch 2023-06-28 15:27:26 +02:00
TW
349514446f
Merge pull request #7667 from ThomasWaldmann/skip-sparse-test-win32-master
test_sparse_file: skip test on win32
2023-06-23 00:15:44 +02:00
Thomas Waldmann
45cda981f9
test_sparse_file: skip test on win32
about 10-50% of the github windows CI runs fail due to
this - root cause unknown.

Example failure:

        # we first check if we could create a sparse input file:
        sparse_support = is_sparse(filename, total_size, hole_size)
        if sparse_support:
            # we could create a sparse input file, so creating a backup of it and
            # extracting it again (as sparse) should also work:
            self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)
            self.cmd(f"--repo={self.repository_location}", "create", "test", "input")
            with changedir(self.output_path):
                self.cmd(f"--repo={self.repository_location}", "extract", "test", "--sparse")
            self.assert_dirs_equal("input", "output/input")
            filename = os.path.join(self.output_path, "input", "sparse")
            with open(filename, "rb") as fd:
                # check if file contents are as expected
>               self.assert_equal(fd.read(hole_size), b"\0" * hole_size)
E               AssertionError: b'\x0[8388602 chars]x00\xf0Y\xb5\xe3\xee\xf3\x1f\xe3L\xcf\xae\x92\[159253621 chars]\x00' != b'\x0[8388602 chars]x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0[159383505 chars]\x00'

src/borg/testsuite/archiver/extract_cmd.py:212: AssertionError
2023-06-22 23:10:31 +02:00
TW
c89eb98c18
Merge pull request #7665 from ThomasWaldmann/fix-benchmark
benchmark cpu: use sanitized path, fixes #7653
2023-06-22 21:56:31 +02:00
TW
67a32ee603
Merge pull request #7664 from ThomasWaldmann/test-for-backslashes
no backslashes
2023-06-22 21:41:37 +02:00
Thomas Waldmann
420eae6138
benchmark cpu: use sanitized path, fixes #7654 2023-06-22 21:22:18 +02:00
TW
44147fe5b3
Merge pull request #7663 from ThomasWaldmann/send-log-cb
remote logging/progress: add callback to send queued records, fixes #7662
2023-06-22 21:19:18 +02:00
Thomas Waldmann
4f49f9bae6
make_path_safe: remove test for backslashes, fixes #7651
looks like some tools use backslashes in linux/macOS paths.
2023-06-22 20:49:14 +02:00
Thomas Waldmann
3aec98ada9
remote logging/progress: use callback to send queued records, fixes #7662 2023-06-22 20:09:29 +02:00
Ted Lawson
a5c4d0d310
Xattr.py unittest to pytest conversion (#7657) 2023-06-20 16:08:44 +02:00
azrdev
27bcc0f05a
automated-local.rst: Partition table UUID match works for MBR too
not only GPT
2023-06-16 23:28:36 +02:00
TW
96076a71d2
Merge pull request #7646 from ThomasWaldmann/rel200b6
Release 2.0.0b6
2023-06-12 10:35:23 +02:00
Thomas Waldmann
4dca508848
build_man 2023-06-11 23:10:23 +02:00
Thomas Waldmann
70602bda52
build_usage 2023-06-11 23:09:20 +02:00
Thomas Waldmann
fbf463496b
docs: fix some markup / linking issues 2023-06-11 23:03:21 +02:00
Thomas Waldmann
82f180b3c4
update CHANGES, set release date 2023-06-11 22:53:11 +02:00
Tarrailt
616d5e7330
Add --format option to borg diff, resolve issue #4634 (#7534)
diff: add --format option

also: refactoring/improvements of BaseFormatter
2023-06-11 22:41:36 +02:00
TW
8506c05ab6
Merge pull request #7642 from Deric-W/typehints
replace `LRUCache` internals with `OrderedDict`
2023-06-11 17:11:41 +02:00
Eric Wolf
ad3c890167
rephrase docstring and remove unused sentinel 2023-06-11 13:56:58 +02:00
TW
e1e9b4031d
Merge pull request #7643 from ThomasWaldmann/vagrant-updates
Vagrant updates
2023-06-10 23:02:46 +02:00
Eric Wolf
e683c80c75
replace LRUCache internals with OrderedDict
Replacing the internals should make the implementation faster
and simpler since the order tracking is done by the `OrderedDict`.

Furthermore, this commit adds type hints to `LRUCache` and
renames the `upd` method to `replace` to make its use more clear.
2023-06-10 20:57:32 +02:00
Thomas Waldmann
45e00f9df8
vagrant: darwin64 box: install openssl after xxhash
otherwise a openssl build error might manifest in complaints about xxhash not being installed.
2023-06-10 16:54:08 +02:00
Thomas Waldmann
47df6f5a5d
vagrant: use debian/bookworm64 box 2023-06-10 16:51:41 +02:00
TW
0aa165859e
Merge pull request #7637 from ThomasWaldmann/update-changes
update CHANGES
2023-06-10 14:54:21 +02:00
Thomas Waldmann
a347e01919
update CHANGES 2023-06-10 14:53:29 +02:00
TW
4f76f595a9
Merge pull request #7635 from eoli3n/master
Improve patterns help
2023-06-10 14:39:31 +02:00
TW
aca2021112
Merge pull request #7108 from pgerber/dotdot
Sanitize paths during archive creation and extraction
2023-06-10 14:38:57 +02:00
Thomas Waldmann
518c4fbca8
skip test_import_tar_with_dotdot for binary testing 2023-06-10 14:17:07 +02:00
eoli3n
095d5f463b improve patterns help: added declarative includes sample 2023-06-10 14:00:06 +02:00
eoli3n
ba922d2e0a improve patterns help: define a pattern style 2023-06-10 14:00:06 +02:00
eoli3n
9bbb38d9ab improve patterns help 2023-06-10 14:00:06 +02:00
Thomas Waldmann
b7ce3b1156
make sure we do not get backslashes into item paths
on windows, we also want slashes, not backslashes.
2023-06-10 12:52:00 +02:00
Thomas Waldmann
db96c0c487
subclass MakePathSafeAction from Highlander 2023-06-10 11:41:31 +02:00
Peter Gerber
438cf2e7ef
Sanitize paths during archive creation/extraction/...
Paths are not always sanitized when creating an archive and,
more importantly, never when extracting one. The following example
shows how this can be used to attempt to write a file outside the
extraction directory:

$ echo abcdef | borg create -r ~/borg/a --stdin-name x/../../../../../etc/shadow archive-1 -
$ borg list -r ~/borg/a archive-1
-rw-rw---- root   root          7 Sun, 2022-10-23 19:14:27  x/../../../../../etc/shadow
$ mkdir borg/target
$ cd borg/target
$ borg extract -r ~/borg/a archive-1
x/../../../../../etc/shadow: makedirs: [Errno 13] Permission denied: '/home/user/borg/target/x/../../../../../etc'

Note that Borg tries to extract the file to /etc/shadow and the
permission error is a result of the user not having access.

This patch ensures file names are sanitized before archiving.
As for files extracted from the archive, paths are sanitized
by making all paths relative, removing '.' elements, and removing
superfluous slashes (as in '//'). '..' elements, however, are
rejected outright. The reasoning here is that it is easy to start
a path with './' or insert a '//' by accident (e.g. via --stdin-name
or import-tar). '..', however, seem unlikely to be the result
of an accident and could indicate a tampered repository.

With paths being sanitized as they are being read, this "errors"
will be corrected during the `borg transfer` required when upgrading
to Borg 2. Hence, the sanitation, when reading the archive,
can be removed once support for reading v1 repositories is dropped.
V2 repository will not contain non-sanitized paths. Of course,
a check for absolute paths and '..' elements needs to kept in
place to detect tempered archives.

I recommend treating this as a security issue. I see the following
cases where extracting a file outside the extraction path could
constitute a security risk:

a) When extraction is done as a different user than archive
creation. The user that created the archive may be able to
get a file overwritten as a different user.
b) When the archive is created on one host and extracted on
another. The user that created the archive may be able to
get a file overwritten on another host.
c) When an archive is created and extracted after a OS reinstall.
When a host is suspected compromised, it is common to reinstall
(or set up a new machine), extract the backups and then evaluate
their integrity. A user that manipulates the archive before such
a reinstall may be able to get a file overwritten outside the
extraction path and may evade integrity checks.

Notably absent is the creation and extraction on the same host as
the same user. In such case, an adversary must be assumed to be able
to replace any file directly.

This also (partially) fixes #7099.
2023-06-07 23:23:53 +02:00
TW
ac4337a921
Merge pull request #7629 from ThomasWaldmann/update-changes-master
update CHANGES
2023-06-07 18:03:37 +02:00
Thomas Waldmann
57250d0c4b
update CHANGES 2023-06-07 17:46:02 +02:00
TW
97782f3f3c
Merge pull request #7624 from ThomasWaldmann/ci-xdistn-master
CI: try 4 parallel pytest-xdist workers
2023-06-07 00:14:40 +02:00
Thomas Waldmann
7092f24f4a
CI: try 4 parallel pytest-xdist workers 2023-06-06 23:22:03 +02:00
TW
cad57e70c3
Merge pull request #7615 from ThomasWaldmann/serve-socket2
implement unix domain socket support
2023-06-06 23:21:15 +02:00
Thomas Waldmann
ae97584218
fix logging, add some comments
shutting down logging is problematic as it is global
and we do multi-threaded execution, e.g. in tests.

thus, rather just flush the important loggers and keep
them alive.
2023-06-06 21:13:31 +02:00
Thomas Waldmann
ffc59dd071
implement unix domain (ipc) socket support
server (listening) side:
borg serve --socket  # default location
borg serve --socket=/path/to/socket

client side:
borg -r socket:///path/to/repo create ...
borg --socket=/path/to/socket -r socket:///path/to/repo ...

served connections:
- for ssh: proto: one connection
- for socket: proto: many connections (one after the other)

The socket has user and group permissions (770).

skip socket tests on win32, they hang infinitely, until
github CI terminates them after 60 minutes.

socket tests: use unique socket name

don't use the standard / default socket name, otherwise tests
running in parallel would interfere with each other by using
the same socket / the same borg serve process.

write a .pid file, clean up .pid and .sock file at exit

add stderr print for accepted/finished socket connection
2023-06-06 21:12:54 +02:00
Thomas Waldmann
7878a34fd4
add get_runtime_dir / BORG_RUNTIME_DIR, tests, docs 2023-06-06 11:58:48 +02:00
TW
9f51600f20
Merge pull request #7627 from ThomasWaldmann/fix-chunksize-distrib-test-master
fix test_buzhash_chunksize_distribution
2023-06-06 10:43:53 +02:00
Thomas Waldmann
6625fb52ac
fix test_buzhash_chunksize_distribution
the last chunk can be smaller than 2**min_exp.
2023-06-06 10:09:53 +02:00
TW
6a4074d761
Merge pull request #7625 from bigtedde/testsuite-improvements
Parameterize version and item tests
2023-06-05 00:23:36 +02:00
bigtedde
83d821171e Parameterize 'version' and 'item' tests 2023-06-04 14:38:22 -07:00
TW
e70b5b1e94
Merge pull request #7620 from bigtedde/parameterize_test_compress
Parametrize compression tests
2023-06-02 23:03:24 +02:00
bigtedde
e0f6685498 parameterized compression tests 2023-06-02 12:55:35 -07:00
TW
05193d2530
Merge pull request #7623 from RayyanAnsari/windows-ci-merge
CI: merge Windows workflow with main
2023-06-01 22:47:54 +02:00
Rayyan Ansari
4f7d940769
CI: merge Windows workflow with main
This also enables us to avoid running it when lint fails.
2023-06-01 20:25:42 +01:00
TW
021c9b656c
Merge pull request #7619 from DavidRambo/master
Add support and tests for shell-style alternatives.
2023-06-01 12:06:16 +02:00
David Rambo
ee0ca13ab5 Update help docs to reflect support for alternative grouping in shell-style patterns 2023-05-31 16:57:31 -07:00
David Rambo
4efc7cd0bd Add support and tests for shell-style alternatives
Code review fixes

Remove empty line
2023-05-31 15:38:05 -07:00
TW
87b74f3b0d
Merge pull request #7607 from ThomasWaldmann/new-remote-logging
new remote and progress logging, cleanups
2023-05-30 00:14:23 +02:00
Thomas Waldmann
e2ea5cf164
tests: fix usage of .reopen()
also:
add missing param to RemoteRepositoryTestCase.open method, but ignore it.
2023-05-29 23:02:42 +02:00
Thomas Waldmann
48c7879887
RemoteRepository: add .close method
- tears down logging (so no new log output is generated afterwards)
- sends all queued log output
- then returns

also: make stdin_fd / stdout_fd instance variables
2023-05-29 22:40:55 +02:00
Thomas Waldmann
f84951b53c
add logging debugging functionality 2023-05-29 22:40:53 +02:00
Thomas Waldmann
ac4b5c35da
borg serve: shutdown server after sending all queued log records 2023-05-29 22:40:52 +02:00
Thomas Waldmann
746cef1cba
teardown logging in exec_cmd
for normal borg command invocation:
- logging is set up in Archiver.run
- the atexit handler calls logging.shutdown when process terminates

for tests:
- Archiver.run called by exec_cmd
- no atexit handler executed as process lives on
- borg.logger.teardown (calls shutdown and configured=False) now
  called in exec_cmd
2023-05-29 22:40:50 +02:00
Thomas Waldmann
dac4609468
remove_handlers 2023-05-29 22:40:49 +02:00
Thomas Waldmann
c3a4568870
channel progress output via logging system
- simplify progress output (no \r, no terminal size related tweaks)
- emit progress output via the logging system (so it does not use stderr
  of borg serve)
- progress code always logs a json string, the json has all needed
  to either do json log output or plain text log output.
- use formatters to generate plain or json output from that.
- clean up setup_logging
- use a StderrHandler that always uses the **current** sys.stderr
- tweak TestPassphrase to not accidentally trigger just because of seeing 12 in output
2023-05-29 22:40:47 +02:00
Thomas Waldmann
0be545dc45
remove ProgressIndicatorEndless (not used) 2023-05-29 22:40:45 +02:00
Thomas Waldmann
e351e67aee
RepositoryServer: do not use stderr for logging, see #7604
Instead, install a handler that sends the LogRecord dicts to a queue.
That queue is then emptied in the borg serve main loop and
the LogRecords are sent msgpacked via stdout to the client,
similar to the RPC results.

On the client side, the LogRecords are recreated from the
received dicts and fed into the clientside logging system.

As we use msgpacked LogRecord dicts, we don't need JSON for
this purpose on the borg serve side any more.
On the client side, the LogRecords will then be either formatted
as normal text or as JSON log output (by the clientside log
formatter).
2023-05-29 22:40:42 +02:00
TW
ca68dd2565
Merge pull request #7614 from ThomasWaldmann/upgrade-cython-master
development.lock.txt: upgrade cython to 0.29.35, misc. other upgrades (master)
2023-05-29 15:46:58 +02:00
TW
326cf7b46a
Merge pull request #7609 from nain-F49FF806/master-clear-empty-dirs
Add function to clear empty directories at end of compact process.
2023-05-29 15:32:11 +02:00
Thomas Waldmann
8bbef3b672
development.lock.txt: upgrade cython to 0.29.35, misc. other upgrades 2023-05-29 15:18:50 +02:00
Thomas Waldmann
6ae23bc0d7
fix typo 2023-05-29 15:04:30 +02:00
nain
4a7a5b2253 Add function to clear empty directories at end of compact process.
Compact moves data to new segments, and then removes the old segments.
When enough segments are moved, directories holding the now cleared segments
may thus become empty.

With this commit any empty directories are cleared after segments compacting.
Fixes #6823
2023-05-28 01:48:32 -04:00
TW
00e19d047d
Merge pull request #7608 from nain-F49FF806/master-data-scandir-unify-function
unify scanning and listing of segment dirs / segment files and apply good practices
2023-05-27 20:48:01 +02:00
nain
ffe237ce0c unify scanning and listing of segment dirs / segment files and apply good practices
+ os.scandir instead of os.listdir
  Improved speed and added flexibility with attributes (name, path, is_dir(), is_file())
+ use is_dir / is_file to make sure  we're reading only dirs / files respectively
+ Filtering to particular start, end index range built in
+ Move value bounds of segment (index) into constants module and use them instead

Resolves #7597

(forward patch from commits c9f35a16e9bf9e7073c486553177cef79ff1cb06^..edb5e749f512b7737b6933e13b7e61fefcd17bcb)
2023-05-27 07:54:32 -04:00
TW
85b6126629
Merge pull request #7605 from ThomasWaldmann/fix-_resolve_path
fix borg.remote._resolve_path
2023-05-24 17:32:38 +02:00
Thomas Waldmann
89297398c4
fix borg.remote._resolve_path
this used to call get_base_dir (and would have needed
legacy=True now to work like expected).

rather implemented the desired behaviour locally and
got rid of the legacy call (which was a bit strange
anyway as it also considered BORG_BASE_DIR, which is
unexpected when resolving ~).
2023-05-24 17:01:45 +02:00
TW
fbb60140ac
Merge pull request #7603 from ThomasWaldmann/remove-legacy
borg.remote: remove legacy
2023-05-24 16:38:18 +02:00
Thomas Waldmann
90c6b7f794
remote exceptions: simplify sysinfo processing
in the sysinfo function, there is a way to suppress
all sysinfo output via an env var and just return an
empty string.

so we can expect it is always in unpacked, but it
might be the empty string.
2023-05-24 15:30:20 +02:00
Thomas Waldmann
2331341b74
simplify handle_error 2023-05-24 14:38:30 +02:00
Thomas Waldmann
4b796a7337
remote repos: remove support for borg < 1.1.0 ($LOG, logging setup)
log output:

always expect json, remove $LOG format support.

we keep limited support for unstructured format also,
just not to lose anything from remote stderr.
2023-05-24 14:38:24 +02:00
Thomas Waldmann
51177b9f06
remote repos: remove support for borg < 1.1.0 (exceptions)
exception infos:
ancient borg gave only limited infos about exceptions,
but recent ones give more.
2023-05-24 02:13:30 +02:00
Thomas Waldmann
591d8efac4
remote repos: remove support for borg < 1.1.0 (rpc data format, version)
rpc format:
ancient borg used tuples in the rpc protocol,
but recent ones use easier-to-work-with dicts.

version info:
we expect dicts with server/client version now.
2023-05-24 02:13:01 +02:00
TW
0ba40c16fb
Merge pull request #7601 from ThomasWaldmann/security-support-docs-master
Security support docs (master)
2023-05-23 21:10:57 +02:00
Thomas Waldmann
f1152d8209
security: 2.0.x is not yet released, no security support 2023-05-23 21:02:51 +02:00
jetchirag
d07e28db7b
security: 1.1.x is EOL, please upgrade to 1.2.x.
That means I won't make new 1.1.x releases.

In case there would be a major security or other issue,

I might still make a fix commit to the 1.1-maint branch,
where dist package maintainers or other interested
parties could find it.

this ports change 73ee704afa to master.
2023-05-23 21:01:26 +02:00
TW
5e4202e0d2
Merge pull request #7598 from ThomasWaldmann/chunker-params-master
tests: check buzhash chunksize distribution, see #7586
2023-05-23 00:48:59 +02:00
Thomas Waldmann
1fb1cc3ea3
tests: check buzhash chunksize distribution, see #7586 2023-05-23 00:20:28 +02:00
jetchirag
eeefa55428
do not crash for empty archives list in borg rlist date based matching (#7544)
fix ValueError for empty archives list, add a test

Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
2023-05-20 12:30:03 +02:00
TW
ed2bc8a8e0
Merge pull request #7593 from ThomasWaldmann/fix-repo-reopen-master
tests: fix repo reopen (master)
2023-05-20 01:55:58 +02:00
Thomas Waldmann
b9d0f00099
RepositoryTestCaseBase: remove need for "with" after reopen()
setUp enters the context manager, so let's .reopen() leave it.
then create a fresh Repository instance in self.repository and
enter the context manager again. tearDown then will leave that.
2023-05-20 01:31:07 +02:00
Thomas Waldmann
f0e4be76b1
RepositoryTestCaseBase: call __exit__
As we call __enter__ in setUp,
let's call __exit__ in tearDown.
2023-05-20 01:31:05 +02:00
Thomas Waldmann
3d82be0b58
fix RepositoryTestCaseBase.reopen method
"if self.repository" did not work as expected:
- Repository has a __len__ method, so the boolean evaluation was calling that.
- self.repository is also not set to None anywhere.
2023-05-20 01:30:14 +02:00
TW
27f2dffdf8
Merge pull request #7591 from ThomasWaldmann/update-changes-master
update CHANGES
2023-05-19 23:21:21 +02:00
Thomas Waldmann
989017a222
update CHANGES 2023-05-19 22:05:18 +02:00
TW
7a13a98f04
Merge pull request #7583 from ThomasWaldmann/security-dir-in-data
put security infos into data dir, fixes #5760
2023-05-19 21:43:35 +02:00
Thomas Waldmann
989b0a2847
use correct path for security dir when accessing legacy repos (v1)
while on macOS the new and old security dir location is the same path,
this is not the case on e.g. Linux, it could move from .config/borg/security to
.local/share/borg/security .

See #5760.
2023-05-19 21:12:59 +02:00
Thomas Waldmann
c8996aaf12
BORG_DATA_DIR / BORG_SECURITY_DIR docs update 2023-05-18 12:48:47 +02:00
Thomas Waldmann
b8d49a0274
put security infos into data dir, fixes #5760 2023-05-18 12:48:45 +02:00
TW
852172f5ce
Merge pull request #7584 from ThomasWaldmann/test-cosmetics-master
tests: avoid long ids in pytest output
2023-05-18 12:44:26 +02:00
Thomas Waldmann
b0b32e35f5
tests: avoid long ids in pytest output
sometimes the automatically computed IDs are just too long,
so rather give IDs directly or avoid them otherwise.
2023-05-18 05:46:33 +02:00
TW
f5c9f23467
Merge pull request #7582 from ThomasWaldmann/vagrant-updates-master
Vagrant updates master
2023-05-17 01:04:39 +02:00
Thomas Waldmann
7bb644e997
tox: package = editable-legacy, fixes #7580 2023-05-17 01:01:05 +02:00
Thomas Waldmann
0744b7a241
fix test_extract_continue for hfs timestamp granularity 2023-05-17 00:19:42 +02:00
Thomas Waldmann
863bd8a4f4
vagrant: upgrade pythons
e.g. on freebsd13, <3.9.10 has sysconfigdata issues
2023-05-16 23:28:36 +02:00
TW
7e0221d3a2
Merge pull request #7577 from ThomasWaldmann/fix-test-extract-continue
fix test_extract_continue
2023-05-16 19:57:23 +02:00
Thomas Waldmann
82ccf0c08c
fix test_extract_continue
make a hardlink to keep the inode allocated,
so it can not re-use the same inode when it
(deletes and re)creates the file.
2023-05-16 19:12:46 +02:00
TW
5566e912b2
Merge pull request #7576 from ThomasWaldmann/dev-requirments-master
update development.lock.txt
2023-05-16 19:11:08 +02:00
Thomas Waldmann
8867f6d640
update development.lock.txt
main reason was tox crashing:

https://github.com/tox-dev/tox/issues/2829

cython 0.29.34 for py312 support.
2023-05-16 17:35:59 +02:00
TW
2373d52aa5
Merge pull request #7575 from ThomasWaldmann/setup-fixes-master
Setup fixes (master)
2023-05-16 15:06:47 +02:00
Thomas Waldmann
7bcc4ec884
add wheel to dev requirements
looks like tox prefers to have it in the host
environment.
2023-05-16 14:30:34 +02:00
Thomas Waldmann
efc69eab80
tox under fakeroot: fix finding setup_docs, fixes #7391 2023-05-16 14:28:51 +02:00
Thomas Waldmann
05cfbf67bc
setup.cfg: remove setup_requires, fixes #7574 2023-05-16 13:38:15 +02:00
TW
4d7c7b0fcb
Merge pull request #7571 from ThomasWaldmann/match-archives-docs
docs: fix some -a / --match-archives issues
2023-05-16 10:13:19 +02:00
Thomas Waldmann
8e6c504654
docs: fix some -a / --match-archives issues
at some places, the docs were not updated yet.

for borg 1.x, -a (aka --glob-archives) expected
sh: style glob patterns ONLY (but one must not
give sh: explicitly).

for borg 2, -a (aka --match-archives) defaults
to id: style (identical match), so one must give
sh: if one wants shell-style globbing.
2023-05-16 00:50:50 +02:00
TW
79743d0503
Merge pull request #7569 from elandorr/master
incl./excl. options, path-from-stdin exclusiveness
2023-05-15 21:47:33 +02:00
elandorr
bfe6e0da5d
Update create_cmd.py 2023-05-15 11:49:22 +00:00
elandorr
c83507eb0c
mention paths-from-stdin's exclusiveness 2023-05-14 19:24:55 +00:00
elandorr
4fb2f2151e
include/exclude options 2023-05-14 19:23:15 +00:00
TW
8c9ad4172a
Merge pull request #7565 from elandorr/master
doc markup fixes
2023-05-14 18:59:15 +02:00
azrdev
843496dac9
automated-local.rst: use GPT UUID for consistent udev rule 2023-05-14 14:52:39 +02:00
elandorr
e086d2a8f6
markup fix + note about MAX_DATA_SIZE 2023-05-14 07:14:48 +00:00
elandorr
8e2f5a621b
escape 2023-05-14 07:09:45 +00:00
TW
b70cefa474
Merge pull request #7556 from ThomasWaldmann/kill-nonce-manager
remove nonce management, related repo methods
2023-05-12 00:00:29 +02:00
TW
dc0112ce44
Merge pull request #7557 from ThomasWaldmann/crypto-cleanup
cosmetic crypto cleanup
2023-05-11 23:55:30 +02:00
Thomas Waldmann
f970679b62
low_level crypto: fix borg version in comments 2023-05-11 20:10:55 +02:00
Thomas Waldmann
44f58b0870
low_level crypto: minor cleanup
HMAC is not used, we use hmac from py stdlib.
2023-05-11 20:09:47 +02:00
Thomas Waldmann
e02d9edc34
remove nonce management, related repo methods
not needed for borg2 repos (we derive a new session key for each borg
invocation and start counting from 0).

also not needed for borg 1.x repos because we only read them (borg transfer)
and won't write new encrypted data to them.
2023-05-11 17:51:49 +02:00
TW
8ba04bbf37
Merge pull request #7555 from ThomasWaldmann/update-changes-master
update CHANGES
2023-05-10 21:27:52 +02:00
Thomas Waldmann
7c7501acd8
update CHANGES 2023-05-10 20:50:36 +02:00
TW
c7aa0cc5d9
Merge pull request #7554 from ThomasWaldmann/vagrant-updates
vagrant: add lunar64 VM
2023-05-10 17:41:38 +02:00
Thomas Waldmann
2dc0085870
vagrant: add lunar64 VM 2023-05-10 17:40:15 +02:00
TW
49fe6f34aa
Merge pull request #7540 from ThomasWaldmann/transfer-recompress
borg transfer --compression=C --recompress=M, fixes #7529
2023-05-06 22:00:28 +02:00
Thomas Waldmann
0b62338d4a
borg transfer --compression=C --recompress=M, fixes #7529 2023-04-24 23:46:38 +02:00
TW
e302fd9da6
Merge pull request #7488 from centic9/master
Describe performing pull-backups via ssh remote forwarding
2023-04-18 18:34:46 +02:00
TW
ee9bf28df9
Merge pull request #7524 from ThomasWaldmann/test-no-backslashes
tests: check for posix-like paths in archives, see #7120
2023-04-18 18:21:48 +02:00
TW
cca8280393
Merge pull request #7526 from ThomasWaldmann/continue-extract-master
extract --continue
2023-04-17 22:28:24 +02:00
Thomas Waldmann
573275e678
extract --continue: continue a previously interrupted extraction, fixes #1356
This skips over all previously fully extracted regular files,
but will delete and fully re-extract incomplete files.
2023-04-16 21:09:48 +02:00
Thomas Waldmann
7786cc7cb4
extract: support extraction of atime/mtime on win32 2023-04-16 20:40:35 +02:00
Thomas Waldmann
9e534c1929
Archive.extract_item: remove unused params, make most params kwargs
stripped_components: this is done already in do_extract, it modifies item.path accordingly.

original_path: not used any more.

also: run black.
2023-04-16 15:40:36 +02:00
Thomas Waldmann
0dee28bd9f
tests: check for posix-like paths in archives, see #7120 2023-04-15 20:29:26 +02:00
TW
0679cbd410
Merge pull request #7523 from ThomasWaldmann/optimize-src-dir-master
tests: use a smaller dir for src_dir, fixes #7518
2023-04-15 17:19:32 +02:00
Thomas Waldmann
4505c90920
tests: use a smaller dir for src_dir, fixes #7518
also: introduce src_file, which is a file in src_dir.
2023-04-15 16:46:23 +02:00
TW
b52a8af6f0
Merge pull request #7517 from snsmac/feat/highlander
Ensure that cli options specified with action=Highlander can only be set once.
2023-04-15 16:45:28 +02:00
snsmac
53b4cf05fb Ensure that cli options specified with action=Highlander can only be set once, even if the set value is a default value. Add tests for action=Highlander. See #7500 #6269 2023-04-15 16:12:36 +02:00
TW
9263705de7
Merge pull request #7521 from ThomasWaldmann/fix-argparse-errors-master
Fix argparse error messages
2023-04-15 15:08:07 +02:00
TW
81e618ba28
Merge pull request #7513 from ThomasWaldmann/friendlier-exceptions-master
refactor toplevel exception handling, see #6018
2023-04-15 15:03:27 +02:00
Thomas Waldmann
0b40e038ad
fix CompressionSpec validator and tests 2023-04-12 01:45:46 +02:00
Thomas Waldmann
05bf29f504
fix SortBySpec validator 2023-04-12 01:21:43 +02:00
Thomas Waldmann
0f923c8c4a
fix FilesCacheMode validator 2023-04-12 01:18:05 +02:00
Thomas Waldmann
6d38530ff1
fix ChunkerParams validator and tests 2023-04-12 01:15:46 +02:00
TW
9307f804bf
Merge pull request #7515 from ThomasWaldmann/vagrant-updates
vagrant updates
2023-04-09 01:50:16 +02:00
Thomas Waldmann
6c62a944fc
vagrant: fix packages_netbsd 2023-04-08 20:30:40 +02:00
TW
1e1c922298
Merge pull request #7512 from ThomasWaldmann/prune-list-pruned-master
prune --list-kept/--list-pruned, fixes #7511
2023-04-08 17:37:33 +02:00
TW
33599b9115
Merge pull request #7509 from ThomasWaldmann/build-filter-microopt
build_filter: micro opt / easier code, fixes #3390
2023-04-08 17:11:40 +02:00
Thomas Waldmann
02b28882b3
prune --list-kept/--list-pruned, fixes #7511
use this to only list the kept (or pruned) archives.
--list-pruned and --list-kept also work in a additive way.

implied logging: support multiple prune options activating same logger

if any of --list / --list-kept / --list-pruned is used,
it should put the borg.output.list logger to INFO level,
otherwise to WARN level.
2023-04-08 15:40:07 +02:00
TW
e3352b1efc
Merge pull request #7514 from ThomasWaldmann/format-env-vars-master
implement BORG_<CMD>_FORMAT env vars, fixes #5166
2023-04-08 14:16:01 +02:00
Thomas Waldmann
9f4f2b42e3
implement BORG_<CMD>_FORMAT env vars, fixes #5166
for now for: prune, list, rlist.
2023-04-08 00:53:53 +02:00
Thomas Waldmann
b0b3d9e08c
refactor toplevel exception handling, see #6018
as a first step, i moved all the traceback formatting
to format_tb.

also, it **first** prints the error and then the traceback
as additional information for a bug report, as suggested
by @jimparis in that ticket.
2023-04-08 00:12:06 +02:00
TW
48f3161248
Merge pull request #7510 from ThomasWaldmann/prune-format-master
prune --short/--format: enable users to format the list output, fixes #3238
2023-04-07 20:24:40 +02:00
TW
b8337b6f77
Merge pull request #7507 from ThomasWaldmann/ignore-empty-path-master
create: ignore empty paths, print warning, fixes #5637
2023-04-07 19:39:27 +02:00
TW
cfbaa3feae
Merge pull request #7506 from ThomasWaldmann/archive-size-nfiles
rlist: size and nfiles format keys
2023-04-07 19:38:54 +02:00
TW
50812f8033
Merge pull request #7508 from ThomasWaldmann/benchmark-use-random-dir-master
benchmark crud: use TemporaryDirectory below given path, fixes #4706
2023-04-07 19:37:35 +02:00
Thomas Waldmann
7686a721af
strip_components: remove bad test 2023-04-07 19:34:32 +02:00
Thomas Waldmann
a0e1110c16
prune --short/--format: enable users to format the list output, fixes #3238 2023-04-07 19:30:22 +02:00
Thomas Waldmann
8060d4100a
build_filter: micro opt / easier code, fixes #3390 2023-04-07 18:21:17 +02:00
Thomas Waldmann
08a2db9410
benchmark crud: use TemporaryDirectory below given path, fixes #4706 2023-04-07 18:05:19 +02:00
Thomas Waldmann
7df6301144
create: ignore empty paths, print warning, fixes #5637 2023-04-07 17:04:00 +02:00
Thomas Waldmann
7a2c757c69
rlist: add size and nfiles to format keys, fixes #6086 2023-04-07 16:37:17 +02:00
Thomas Waldmann
355a50225f
ArchiveFormatter.get_meta: add default value argument 2023-04-07 14:23:43 +02:00
TW
09781e1d30
Merge pull request #7503 from ThomasWaldmann/update-changes
update CHANGES
2023-04-07 00:02:50 +02:00
Thomas Waldmann
7395e4684d
update CHANGES 2023-04-06 21:11:38 +02:00
TW
6662b8dadb
Merge pull request #7498 from ThomasWaldmann/mount-dir-check-master
mount: improve mountpoint error msgs, see #7496
2023-04-06 20:26:43 +02:00
TW
cf55dd0ebd
Merge pull request #7499 from ThomasWaldmann/more-highlander
more Highlander options, fixes #6269
2023-04-06 20:26:26 +02:00
TW
0ba54529a0
Merge pull request #7501 from ThomasWaldmann/gha-increase-timeout-master
CI: increase timeout / save cpu cycles on macOS
2023-04-06 20:19:34 +02:00
Thomas Waldmann
5c24149237
ci: use a faster python on macOS
the macOS machines used for github actions are sometimes slow,
so rather try to put less burden on them.
2023-04-06 19:50:01 +02:00
Thomas Waldmann
bcfbdb6e79
ci: looks like 40mins is not always enough
might depend on server load at gh.
2023-04-06 19:29:01 +02:00
Thomas Waldmann
12f9a26fad
common options: more Highlander options, fixes #6269 2023-04-06 19:11:58 +02:00
Thomas Waldmann
971438dfa0
import/export-tar: more Highlander options, fixes #6269 2023-04-06 17:53:27 +02:00
Thomas Waldmann
d0d8cd1edf
serve: more Highlander options, fixes #6269 2023-04-06 17:49:40 +02:00
Thomas Waldmann
1a6d1d0c7c
rlist: more Highlander options, fixes #6269 2023-04-06 17:47:56 +02:00
Thomas Waldmann
6ca2256f26
rcompress: more Highlander options, fixes #6269 2023-04-06 17:46:17 +02:00
Thomas Waldmann
644796ad6b
list: more Highlander options, fixes #6269 2023-04-06 17:44:07 +02:00
Thomas Waldmann
6074ca44d9
debug: more Highlander options, fixes #6269 2023-04-06 17:40:47 +02:00
Thomas Waldmann
ffdd156fd4
compact: more Highlander options, fixes #6269 2023-04-06 17:36:49 +02:00
Thomas Waldmann
5d8986c440
check: more Highlander options, fixes #6269 2023-04-06 17:35:54 +02:00
Thomas Waldmann
afccb1dee5
transfer: more Highlander options, fixes #6269 2023-04-06 17:33:41 +02:00
Thomas Waldmann
79b39c4652
recreate: more Highlander options, fixes #6269 2023-04-06 17:31:48 +02:00
Thomas Waldmann
21a3a95cc8
rcreate: more Highlander options, fixes #6269 2023-04-06 17:26:31 +02:00
Thomas Waldmann
13e99033cb
delete: more Highlander options, fixes #6269 2023-04-06 17:15:09 +02:00
Thomas Waldmann
1aae04e66e
prune: more Highlander options, fixes #6269 2023-04-06 17:10:16 +02:00
Thomas Waldmann
645b0088c5
create: more Highlander options, fixes #6269 2023-04-06 17:03:08 +02:00
Thomas Waldmann
7eb04b86ed
mount: improve mountpoint error msgs, see #7496
saying "must be a writable directory" can distract
from the real root cause as seen in #7496.

so we better first check if the mountpoint is an
existing directory and if not, just tell that.

after that, we check permissions and if they are not
like required, tell that.
2023-04-04 23:25:29 +02:00
TW
315f312bb2
Merge pull request #7494 from jonas-w/patch-1
it's 2023
2023-04-03 13:43:57 +02:00
Jonas Wunderlich
5da52d152c
it's 2023 2023-04-03 13:28:16 +02:00
TW
ffea8a0f25
Merge pull request #7487 from ThomasWaldmann/pyupgrade-py39-plus
pyupgrade --py39-plus ./**/*.py
2023-04-02 23:02:07 +02:00
TW
4faf375339
Merge pull request #7492 from ThomasWaldmann/fix-progress-msg-width-master
ProgressIndicatorPercent: fix space computation for wide chars, fixes #3027
2023-04-02 22:59:43 +02:00
Dominik Stadler
753419d506 Suggest to use forced command when using remote-fowarding via ssh 2023-04-02 22:58:37 +02:00
TW
6b02c05f2b
Merge pull request #7489 from ThomasWaldmann/option-x-help-master
improve --one-file-system help /docs
2023-04-02 21:58:18 +02:00
Thomas Waldmann
3dd14f4855
ProgressIndicatorPercent: fix space computation for wide chars, fixes #3027
needs to use swidth() in case there are wide chars (like CJK)
in the left part of the msg (e.g. an archive name).
2023-04-02 21:57:02 +02:00
TW
55ec00352f
Merge pull request #7491 from ThomasWaldmann/borgfs-statfs-master
borgfs.statfs: add comments
2023-04-02 17:44:38 +02:00
Thomas Waldmann
b7adee65bd
--one-file-system: add macOS apfs notes, fixes #4876 2023-04-02 17:28:20 +02:00
Thomas Waldmann
63e17d6da2
borgfs.statfs: add comments 2023-04-02 16:56:28 +02:00
Thomas Waldmann
6ca1ed9716
improve --one-file-system help string, fixes #5618 2023-04-02 14:30:53 +02:00
Dominik Stadler
d2ff0a3aab Adjust description some more, use back-quotes properly, add some links 2023-04-02 11:15:21 +02:00
Dominik Stadler
6ab281875e Adjust repository path 2023-04-02 11:05:31 +02:00
Dominik Stadler
8fab4e4152 Fix command and add more notes 2023-04-02 11:03:32 +02:00
Dominik Stadler
4216dfd12d Describe performing pull-backups via ssh remote forwarding 2023-04-02 10:52:36 +02:00
Thomas Waldmann
52793be923
pyupgrade --py39-plus ./**/*.py 2023-04-02 02:14:54 +02:00
nain-F49FF806
dfef2b9092
fix config/cache dir compatibility issues, fixes #7445 (#7448)
fix config dir compatibility issue, fixes #7445

- add tests
- make sure the result of get_cache_dir matches pre and post #7300 where desired
- harmonize implementation of config_dir_compat and cache_dir_compat tests

Co-authored-by: nain <126972030+F49FF806@users.noreply.github.com>
2023-03-30 00:24:42 +02:00
Soumik Dutta
1428ffeae9
Add parse-obj and format-obj debug commands (#7443)
add parse-obj and format-obj debug commands, fixes #7406

Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-28 21:45:48 +02:00
TW
80c08abe45
Merge pull request #7482 from ThomasWaldmann/fix-retry-test
skip "do not retry when permissions denied" test if running as root
2023-03-28 17:00:21 +02:00
Thomas Waldmann
2692fa1146
skip "do not retry when permissions denied" test if running as root
we can not take away read permissions for root,
so the test would fail.
2023-03-28 15:55:10 +02:00
TW
f6f108c54c
Merge pull request #7478 from bbx0/master
Add support to build dependencies from source to the Vagrantfile
2023-03-27 20:58:34 +02:00
TW
0fa44e4079
Merge pull request #7474 from ThomasWaldmann/support-id-verification
transfer: verify chunks we get using assert_id, fixes #7383
2023-03-27 17:04:49 +02:00
TW
8f1f83b009
Merge pull request #7479 from ThomasWaldmann/update-codeql
codeql action: upgrade to v2
2023-03-27 16:59:08 +02:00
Thomas Waldmann
3d65cb3fea
transfer: verify chunks we get using assert_id, fixes #7383
this needs to decompress and to hash the chunk data,
but better let's play safe.

at least we still can avoid the (re-)compression with
borg transfer (which is often much more expensive
than decompression).
2023-03-27 16:36:53 +02:00
Thomas Waldmann
d6091c41c7
codeql action: upgrade to v2 2023-03-27 16:25:58 +02:00
TW
8dc52b23db
Merge pull request #7477 from Michael-Girma/enhancement/issue-7476
Added pre-commit for linting purposes. Fixes #7476
2023-03-27 16:22:48 +02:00
bbx0
af66cf4010 Add stretch64 VM with deps built from source 2023-03-26 21:01:13 +02:00
bbx0
57262499ba Add support to install dependencies from source 2023-03-26 20:58:12 +02:00
Michael Deyaso
20a4c960ec Changed black rev in pre-commit yaml. Fixes #7476 2023-03-25 19:26:32 +03:00
Michael Deyaso
98d1c65b40 Installed and configured pre-commit to lint and format code. Fixes #7476 2023-03-25 13:34:30 +03:00
TW
276c5f3ff6
Merge pull request #7473 from Michael-Girma/forward_port/pr-7471
Resolved mode bug and added sleep clause for darwin systems. Fixes #7470
2023-03-24 12:10:06 +01:00
Michael Deyaso
6e8310346e Forward port of #7471. Fixes #7470 2023-03-24 09:01:42 +03:00
TW
7cc9d32988
Merge pull request #7463 from ThomasWaldmann/docs-borg-key-file-master
BORG_KEY_FILE: clarify docs, fixes #7444
2023-03-22 22:33:27 +01:00
Thomas Waldmann
d6e3d36ce1
BORG_KEY_FILE: clarify docs, fixes #7444 2023-03-22 18:17:29 +01:00
TW
d25465cbfa
Merge pull request #7460 from dotdoom/master-ignorezeros
Add --ignore-zeros flag to import-tar
2023-03-22 14:17:56 +01:00
Artem Sheremet
335efbf187 Simplify import-tar ignore-zeros negative test
Some of those cleanups are unnecessary since we don't use
assert_dirs_equal.
2023-03-22 11:19:44 +01:00
Artem Sheremet
c999d5dded Explain multiple tarball import with ignore-zeros 2023-03-22 11:13:19 +01:00
Artem Sheremet
8071ef6280 Add a negative test for import-tar --ignore-zeros 2023-03-21 23:08:40 +01:00
Artem Sheremet
3c941ae604 Add --ignore-zeros flag to import-tar
Fixes #7432.
2023-03-21 22:49:23 +01:00
TW
46f1cda204
Merge pull request #7455 from ThomasWaldmann/remove-cache-only-from-delete
delete: remove --cache-only option, fixes #7440
2023-03-20 21:48:57 +01:00
TW
c187d7c8e6
Merge pull request #7452 from snsmac/fix/no_perm_retry
Do not retry on permission errors
2023-03-20 21:48:27 +01:00
Thomas Waldmann
dad99650af
test whether borg skips permission denied files without retries 2023-03-20 21:21:15 +01:00
Thomas Waldmann
02eb9cd443
delete: remove --cache-only option, fixes #7440
for deleting the cache only, use:

borg rdelete --cache-only
2023-03-20 20:51:13 +01:00
snsmac
045d428ecc Do not retry on permission errors 2023-03-19 12:35:39 +01:00
TW
270b705248
Merge pull request #7442 from ThomasWaldmann/freebsd-xattr-fixes-master
xattrs: fix namespace processing on FreeBSD, fixes #6997
2023-03-13 17:20:25 +01:00
Thomas Waldmann
88231a2f64
xattrs: fix namespace processing on FreeBSD, fixes #6997 2023-03-13 11:14:07 +01:00
TW
800e8dd53f
Merge pull request #7437 from RayyanAnsari/windows-docs
docs: installation: Add instructions for Windows
2023-03-12 23:33:40 +01:00
Rayyan Ansari
3174904ce3
docs: installation: Add instructions for Windows
Remove the old Windows README while we're at it.
2023-03-12 20:53:11 +00:00
TW
6ff4b67854
Merge pull request #7436 from snsmac/forwardport/id-hash
debug id-hash: implement file content id-hash computation, see #7406 (forwardport-master)
2023-03-12 20:47:17 +01:00
TW
63050d379f
Merge pull request #7438 from RayyanAnsari/windows-ci-paths
Windows CI: only run when certain files are modified
2023-03-12 20:45:20 +01:00
Thomas Waldmann
cf0eade672 debug id-hash: implement file content id-hash computation, see #7406 2023-03-12 18:02:38 +01:00
Rayyan Ansari
89824bc705
Windows CI: only run when certain files are modified
The Windows CI does not need to run when files such as docs are
changed.
2023-03-12 15:35:32 +00:00
TW
5e85d043fd
Merge pull request #7433 from ThomasWaldmann/remove-os-directory-master
docs: remove OS directory from install docs
2023-03-11 19:15:41 +01:00
Thomas Waldmann
506652d4b2
docs: remove OS directory from install docs
- links did not work that way
- each OS has its own headline and can be discovered easily without
  that directory
2023-03-11 18:50:22 +01:00
TW
0c58378f08
Merge pull request #7423 from abebeos/7356-dev-setup-docs
docs: installation: add link to OS dependencies
2023-03-10 22:38:17 +01:00
TW
a0e0d5ea74
Merge pull request #7427 from RayyanAnsari/windows-build-simplify
Windows: simplify building
2023-03-10 19:46:59 +01:00
Rayyan Ansari
ce50c497b0
Windows: simplify building
Use the standard pip build command, and get rid of the build script.
2023-03-10 17:51:03 +00:00
abebeos
f9f33044cc add link to OS dependencies
The "Building a development environment" section links to the
"Using git" section. This can result in developers overseeing
the os dependencies necessity.

re #7356
2023-03-10 16:44:01 +00:00
TW
16a0e2c3a4
Merge pull request #7421 from ThomasWaldmann/msgpack105-master
allow msgpack 1.0.5 also
2023-03-09 23:16:12 +01:00
Thomas Waldmann
1ab90b339e
allow msgpack 1.0.5 also 2023-03-09 22:26:38 +01:00
Michael Deyaso
2c232449b0
Modified Item.pyx to include diffs in ctime and mtime (#7335)
diff: include changes in ctime and mtime, fixes #7248

also:
- sort JSON output alphabetically
- add --content-only to ignore metadata changes

Co-authored-by: Michael Deyaso <mdeyaso@fusioniq.io>
2023-03-06 23:18:36 +01:00
TW
bba91e4b8b
Merge pull request #7413 from snsmac/forwardport/autotest
"auto" compressor tests: do not assume zlib is better than lz4, fixes #7363 (forwardport-master)
2023-03-06 20:12:04 +01:00
Thomas Waldmann
e7de9dcdcb "auto" compressor tests: do not assume zlib is better than lz4, fixes #7363
while that might be true for many cases, we can not assume it is
always true, as proven by the failing test on S390.
2023-03-06 18:43:09 +01:00
TW
7ce0887070
Merge pull request #7401 from ThomasWaldmann/unicode-filenames-docs-master
update FAQ about locale/unicode issues, fixes #6999
2023-03-05 17:49:14 +01:00
TW
9f703e9138
Merge pull request #7403 from ThomasWaldmann/mount-docs-master
docs: improve mount options rendering, fixes #7359
2023-03-05 17:48:24 +01:00
TW
611e391da9
Merge pull request #7405 from ThomasWaldmann/fix-debug-cmds-master
fix borg debug get-obj/put-obj (master)
2023-03-04 22:20:54 +01:00
Thomas Waldmann
9a39b53828
debug put-obj: id must be given on commandline, fixes #7290
this is an incompatible change:

before:
borg debug put-obj path1 path2 ...
(and borg computed all IDs automatically) (*)

after:
borg debug put-obj id path
(id must be given)

(*) the code just using sha256(data) was outdated and incorrect anyway.

also: debug get-obj: improve error handling
2023-03-04 20:05:23 +01:00
Thomas Waldmann
1632d6305e
docs: improve mount options rendering, fixes #7359 2023-03-04 16:56:18 +01:00
Thomas Waldmann
23dcc18bec
update FAQ about locale/unicode issues, fixes #6999 2023-03-04 16:30:24 +01:00
TW
8027c7b284
Merge pull request #7396 from ThomasWaldmann/improve-platformdirs-docs
clarify platformdirs requirements, fixes #7393
2023-03-01 17:24:14 +01:00
Thomas Waldmann
85cc7418ca
clarify platformdirs requirements, fixes #7393
3.0.0 is only required for macOS due to breaking changes.

2.6.0 was the last breaking change for Linux/UNIX.
2023-03-01 13:18:12 +01:00
TW
e1fd24aa6e
Merge pull request #7394 from helmutg/reproducible-docs
Make timestamps in manual pages reproducible
2023-02-28 12:13:19 +01:00
Vagrant Cascadian
98352cf667 Make timestamps in manual pages reproducible
Refer to https://reproducible-builds.org/docs/source-date-epoch/ for
documentation on SOURCE_DATE_EPOCH.

Bug-Debian: https://bugs.debian.org/1029807
Signed-off-by: Helmut Grohne <helmut@subdivi.de>
2023-02-28 11:41:31 +01:00
TW
4b745f98c1
Merge pull request #7390 from ThomasWaldmann/rel200b5
release 2.0.0 beta 5
2023-02-27 01:20:15 +01:00
Thomas Waldmann
f06d3cc9c8
build_man 2023-02-26 21:32:44 +01:00
Thomas Waldmann
52b9f8e7e9
build_usage 2023-02-26 21:32:42 +01:00
Thomas Waldmann
1233b47878
sphinx: fix extlinks configuration
otherwise sphinx crashes.
2023-02-26 21:32:40 +01:00
Thomas Waldmann
03cb4d4124
update CHANGES, set release date
also minor other changes.
2023-02-26 21:32:32 +01:00
TW
437ee97e66
Merge pull request #7388 from diivi/feat/log-cache-dir
feat: add cache dir to --debug
2023-02-26 21:02:12 +01:00
TW
9710c8f0a6
Merge pull request #7389 from ThomasWaldmann/vagrant-updates
updates and fixes done while working with the VMs
2023-02-26 20:55:16 +01:00
Thomas Waldmann
a8792f466b
development.lock.txt: upgrade to more recent versions 2023-02-26 20:29:30 +01:00
Divyansh Singh
7dd186ccf3 feat: add cache dir to --debug 2023-02-26 23:48:35 +05:30
Thomas Waldmann
a3ab390e59
test_create_read_special_symlink: fix exception in test cleanup code on FreeBSD, fixes #7386 2023-02-26 19:10:39 +01:00
Thomas Waldmann
98338f4cc0
hfs+ filesystem (darwin64 VM) has 1s ts granularity, fixes #7387 2023-02-26 19:07:10 +01:00
Thomas Waldmann
6160c0918f
vagrant: add debian bookworm (debian testing) VM 2023-02-26 18:05:59 +01:00
Thomas Waldmann
dc773ffb81
vagrant: use Python 3.11.2 2023-02-26 18:03:24 +01:00
TW
b04b4438bf
Merge pull request #7385 from ThomasWaldmann/update-changes
update CHANGES
2023-02-26 02:31:58 +01:00
Thomas Waldmann
c8f5cab8b6
update CHANGES 2023-02-26 01:14:18 +01:00
TW
8f73f00fb5
Merge pull request #7384 from ThomasWaldmann/transfer-bugfix
transfer: fix exception in dry-run mode
2023-02-26 01:12:38 +01:00
Thomas Waldmann
2b935cfe41
transfer: fix exception in dry-run mode
Only call archive.stats.show_progress(final=True) if
we actually have an archive (== not in dry-run mode).
2023-02-26 00:41:13 +01:00
TW
4d44b7d439
Merge pull request #7381 from ThomasWaldmann/rtd-config2-master
readthedocs: don't create a pdf
2023-02-25 02:27:57 +01:00
Thomas Waldmann
79d125212d
readthedocs: don't create a pdf 2023-02-25 02:27:08 +01:00
TW
a96cba4ebd
Merge pull request #7380 from ThomasWaldmann/rtd-config-master
add .readthedocs.yaml
2023-02-25 02:17:03 +01:00
Thomas Waldmann
a40390b1ac
add .readthedocs.yaml
otherwise rtd uses:
- python 3.7, which is too old for borg.
- shallow git checkout, which might make setuptools_scm fail to create a correct version
2023-02-25 02:16:21 +01:00
Soumik Dutta
cad138aa23
Add files changed while reading to Statistics class #7354 (#7378)
add files changed while reading to Statistics class, fixes #7354

Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-02-25 01:47:39 +01:00
TW
b208785fff
Merge pull request #7351 from ThomasWaldmann/retry-failed-files
create: implement retries for individual fs files
2023-02-23 01:46:36 +01:00
Thomas Waldmann
7e6afc93e9
create: implement retries for individual fs files
Errors handled for backup src files:
- BackupOSError (converted from OSError), e.g. I/O Error
- BackupError (stats race, file changed while we backed it up)

Error Handling:
- retry the same file after some sleep time
- sleep time starts from 1ms, increases exponentially up to 10s
- 10 tries

If retrying does not help:
- BackupOSError: skip the file, log it with "E" status
- BackupError: last try will back it up, log it with "C" status

Works for:
- borg create's normal (builtin) fs recursion
- borg create --paths-from-command
- borg create --paths-from-stdin

Notes:
- update stats.files_stats late (so we don't get wrong
  stats in case of e.g. IOErrors while reading the file).
- _process_any: no changes to the big block, just indented
  for adding the retry loop and the try/except.
- test_create_erroneous_file succeeds because we retry the file.
2023-02-23 01:19:19 +01:00
TW
6da5b7d1ba
Merge pull request #7367 from ThomasWaldmann/new-crypto-assert-id
assert_id: better be paranoid, fixes #7362
2023-02-23 01:14:25 +01:00
TW
3f2aac8f00
Merge pull request #7368 from vhadzhiev/vhadzhiev_contribution
fixed Statistics.__add__(), fixes #7355
2023-02-20 18:07:21 +01:00
vhadzhiev
a08a3eb173 fixed Statistics.__add__(), fixes #7355 2023-02-20 11:25:28 +02:00
Thomas Waldmann
74a19ee2a0
verify_data: always decompress and call assert_id(), see #7362 2023-02-19 21:25:24 +01:00
Thomas Waldmann
fea630027c
assert_id: better be paranoid, fixes #7362
This makes borg2's new crypto do the same check as borg1's old crypto
and makes sure that no chunks created by an evil borg client would
go unnoticed.
2023-02-19 21:14:20 +01:00
TW
93a4bd61f8
Merge pull request #7360 from voegelas/fedora-package-url
Installation: Update Fedora in distribution list
2023-02-17 14:32:34 +01:00
Andreas Vögele
4b18980768 Installation: Update Fedora in distribution list
Fixes #7357
2023-02-16 18:27:48 +01:00
TW
3849ebe312
Merge pull request #7349 from ThomasWaldmann/avoid-orphan-content-chunks3
avoid orphan content chunks (master)
2023-02-14 00:01:50 +01:00
Thomas Waldmann
71f8dd3a17
FilesystemObjectProcessors.process_pipe: also add same exception handler there 2023-02-13 20:46:48 +01:00
Thomas Waldmann
c9dbe323e3
TarfileObjectProcessors.process_file: also add same exception handler there 2023-02-13 20:46:46 +01:00
Thomas Waldmann
d0c61bbbf1
FilesystemObjectProcessors.process_file: clean up orphaned chunks in case of exceptions
Note: no changes inside the indented block,
just added the try and the except block.
2023-02-13 20:46:45 +01:00
Thomas Waldmann
f1981715e4
2nd+ hardlinks: add to item.chunks after incref'ing
we do book-keeping in item.chunks:
in case something goes wrong and we need to clean up,
we will have a list with chunks to decref in item.chunks.

also:
- make variable naming more consistent
- cosmetic changes
2023-02-13 20:46:21 +01:00
Thomas Waldmann
5cb3a17796
Revert "avoid orphan content chunks on BackupOSError, fixes #6709"
This reverts commit ffe32316a5.
2023-02-13 18:24:28 +01:00
TW
6cfe77ebaf
Merge pull request #7350 from ThomasWaldmann/testing-chunker
implement "fail" chunker for testing purposes
2023-02-13 18:17:56 +01:00
Thomas Waldmann
11fd6afb0f
use "fail" chunker to test erroneous input file skipping
if a file can't be read (like here: there is a simulated
I/O error in the 2nd chunk of file2), it should be logged
with "E" status, skipped and backup shall proceed with
next file(s).

also, check that the repo has no orphan chunks (exception
handling code needs to deal with 1st chunk of file2 which
already has been written / incref'd in the repo).
2023-02-13 17:19:49 +01:00
Thomas Waldmann
7f973a5b34
implement "fail" chunker for testing purposes
--chunker-params=fail,4096,rrrEErrrr means:
- cut chunks of 4096b fixed size (last chunk in a file can be less)
- read chunks 0, 1 and 2 successfully
- error at chunk 3 and 4 (simulated OSError(errno.EIO))
- read successfully again for the next 4 chunks

Chunks are counted inside the chunker instance, starting
from 0, always increasing while the same instance is used.

Read chunks as well as failed chunks count up by 1.
2023-02-13 17:15:45 +01:00
TW
52040bc043
Merge pull request #7347 from jdchristensen/hashindex_compact
Make hashindex_compact simpler and probably faster
2023-02-12 17:01:18 +01:00
Dan Christensen
3daf7e186d testsuite/hashindex.py: add comments about validity of hashtables 2023-02-12 09:39:07 -05:00
TW
ee7fee75fc
Merge pull request #7345 from ThomasWaldmann/update-changes
update CHANGES
2023-02-12 14:56:18 +01:00
Dan Christensen
c705c8573d testsuite/hashindex.py: add a few more tests 2023-02-12 08:28:14 -05:00
Dan Christensen
8eff0b2f02 _hashindex.c: fix comment 2023-02-12 08:24:27 -05:00
Dan Christensen
2f9f22e2a8 hashindex.py: make black happy 2023-02-11 20:33:07 -05:00
Dan Christensen
36aa395e49 _hashindex.c: set min_empty and num_empty even when permit_compact=True 2023-02-11 20:11:09 -05:00
Dan Christensen
60bea46eb7 _hashindex.c: rewrite hashindex_compact 2023-02-11 20:10:02 -05:00
Dan Christensen
6f5efb3f74 testsuite/hashindex.py: create and use compare_compact to avoid repetition 2023-02-11 20:06:38 -05:00
Dan Christensen
d3fd93f82b testsuite/hashindex.py: use compare_indexes in one more spot 2023-02-11 19:53:28 -05:00
Dan Christensen
cc78ef8939 testsuite/hashindex.py: add two more tests 2023-02-11 19:44:56 -05:00
Dan Christensen
6aa53a5627 hashindex_pytest.py: add test_hashindex_compact_stress 2023-02-11 19:13:20 -05:00
Dan Christensen
51b29ab426 hashindex.py: make .compact tests independent of order 2023-02-11 17:37:53 -05:00
Dan Christensen
133ffebc8d hashindex_pytest.py: factor out verify_hash_table 2023-02-11 17:37:20 -05:00
Thomas Waldmann
b42d2bf6dd
update CHANGES 2023-02-11 18:56:30 +01:00
TW
6db21fa330
Merge pull request #7344 from RayyanAnsari/parseformat-rm-hack
parseformat: remove Windows-specific hack
2023-02-11 18:23:47 +01:00
TW
098fca7861
Merge pull request #7343 from ThomasWaldmann/timestamp-comparisons-master
relaxed timestamp comparisons (master)
2023-02-11 18:15:02 +01:00
Rayyan Ansari
03a27654e0 parseformat: remove Windows-specific hack
This fixes the rest of the tests.
2023-02-11 16:32:19 +00:00
Thomas Waldmann
aee17a87e2
tests: use same_ts_ns for all timestamp comparisons 2023-02-11 17:08:56 +01:00
TW
d90ebc8bef
Merge pull request #7340 from ThomasWaldmann/fix-recreate-rechunkify-master
recreate: --chunker-params must default to None, fixes #7337
2023-02-11 14:11:03 +01:00
TW
ce04521a9a
Merge pull request #7333 from ThomasWaldmann/excluded-included-status-chars
better included/excluded status chars, docs, fixes #7321
2023-02-11 13:48:43 +01:00
TW
f39d1bcd7b
Merge pull request #7334 from ThomasWaldmann/list-progress-json-is-nice
allow mixing --progress and --list in log-json mode
2023-02-11 13:42:59 +01:00
Thomas Waldmann
2ef09eaa77
same_ts_ns: add a timestamp comparison function
also: HAVE_UTIMES means 1us resolution (*)

(*) at least as far as the utimes() call is concerned.

Whether there are other limitations has to be seen.
2023-02-11 01:19:01 +01:00
TW
b233dbb4db
Merge pull request #7339 from ThomasWaldmann/test-dir-mtime-master
add test for extracted directory mtime (master)
2023-02-11 01:13:32 +01:00
Thomas Waldmann
ce5f1589ea
recreate: --chunker-params must default to None, fixes #7336
also add a test: recreate without --chunker-params shall not rechunk

before the fix, it triggered rechunking if an archive
was created with non-default chunker params.

but it only should rechunk if borg recreate is invoked with explicitly giving --chunker-params=....
2023-02-11 01:08:01 +01:00
Thomas Waldmann
fdc48fdd1b
more directory timestamp tests 2023-02-11 00:42:30 +01:00
Thomas Waldmann
a42cd161de
add test for extracted directory mtime 2023-02-11 00:29:57 +01:00
Thomas Waldmann
ff564de1cc
allow mixing --progress and --list in log-json mode 2023-02-10 01:45:59 +01:00
Thomas Waldmann
303c474f21
better included/excluded status chars, docs, fixes #7321
more consistent now between dry-run and non-dry-run mode.

--filter=... users might need to update the status chars they filter for.
2023-02-10 01:13:21 +01:00
TW
366731ba00
Merge pull request #7300 from RayyanAnsari/borg-platformdirs
use platformdirs
2023-02-10 00:09:44 +01:00
TW
16f4bf5d7b
Merge pull request #7328 from ThomasWaldmann/hashindex-compact
hashindex minor fixes, tweaks, tests
2023-02-09 22:46:48 +01:00
Thomas Waldmann
3d57dc0590
hashindex: add tests, misc. minor fixes/changes
test hashtable expansion/rebuild.

hashindex_lookup:
- return -2 for a compact / completely full hashtable
- return -1 and (via start_idx pointer) the deleted/tombstone bucket index.

fix size assertion (we add 1 element to trigger rebuild)

fix upper_limit check - since we'll be adding 1 to num_entries below,
the condition should be >=:

hashindex_compact: set min_empty/upper_limit

Co-authored-by: Dan Christensen <jdc+github@uwo.ca>
2023-02-09 22:14:07 +01:00
Thomas Waldmann
1ed8ac0408
hashindex_pytest: move hashtable create into separate function 2023-02-09 21:58:40 +01:00
Thomas Waldmann
e556233e30
hashindex_pytest: add a comment 2023-02-09 21:58:37 +01:00
Thomas Waldmann
4c2af9fb96
renamed hashindex_stress -> hashindex_pytest 2023-02-09 21:58:23 +01:00
TW
79d6835738
Merge pull request #7331 from ThomasWaldmann/undefine-ndebug-master
undef NDEBUG for chunker and hashindex
2023-02-09 21:52:20 +01:00
Thomas Waldmann
311ac55ebd
undef NDEBUG for chunker and hashindex
note:
intentionally not undef'ing it for all the cython-only generated C code.
2023-02-09 21:01:03 +01:00
TW
2b2586a098
Merge pull request #7330 from ThomasWaldmann/update-codecov
upgrade codecov-action to v3
2023-02-09 20:37:27 +01:00
Thomas Waldmann
142eb65223
upgrade codecov-action to v3 2023-02-09 18:46:36 +01:00
TW
406da3d419
Merge pull request #7325 from ThomasWaldmann/hashtable-fixes-master
hashindex bugfix and refactoring (master)
2023-02-08 23:53:24 +01:00
Thomas Waldmann
316bb7c937
add num_entries assertion 2023-02-08 22:45:11 +01:00
Thomas Waldmann
b79766a933
hashindex: simplify size_idx function
Thanks to @jdchristensen for the code.
2023-02-08 22:11:49 +01:00
Thomas Waldmann
a13d53ec1e
Simplify full HT scan assertion 2023-02-08 22:11:47 +01:00
Thomas Waldmann
4fc7815f11
hashindex: always have at least 1 empty bucket
avoid rounding / integer conversion issues bringing this down to 0.
2023-02-08 22:11:44 +01:00
Thomas Waldmann
4f8c4aea19
implement ht idx wrap around less strangely, add comment 2023-02-08 22:11:43 +01:00
Thomas Waldmann
907da00931
if HT is full with entries and tombstones: give up/fail early 2023-02-08 22:11:41 +01:00
Thomas Waldmann
0098ac9e63
more comments for hashindex_lookup 2023-02-08 22:11:34 +01:00
Thomas Waldmann
9bf352d00c
bugfix: do not resize hashindex with wrong num_empty
otherwise we would lose the decrement operation on num_empty.
2023-02-08 22:10:50 +01:00
TW
070c260460
Merge pull request #7327 from RayyanAnsari/pyinstaller-no-icon
pyinstaller: remove icon
2023-02-08 19:09:17 +01:00
Rayyan Ansari
37e958bfa4
pyinstaller: remove icon
Remove pyinstaller's default executable icon by setting it to the string 'NONE'.

While we're at it, update a comment.
2023-02-08 17:53:33 +00:00
Thomas Waldmann
83e6b4269e
hashindex: simplify assert 2023-02-08 16:25:15 +01:00
Thomas Waldmann
c9573c04ac
_hashindex: easier to understand code, dubious loops removed, asserts
hashindex_index returns the perfect hashtable index, but does not
check what's in the bucket there, so we had these loops afterwards
to search for an empty or deleted bucket.

problem: if the HT were completely filled with no empty and no deleted
buckets, that loop would never end. due to our HT resizing, it can
never happen, but still not pretty.

when using hashindex_lookup (as also used some lines above), the code
is easier to understand, because (after we resized the HT), we freshly
create the same situation as after the first call of that function:
- return value < 0, because we (still) can not find the key
- start_idx will point to an empty bucket

Thus, we do not need the problematic loops we had there.

Modified the checks to make sure we really have an empty or deleted
bucket before overwriting it with data.

Added some additional asserts to make sure the code behaves.
2023-02-08 14:51:54 +01:00
TW
978cb163e6
Merge pull request #7324 from ThomasWaldmann/hashtable-stresstests-master
add hashtable stress tests
2023-02-08 14:48:58 +01:00
Thomas Waldmann
3e33656238
add comment about how to provoke more collisions 2023-02-08 02:13:14 +01:00
Thomas Waldmann
9697f55534
add hashtable stress tests
Using NSIndex (repo index) HashIndex, but they all are very similar.
2023-02-08 01:53:30 +01:00
Thomas Waldmann
516c070c7c
fix tests for platformdirs 3.x.x 2023-02-07 21:14:16 +01:00
TW
653c051851
Merge pull request #7323 from ThomasWaldmann/coala-updates
coala: remove PEP8Bear
2023-02-06 23:40:52 +01:00
Thomas Waldmann
f29ff128fb
require 3.x.x releases of platformdirs
we don't want to suddenly/unexpectedly break stuff for borg users
just because platformdirs does a breaking release.

at platformdirs 2.0.0 macOS config dir changed.
at platformdirs 3.0.0 macOS config dir changed again.
at platformdirs 4.0.0 (future) - who knows?
2023-02-06 23:24:56 +01:00
Thomas Waldmann
de275fc8db
coala: remove PEP8Bear
it's not always happy with what black does.
2023-02-05 20:59:43 +01:00
TW
a3bdae65ac
Merge pull request #7322 from ThomasWaldmann/update-changes
update CHANGES
2023-02-05 00:06:11 +01:00
Thomas Waldmann
55af2933fb
update CHANGES 2023-02-04 20:43:50 +01:00
Thomas Waldmann
d9875a4d7e
improve test_get_security_dir 2023-02-04 18:23:35 +01:00
Thomas Waldmann
078bb7ee02
improve test_get_keys_dir 2023-02-04 18:19:15 +01:00
Thomas Waldmann
6ab424598d
improve test_get_cache_dir 2023-02-04 18:17:43 +01:00
Thomas Waldmann
4bacd0b722
improve test_get_config_dir 2023-02-04 18:15:57 +01:00
Thomas Waldmann
bb73e8682f
fix win2 typo 2023-02-04 18:11:28 +01:00
Thomas Waldmann
499e5133b5
test_config_dir_compat: don't test on win32
there is no old borg < 2.0 there anyway.
2023-02-04 01:18:16 +01:00
Thomas Waldmann
bde0f11e1e
get_security_dir: legacy=False default 2023-02-04 00:35:04 +01:00
Thomas Waldmann
1d4810af23
get_keys_dir: legacy=False default 2023-02-04 00:35:03 +01:00
Thomas Waldmann
b06dd1c66c
get_config_dir: legacy=False default 2023-02-04 00:35:01 +01:00
Thomas Waldmann
ebcda6f0a5
get_cache_dir: legacy=False default 2023-02-04 00:34:57 +01:00
Thomas Waldmann
424be763b2
get_base_dir: legacy=False default 2023-02-04 00:34:54 +01:00
Thomas Waldmann
81595a9ca0
conftest.py: use BORG_BASE_DIR to redirect borg testing .config/.cache into a temp dir
XDG_*_HOME is not honoured on macOS and on Windows if we use platformdirs.
2023-02-04 00:34:52 +01:00
Thomas Waldmann
fddf6afded
get_*_dir: make legacy=... kwarg only
it's better readable.
2023-02-04 00:34:45 +01:00
Thomas Waldmann
437b5fa859
do not fail on macOS due to different dirs from platformdirs 2023-02-04 00:34:42 +01:00
Thomas Waldmann
8379ecefaa
deal with BORG_BASE_DIR 2023-02-04 00:34:26 +01:00
Thomas Waldmann
d3d909ad31
add compatibility test: legacy vs. non-legacy platformdirs 2023-02-03 18:22:51 +01:00
Rayyan Ansari
6c7efbe128
add platformdirs to dependencies 2023-02-03 17:46:56 +01:00
Rayyan Ansari
f2452aef2a
helpers: use platformdirs on win32 2023-02-03 17:46:49 +01:00
TW
7ffd87739b
Merge pull request #7320 from ThomasWaldmann/transfer-progress
Transfer progress
2023-02-03 03:06:32 +01:00
Thomas Waldmann
7ad25ba9e2
transfer: support --progress 2023-02-03 02:10:29 +01:00
TW
63a0b3bed4
Merge pull request #7310 from ThomasWaldmann/avoid-orphan-content-chunks2
avoid orphan content chunks on BackupOSErrors
2023-02-03 02:08:49 +01:00
TW
c96c5652b0
Merge pull request #7317 from pgerber/hanging-test
Fix test hanging reading FIFO when `borg create` failed
2023-02-03 01:59:15 +01:00
Thomas Waldmann
ffe32316a5
avoid orphan content chunks on BackupOSError, fixes #6709
if we run into some issue reading an input file, e.g. an I/O error,
the BackupOSError exception raised due to that will skip the current
file and no archive item will be created for this file.

But we maybe have already added some of its content chunks to the repo,
we have either written them as new chunks or incref'd some identical chunk
in the repo.

Added an exception handler that decrefs (and deletes if refcount reaches 0)
these chunks again before re-raising the exception, so the repo is in a
consistent state again and we do not have orphaned content chunks in the repo.
2023-02-03 01:35:12 +01:00
TW
9b7647c89d
Merge pull request #7309 from ThomasWaldmann/no-part-files-in-final-archive
remove part files from final archive
2023-02-03 01:33:47 +01:00
Peter Gerber
8ce3d22358 Fix test hanging reading FIFO when borg create failed 2023-02-02 00:44:08 +01:00
TW
f25f6a8e33
Merge pull request #7315 from ThomasWaldmann/pythonioencoding
document another way to get UTF-8 encoding on stdin/stdout/stderr, fixes #2273
2023-02-02 00:35:21 +01:00
TW
6d53cd0365
Merge pull request #7316 from ThomasWaldmann/gh-fixed-black-version
fix black versions be 23.x
2023-02-02 00:34:08 +01:00
Thomas Waldmann
f65a6b197a
fix black versions be 23.x
https://black.readthedocs.io/en/stable/integrations/github_actions.html
2023-02-01 16:04:39 +01:00
Thomas Waldmann
856d98c72f
document another way to get UTF-8 encoding on stdin/stdout/stderr, fixes #2273 2023-02-01 15:32:29 +01:00
Thomas Waldmann
d2cc167afd
borg transfer: drop part files 2023-02-01 13:04:19 +01:00
Thomas Waldmann
b92f4aa487
remove --consider-part-files, related stats code, update docs
we now just treat that one .borg_part file we might have inside
checkpoint archives as a normal file.

people can recognize via the file name it is a partial file.

nobody cares for statistics of checkpoint files and the final
archive now does not contain any partial files any more, thus
no needs to maintain statistics about count and size of part
files.
2023-02-01 13:04:18 +01:00
Thomas Waldmann
0fed44110a
remove part files from final archive
checkpoint archives might have a single, incomplete part file as last item.
part files are always a prefix of the full file, growing in size from
checkpoint to checkpoint.

we now manage the archive items metadata stream in a special way:
- checkpoint archive A(n) might end with a partial item PI(n)
- checkpoint archive A(n+1) does not contain PI(n)
- checkpoint archive A(n+1) contains a new partial item PI(n+1)
- the final archive does not contain any partial items
2023-02-01 13:04:12 +01:00
TW
4515884af5
Merge pull request #7314 from ThomasWaldmann/newer-black
use latest "black"
2023-02-01 13:02:41 +01:00
Thomas Waldmann
a0330d578e
run black 23.1.0 on the code 2023-02-01 12:30:37 +01:00
Thomas Waldmann
96862787db
upgrade black to 23.1.0
work around the current github actions issue by just using the latest version:

https://github.com/psf/black/issues/3538
2023-02-01 12:29:54 +01:00
Michael Deyaso
8af9eb47c2
Added date-matching support for list_considering (#7306)
added date-matching support for list_considering, fixes #7296

Co-authored-by: Michael Deyaso <mdeyaso@fusioniq.io>
2023-02-01 11:32:53 +01:00
TW
8046d6f575
Merge pull request #7311 from ThomasWaldmann/fix-mac-birthtime-test-fail
tests: relax birthtime assertion, fixes #7308
2023-02-01 11:25:55 +01:00
Thomas Waldmann
e019487166
tests: relax birthtime assertion, fixes #7308 2023-02-01 01:59:41 +01:00
TW
d0344cb8f8
Merge pull request #7305 from ThomasWaldmann/volume-based-checkpointing
volume based checkpointing, fix item_ptrs orphaned chunks
2023-01-31 16:48:49 +01:00
TW
2472b1c63f
Merge pull request #7303 from ThomasWaldmann/fix-pyi
mypy inspired fixes / updates
2023-01-31 15:46:20 +01:00
Thomas Waldmann
15d1bc0c49
fix checkpointing: add item_ptrs chunks cleanup
not having this had created orphaned item_ptrs chunks for checkpoint archives.

also:
- borg check: show id of orphaned chunks
- borg check: archive list with explicit consider_checkpoints=True (this is the default, but better make sure).
2023-01-31 14:40:41 +01:00
Thomas Waldmann
7e31fab754
cleanup: remove Archive.checkpoint_interval (not used)
checkpoint_interval and checkpoint_volume are only needed for
the ChunksProcessor.
2023-01-31 04:01:39 +01:00
Thomas Waldmann
56b6f1d2e0
create/recreate/import-tar: add --checkpoint-volume option
volume based checkpointing is easier to test than its time based cousin.

also added first checkpointing test.
2023-01-31 04:01:37 +01:00
Thomas Waldmann
2705ccb59b
key storage: type hints / cleanup 2023-01-30 18:08:05 +01:00
Thomas Waldmann
360cd8488f
micro-opt: construct borg1_header_fmt Struct only once 2023-01-30 17:56:05 +01:00
Thomas Waldmann
e772d70e05
cleaner FileLikeWrapper with own __init__ 2023-01-30 15:54:56 +01:00
Thomas Waldmann
9740767449
fix bug in obfuscated data upgrade code 2023-01-30 15:54:54 +01:00
Thomas Waldmann
f9078ebfa9
FlexiKey: define STORAGE in base class
avoids some mypy warnings.
2023-01-30 15:54:52 +01:00
Thomas Waldmann
a863249394
fs.py: fix bug in f-string - thanks mypy! 2023-01-30 15:54:50 +01:00
Thomas Waldmann
90a9a124d4
*.pyi: fix types, add missing attrs 2023-01-30 15:54:48 +01:00
TW
77977d988a
Merge pull request #7295 from ThomasWaldmann/refactor
refactor / cosmetic changes / help improved
2023-01-23 15:58:56 +01:00
Thomas Waldmann
5b28674a99
--newer/older/newest/oldest: rephrase help a bit 2023-01-23 15:27:27 +01:00
Thomas Waldmann
61904dd683
ArchiveChecker.check: reorder args, make most kwargs-only 2023-01-23 15:18:11 +01:00
Thomas Waldmann
60ebd1d2b0
Archives.list: reorder args 2023-01-23 15:11:53 +01:00
Michael Deyaso
b2654bc17d
Support for date-based matching during archive listing (#7272)
check --archives: add --newer/--older/--newest/--oldest, fixes #7062

Options accept a timespan, like Nd for N days or Nm for N months.

Use these to do date-based matching on archives and only check some of them,
like: borg check --archives --newer=1m --newest=7d

Author: Michael Deyaso <mdeyaso@fusioniq.io>
2023-01-23 15:00:05 +01:00
TW
73e0f8b6b8
Merge pull request #7289 from ThomasWaldmann/command_line-one-str
ArchiveItem.cmdline list-of-str -> .command_line str, fixes #7246
2023-01-22 14:12:21 +01:00
Thomas Waldmann
bf667170a7
ArchiveItem.cmdline list-of-str -> .command_line str, fixes #7246
Same change for .recreate_cmdline -> .recreate_command_line .

JSON output key "command_line":
borg 1.x: sys.argv [list of str]
borg 2: shlex.join(sys.argv) [str]
2023-01-20 00:19:00 +01:00
TW
ccbfc4ee95
Merge pull request #7287 from ThomasWaldmann/fix-get-item-uid-gid-win32
fix some uid/gid lookup code / tests for win32
2023-01-19 21:48:47 +01:00
TW
4a94097193
Merge pull request #7288 from ThomasWaldmann/host-user-group-names-encoding
hostname / username encoding
2023-01-19 21:48:28 +01:00
Thomas Waldmann
249189e04e
refactor: reuse code from remove_surrogates 2023-01-19 20:58:58 +01:00
Thomas Waldmann
b3da7d0e72
make sure hostname and username have no surrogate escapes
if they are present, process them through json_text().
this replaces s-e by "?" for the key and puts the binary
representation into key_b64, if needed.

likely this is rarely needed.
2023-01-19 20:46:40 +01:00
Thomas Waldmann
7ab39f9d42
make the user2uid/group2gid win32 hack behave more like the real code (e.g. posix)
The code relies on them returning the default value (usually
None), if we call user2uid(None) or group2gid(None) (same for
empty string).
2023-01-19 20:07:38 +01:00
Thomas Waldmann
7bd8e924eb
win32: omit some tests with non-existing user/group names
see comment in the code, they currently can't succeed.
2023-01-19 20:07:37 +01:00
TW
d090826a37
Merge pull request #7285 from ThomasWaldmann/display-localtime
use local time / local timezone to output timestamps, fixes #7283
2023-01-19 18:38:16 +01:00
Thomas Waldmann
9460da42d1
use local time / local timezone to output timestamps, fixes #7283
"ls" and also "tar" show timestamps as local time.
borg now does the same, but also shows the local tzoffset.

this also affects JSON output.
2023-01-19 03:36:46 +01:00
TW
be1048abfe
Merge pull request #7277 from jdchristensen/chunks-cache-output
cache.py: be less verbose during cache sync
2023-01-19 02:45:50 +01:00
TW
48122f9b8b
Merge pull request #7279 from ThomasWaldmann/os-replace-master
use os.replace
2023-01-19 02:45:09 +01:00
Thomas Waldmann
1843990172
use os.replace rather than os.rename
more consistent behaviour on all OSes, incl. windows.
2023-01-19 01:57:03 +01:00
TW
8e012be3fa
Merge pull request #7264 from ThomasWaldmann/fix-locking-win32-master
Fix locking (win32, master)
2023-01-19 01:56:20 +01:00
Dan Christensen
530bd4c298 cache.py: consistenly use "chunks index" 2023-01-18 19:51:01 -05:00
TW
57e0579cf8
Merge pull request #7284 from ThomasWaldmann/prune-in-localtime
fix prune tests, prune in localtime
2023-01-19 01:31:49 +01:00
Thomas Waldmann
2b1303d280
docs: pruning interprets timestamps in the local timezone where borg prune runs 2023-01-19 01:04:49 +01:00
Thomas Waldmann
0e577452c2
tests: fix prune_split tests by giving the timestamps in local timezone
Guess this fixes issues like #5535.

I tested this with TZ=:
- UTC
- UTC+12
- UTC-12
- UTC+14
- UTC-14
2023-01-19 00:52:27 +01:00
Dan Christensen
6f7bc89627 cache.py: minor updates to output 2023-01-18 16:59:44 -05:00
Thomas Waldmann
8a2fd39212
Revert "prune: compute pruning in utc timezone"
This reverts commit 860a48049b.
2023-01-18 22:41:40 +01:00
TW
4664176e87
Merge pull request #7282 from ThomasWaldmann/prune-in-utc
prune: compute pruning in utc timezone
2023-01-18 18:58:09 +01:00
Thomas Waldmann
860a48049b
prune: compute pruning in utc timezone
guess this fixes issues like #5535.

i tested this with TZ=:
- UTC
- UTC+1 (my current local timezone)
- UTC+12
- UTC-12
- UTC+14
2023-01-18 18:27:15 +01:00
TW
c8fe49dcb7
Merge pull request #7276 from ThomasWaldmann/symlink-target
Item: symlinks: rename .source to .target, fixes #7245
2023-01-18 17:05:25 +01:00
TW
0fa2506b92
Merge pull request #7280 from ThomasWaldmann/shellpattern-license-master
shellpattern: add license, use copyright/license markup
2023-01-18 16:46:22 +01:00
Thomas Waldmann
88b9868159
shellpattern: add license, use copyright/license markup 2023-01-18 15:45:13 +01:00
Helmut Grohne
f2f761212d
update bash completion script commands and options (#7273)
update bash completion script commands and options
2023-01-18 14:10:29 +01:00
Thomas Waldmann
c3d0c525f9
locking: get out of kill_stale_lock more quickly if directory does not exist. 2023-01-18 13:44:51 +01:00
Thomas Waldmann
9ba249b482
use for loop 2023-01-18 13:42:39 +01:00
Dan Christensen
7dad4a6992 cache.py: be less verbose during cache sync 2023-01-17 15:21:18 -05:00
Thomas Waldmann
1672aee031
Item: symlinks: rename .source to .target, fixes #7245
Also, in JSON:
- rename "linktarget" to "target" for symlinks
- remove "source" for symlinks
2023-01-16 20:28:25 +01:00
TW
1df7c244c4
Merge pull request #7270 from ThomasWaldmann/user-group-uid-gid
make user/group/uid/gid optional
2023-01-16 18:53:15 +01:00
TW
9b067fd1f7
Merge pull request #7275 from ThomasWaldmann/docs-key-change-passphrase
key change-passphrase: fix --encryption value in examples
2023-01-16 18:18:06 +01:00
Thomas Waldmann
18898d68f0
export-tar: for items w/o uid/gid, default to 0/0, see #7249 2023-01-16 18:17:17 +01:00
Thomas Waldmann
ff545033e3
tests: do not look up uid 0 / gid 0, but current process uid/gid
some systems do not have uid/gid 0 (windows).
2023-01-16 18:17:15 +01:00
Thomas Waldmann
4dcc48f5c4
extract: chown only if we have u/g info in archived item, see #7249
also: move get_item_uid_gid() to "not is_win32" block for now.
2023-01-16 18:17:13 +01:00
Thomas Waldmann
1f9c46f2b5
create: do not store user/group for stdin data by default, see #7249
if you want user/group stored, give --stdin-user=USER / --stdin-group=GROUP.
2023-01-16 18:17:12 +01:00
Thomas Waldmann
b338eb0ce8
process_pipe: allow creating item w/o user/group/uid/gid, see #7249 2023-01-16 18:17:09 +01:00
Thomas Waldmann
262812e76f
get_item_data: do not require item.uid/gid, see #7249
if uid is not present, use None.
if gid is not present, use None.
2023-01-16 18:17:03 +01:00
Thomas Waldmann
4f9cda1aab
get_item_uid_gid: do not require item.uid/gid, see #7249
if uid is not present, fall back to uid_default.
if gid is not present, fall back to gid_default.
2023-01-16 18:12:34 +01:00
TW
d49665526c
Merge pull request #7232 from ThomasWaldmann/json_b64
implement and use (text|binary)_to_json
2023-01-16 18:10:52 +01:00
Thomas Waldmann
54892f711d
key change-passphrase: fix --encryption value in examples
"repokey" (as in borg < 2.0, referring to the AES-CTR mode)
does not exist any more and was superseded by other repokey-*
modes.
2023-01-16 17:58:50 +01:00
Thomas Waldmann
491f898612
borg2 archive names and comments are always pure unicode 2023-01-16 17:45:48 +01:00
Thomas Waldmann
8765e62bcd
document how borg deals with non-unicode bytes in JSON output 2023-01-16 17:45:46 +01:00
Thomas Waldmann
e63cfcd708
json output: use text_to_json, fixes #6151
item: path, source, user, group

for non-unicode stuff borg 1.2 had "bpath".

now we have:
path - unicode approximation (invalid stuff replaced by ?)
path_b64 - base64(path_bytes)  # only if needed

source has the same issue as path and is now covered also.

user and group are usually unicode or even pure ASCII,
but we rather are cautious and cover them also.
2023-01-16 17:45:34 +01:00
Thomas Waldmann
32d430a1b0
implement text_to_json / binary_to_json, see #6151
binary bytes:
- json_key = <key>_b64
- json_value == base64(value)

text (potentially with surrogate escapes):
- json_key1 = <key>
- json_value1 = value_text (s-e replaced by ?)
- json_key2 = <key>_b64
- json_value2 = base64(value_binary)

json_key2/_value2 is only present if value_text required
replacement of surrogate escapes (and thus does not represent
the original value, but just an approximation).
value_binary then gives the original bytes value (e.g. a
non-utf8 bytes sequence).
2023-01-16 17:45:27 +01:00
TW
3992c1c333
Merge pull request #7267 from ThomasWaldmann/recreate-with-target-master
recreate: when --target is given, do not detect "nothing to do"
2023-01-16 17:23:38 +01:00
Thomas Waldmann
aa78314ffe
recreate: when --target is given, do not detect "nothing to do"
use case:

borg recreate -a src --target dst can be used to make a copy
of an archive inside the same repository, see #7254.
2023-01-14 19:05:50 +01:00
Thomas Waldmann
6a3aa23f9b
locking (win32): deal with os.rmdir PermissionErrors
Retry if access is denied.
2023-01-13 22:50:41 +01:00
Thomas Waldmann
7063c2abec
locking (win32): deal with os.listdir PermissionErrors
due to unclear circumstances, windows sometimes just says "PermissionError" when trying to list a directory.
2023-01-13 22:50:13 +01:00
Thomas Waldmann
0ce2b55031
fix host, pid, tid order
using "differenthost" (== not the current hostname) makes
the process_alive check always return True (to play safe,
because in can not check for processes on other hosts).
2023-01-13 22:48:19 +01:00
Thomas Waldmann
e1bb669400
use os.replace not os.rename 2023-01-13 22:48:17 +01:00
Thomas Waldmann
163e92dd04
bugfix: thread id must be parsed as hex from lock file name 2023-01-13 22:48:14 +01:00
TW
ca1f1281d5
Merge pull request #7262 from ThomasWaldmann/skip-safe-unlink-test-windows
support win32 for test_safe_unlink* tests
2023-01-13 22:41:54 +01:00
Thomas Waldmann
829d88e614
win32 ci: show individual tests, give skip reason if tests were skipped 2023-01-13 21:01:05 +01:00
Thomas Waldmann
38152c8e5d
safe_unlink tests: use os.link to support win32 also
also:
- add note about mklinkto
- skip tests based on "not are_hardlinks_supported()" if needed
2023-01-13 20:59:30 +01:00
TW
7fb37271f2
Merge pull request #7258 from RayyanAnsari/windows-ci-tests
Add tests to Windows CI
2023-01-13 18:43:21 +01:00
TW
0d78565382
Merge pull request #7263 from helmutg/cleanup
delete left over documentation for borg key change-algorithm
2023-01-13 18:09:41 +01:00
Rayyan Ansari
b19d2c1449
Add tests to Windows CI 2023-01-13 17:02:41 +00:00
Helmut Grohne
e210c6c053 delete left over documentation for borg key change-algorithm 2023-01-13 13:20:49 +01:00
TW
fb9717567e
Merge pull request #7251 from puetzk/test_size_on_disk_accurate-flush
Fix test_size_on_disk_accurate for large st_blksize, fixes #7250
2023-01-13 10:49:41 +01:00
TW
c8809ab09d
Merge pull request #7260 from jsoref/spelling
Spelling
2023-01-12 18:47:18 +01:00
Josh Soref
a205c4273b spelling: zstandard
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 11:24:05 -05:00
Josh Soref
0958d94791 spelling: vagrant
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 11:24:05 -05:00
Josh Soref
a3af1ffc32 spelling: trade-offs
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 11:24:04 -05:00
Josh Soref
f41cf1c25f spelling: requirements
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 09:36:03 -05:00
Josh Soref
c9848e9814 spelling: nonexistent
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 09:36:03 -05:00
Josh Soref
a26c1d99d9 spelling: new
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 09:36:03 -05:00
Josh Soref
6e7f593b98 spelling: healthy
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 09:36:03 -05:00
Josh Soref
6266ba8891 spelling: github
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 00:24:42 -05:00
Kevin Puetz
079d9256ee Fix test_size_on_disk_accurate for large st_blksize, fixes #7250
python's io.BufferedWriter sizes its buffer based on st_blksize.
If the write fits in this buffer, then it's possible the data from
idx.write() has not been flushed through to ,the underlying filesystem,
and getsize(fileno()) sees a too-short (or even empty) file.

Also, getsize is only documented as accepting path-like objects;
passing a fileno seems to work only because the implementation
blindly forwards everything through to os.stat without checking.

Passing unopened_tempfile avoids all three problems
- on windows, it doesn't rely on re-opening NamedTemporaryFile
  (the issue which led to cc0ad321dc)
- we're following the documented API of getsize(path-like)
- the file is closed (thus flushed) inside idx.write, before getsize()
2023-01-11 19:20:16 -06:00
TW
e74b42920c
Merge pull request #7257 from ThomasWaldmann/docs-libb2-master
remove BORG_LIBB2_PREFIX (not used any more)
2023-01-10 14:24:51 +01:00
Thomas Waldmann
43cbe6d8b6
remove BORG_LIBB2_PREFIX (not used any more)
the code now uses hashlib.blake2b from python stdlib.
2023-01-10 14:10:34 +01:00
TW
daf890ebfa
Merge pull request #7243 from ThomasWaldmann/macos-resourcefork-mtime-master
extract: fix mtime when ResourceFork xattr is set (macOS specific)
2023-01-06 22:25:42 +01:00
Thomas Waldmann
5d8801e72c
macOS: fix mtime timestamp extraction if ResourceFork xattr is present, fixes #7234
setting the timestamps after xattrs helps for correct mtime,
but atime is still broken in this case.
2023-01-06 21:58:35 +01:00
Thomas Waldmann
6a27c6b763
macOS: test correct timestamp extraction if ResourceFork xattr is present, see #7234 2023-01-06 21:58:33 +01:00
TW
9d4646ce72
Merge pull request #7241 from ThomasWaldmann/upgrade-cython-master
upgrade Cython to 0.29.33
2023-01-06 21:55:49 +01:00
Thomas Waldmann
99c175e0bf
upgrade Cython to 0.29.33 2023-01-06 00:29:16 +01:00
TW
efea85cbf6
Merge pull request #7240 from ThomasWaldmann/update-docs
update usage docs and man pages
2023-01-03 04:53:16 +01:00
Thomas Waldmann
ac1df899aa
build_man 2023-01-03 00:37:04 +01:00
Thomas Waldmann
b5ff043ac1
build_usage 2023-01-03 00:36:59 +01:00
Thomas Waldmann
fecf20e529
man pages: more "see also" 2023-01-03 00:36:57 +01:00
TW
3bc2182f12
Merge pull request #7236 from ThomasWaldmann/update-changes-master
update CHANGES
2023-01-02 13:16:51 +01:00
Franco Ayala
cd68f71d07
Fix query quota (#7237)
rinfo: added support for --iec

also: added a missing \n to the generated output
2022-12-31 21:11:23 +01:00
Thomas Waldmann
36f5e66df0
update CHANGES 2022-12-30 15:46:58 +01:00
TW
ed6dcbebb1
Merge pull request #7233 from systemcrash/spfix
Docs and comments consistency and readability improvement
2022-12-30 15:13:17 +01:00
Paul D
991b53ebea Misc fixes. 2022-12-29 22:26:55 +00:00
Paul D
949dc51156 Rewrite for quickstart 2022-12-29 22:26:55 +00:00
Paul D
8ada680c87 'Want' fixes
aka who are you to presume what I want?
2022-12-29 22:26:55 +00:00
Paul D
253d8e8d4e Docs grammar fixes
joined split infinitives, and relocated adverbs appropriately.
2022-12-29 22:26:54 +00:00
Paul D
a85b643866 Docs grammar fixes.
One cannot "to not x", but one can "not to x".
Avoiding split infinitives gives the added bonus that machine
translation yields better results.

setup (n/adj) vs set(v) up. We don't "I setup it" but "I set it up".

Likewise for login(n/adj) and log(v) in, backup(n/adj) and back(v) up.
2022-12-29 00:01:48 +00:00
TW
f5d6a8d051
Merge pull request #7231 from ThomasWaldmann/list-or-progress
--list xor --progress
2022-12-29 00:39:53 +01:00
TW
a50a7a608c
Merge pull request #7230 from ThomasWaldmann/fix-progress-docs
fix --progress display description, fixes #7180
2022-12-29 00:39:37 +01:00
Thomas Waldmann
c461fa8d0b
do not use markup in simple error messages 2022-12-28 17:23:41 +01:00
Thomas Waldmann
bdc2dbfc08
disallow --list with --progress, fixes #7219 2022-12-28 17:23:04 +01:00
Thomas Waldmann
f27e61b2b0
fix --progress display description, fixes #7180 2022-12-28 16:54:46 +01:00
TW
e49b60ae59
Merge pull request #7228 from ThomasWaldmann/update-requirements-master
update development.lock.txt
2022-12-27 19:22:28 +01:00
Thomas Waldmann
7f5af3c98f
update development.lock.txt
including a setuptools security fix, see #7227

also: cosmetic change in development.txt to have same order
2022-12-27 18:51:28 +01:00
Franco Ayala
ab465a75d4
Adding used storage quota to borg info (#7121) 2022-12-24 01:55:47 +01:00
TW
edb28691d5
Merge pull request #7171 from RayyanAnsari/archiver-tests-win
Fix archiver tests on Windows
2022-12-18 16:06:19 +01:00
Rayyan Ansari
cf61e7d58a testsuite: archiver: skip block device in test_transfer_upgrade
On MINGW, the S_IFBLK macro is incorrectly set as 0x3000 instead of 0x6000.
https://github.com/mingw-w64/mingw-w64/blob/v10.0.0/mingw-w64-headers/crt/sys/stat.h#L133
2022-12-18 14:05:24 +00:00
Rayyan Ansari
66a407ff9f Use \n for the {NL} format specifier
\n is automatically converted on write to the platform-dependent os.linesep.
Using os.linesep instead of \n means that on Windows, the line ending becomes "\r\r\n".
Also switches mentions of {LF} to {NL} in code and docs.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
d32ae512a8 testsuite: archiver: change regex excludes in test_extract_include_exclude_regex_from_file
On Windows, the ":" character cannot be used in a filename.
Python does not error on this because the ":" character represents data streams.
See https://stackoverflow.com/a/54508979
2022-12-18 14:05:24 +00:00
Rayyan Ansari
2505118fff testsuite: archiver: check if symlinks supported before test_create_read_special_broken_symlink
On Windows, symlinks can only be created by administrator accounts.
Using are_symlinks_supported() skips the test if the symlink cannot be created.
See https://docs.python.org/3/library/os.html#os.symlink
2022-12-18 14:05:24 +00:00
Rayyan Ansari
e97a966b46 testsuite: archiver: fix test_create_paths_from_command on Windows
On Windows, `echo` is a shell builtin and can only output one line at a time.
A batch file that outputs the filenames is instead used as the command.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
9e9b94615e archiver: key_cmds: check if key path is a directory before opening
On Windows, Python raises PermissionError instead of IsADirectoryError (like on Unix) if the file to open is actually a directory.
See https://github.com/python/cpython/issues/87261
2022-12-18 14:05:24 +00:00
Rayyan Ansari
fff2c21e65 testsuite: archiver: skip test_file_status_cs_cache_mode on Windows
On Windows, the ctime attribute of stat represents the time of creation, unlike Unix.
See https://docs.python.org/3/library/os.html#os.stat_result.st_ctime
2022-12-18 14:05:24 +00:00
Rayyan Ansari
12245761c0 testsuite: archiver: diff_cmd: ignore modes
Windows does not have file modes.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
d8e8247c6d testsuite: archiver: increase hashing test bytes
A lower value results in the hash running too fast and the time being rounded down to 0.0, resulting in the test failing.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
061397740c testsuite: archiver: skip test_umask on Windows
Windows does not have file modes, so os.stat always returns 777.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
208add518f testsuite: archiver: skip test_unix_socket on Windows
Python on Windows does not support the AF_UNIX socket type yet.
https://github.com/python/cpython/issues/77589
2022-12-18 14:05:23 +00:00
Rayyan Ansari
2f9c7d98e5 testsuite: archiver: use os.linesep instead of hardcoded newline string
On Windows, a newline is \r\n instead of \n.
2022-12-18 14:05:15 +00:00
Rayyan Ansari
e65c6ac787 platform: windows: use root/0 as dummy user and id values
Windows does not have the uid/gid system.
2022-12-18 14:00:35 +00:00
Rayyan Ansari
5e8452a705 archiver: create_cmd: do not add preexec_fn on Windows
The preexec_fn argument of Popen is not supported on Windows.
2022-12-18 14:00:35 +00:00
Rayyan Ansari
1deeb0b17d testsuite: archiver: do not try to create special devices on Windows
Windows does not support these file types in userspace programs.
2022-12-18 14:00:35 +00:00
TW
32d0567a17
Merge pull request #7217 from ThomasWaldmann/github-actions-updates-master
GitHub actions updates (master)
2022-12-17 22:24:48 +01:00
Thomas Waldmann
b1d7cb4e1e
github CI: set PKG_CONFIG_PATH again
strange: on macOS, the globally set PKG_CONFIG_PATH was overwritten,
thus the borg build did not find openssl any more. setting it here
locally again works around the issue.
2022-12-17 21:37:27 +01:00
Thomas Waldmann
d959178e76
github CI: prepend to PKG_CONFIG_PATH 2022-12-17 21:35:26 +01:00
Thomas Waldmann
6041928c0a
github CI: use actions/cache@v3 2022-12-17 20:32:35 +01:00
Thomas Waldmann
626a5c9229
github CI: use actions/setup-python@v4 2022-12-17 20:31:58 +01:00
Thomas Waldmann
2f0a81617f
github CI: use actions/checkout@v3 2022-12-17 20:31:13 +01:00
Thomas Waldmann
c9a879a358
github CI: use ubuntu-20.04 2022-12-17 20:30:07 +01:00
TW
a3614b5a3c
Merge pull request #7213 from ThomasWaldmann/remove-save-space
remove --save-space
2022-12-17 17:17:10 +01:00
Thomas Waldmann
8747644540
remove --save-space
this option did not change behaviour since longer,
we only had kept it for API compatibility.

as a borg2 repo server won't have old clients talking to it,
we can safely remove this everywhere now.
2022-12-17 16:48:54 +01:00
TW
3202f68fb3
Merge pull request #7212 from ThomasWaldmann/archivename-validator
use archivename_validator everywhere
2022-12-15 23:30:33 +01:00
Thomas Waldmann
a475227e18
use archivename_validator everywhere
also: simplify, reuse code from text_validator.
2022-12-15 22:54:46 +01:00
TW
d0d21e7928
Merge pull request #7197 from ThomasWaldmann/valid-archive-names
text attributes: validate more strictly, fixes #2290
2022-12-15 19:24:17 +01:00
TW
5eb368dc41
Merge pull request #7211 from ThomasWaldmann/list-directories-dry-run-master
create: --list --dry-run output for directories, fixes #7209
2022-12-15 19:19:49 +01:00
Thomas Waldmann
61e5115d1d
fix fso.stats updating
fso is None in dry_run mode.
2022-12-15 18:10:36 +01:00
Thomas Waldmann
19e25043b5
create: --list --dry-run output for directories, fixes #7209
Without the status being set no output was generated in
dry-run mode, confusing users about whether borg would back
up directories (in non-dry-run mode).

- == item not backed up just because of dry-run mode
x == item excluded
2022-12-15 17:37:51 +01:00
Thomas Waldmann
b9dc2be661
remove support for bpath placeholder
this needs to get done differently later, maybe base64 for json output.
2022-12-12 19:39:52 +01:00
Thomas Waldmann
1e2741ad3d
remove support for barchive placeholder
not needed any more as the archive name is now validated pure text.
2022-12-12 19:10:58 +01:00
Thomas Waldmann
1517db07ec
remove support for bcomment placeholder
not needed any more as the comment is now validated pure text.
2022-12-12 18:55:14 +01:00
Thomas Waldmann
4b54b5565e
use comment validator for cli args and borg transfer 2022-12-12 18:48:01 +01:00
Thomas Waldmann
99c6afbc61
add generic text and comment validator 2022-12-12 18:01:07 +01:00
Thomas Waldmann
ebff12ad41
transfer: validate archive names before transfer 2022-12-12 17:06:13 +01:00
Thomas Waldmann
fe2b2bc007
archive names: validate more strictly, fixes #2290
we want to be able to use an archive name as a directory name,
e.g. for the FUSE fs built by borg mount.

thus we can not allow "/" in an archive name on linux.

on windows, the rules are more restrictive, disallowing
quite some more characters (':<>"|*?' plus some more).
we do not have FUSE fs / borg mount on windows yet, but
we better avoid any issues.
we can not avoid ":" though, as our {now} placeholder
generates ISO-8601 timestamps, including ":" chars.

also, we do not want to have leading/trailing blanks in
archive names, neither surrogate-escapes.

control chars are disallowed also, including chr(0).
we have python str here, thus chr(0) is not expected in there
(is not used to terminate a string, like it is in C).
2022-12-12 17:05:01 +01:00
TW
de6d8af42c
Merge pull request #7198 from ThomasWaldmann/fix-macos-ci-master
fix tox4 issue on macOS CI
2022-12-10 20:05:47 +01:00
Thomas Waldmann
e6424aa0f5
fix tox4 passenv issue, fixes #7199
also: have a setting to disable fail-fast, in case something breaks again.
2022-12-10 19:34:32 +01:00
TW
9ba507ac74
Merge pull request #7182 from ThomasWaldmann/transfer-upgrade-tests
fixes and transfer/upgrade tests
2022-12-10 13:19:41 +01:00
Thomas Waldmann
15139a80c9
bugfix: switch archive timestamps to utc
we use utc for file timestamps and manifest timestamp,
so let's use utc for archives also.
2022-12-04 10:55:20 +01:00
Thomas Waldmann
1f859c9f17
refactor: get archive timestamps via archive_ts_now() 2022-12-04 10:55:17 +01:00
Thomas Waldmann
6a82d01b35
tests for borg transfer --upgrader=From12To20 2022-12-04 09:07:48 +01:00
Thomas Waldmann
87e597011a
bugfix: file timestamps should use tz-aware utc datetime objs
the UNIX time used for timestamp is seconds since 1.1.1970,
in UTC. thus, the natural way to represent it is with a
tz-aware utc datetime object.

but previously (in borg 1.x), they used naive datetime
objects and localtime.
2022-12-04 09:07:29 +01:00
Thomas Waldmann
c343673ab5
bugfix: do no assume hardlink_master=True if not present, see #7175
this would produce unneeded item.hlid attributes
for fifos, char and block devices when transferring /
upgrading from faulty borg 1.x archives.
2022-11-28 23:57:59 +01:00
TW
d577abe02e
Merge pull request #7167 from ThomasWaldmann/update-twine-upload-master
twine: use repo name instead of url
2022-11-27 01:03:32 +01:00
Thomas Waldmann
b60afa7e19
twine: use repo name instead of url 2022-11-27 01:02:39 +01:00
TW
8eeee915e4
Merge pull request #7166 from ThomasWaldmann/rel200b4
release 2.0.0b4
2022-11-27 01:00:16 +01:00
Thomas Waldmann
af93136ca7
build_man 2022-11-26 22:23:46 +01:00
Thomas Waldmann
4d2eb06ed3
build_usage 2022-11-26 22:23:17 +01:00
Thomas Waldmann
3ab46c5f46
update release date of 2.0.0b4 2022-11-26 22:16:53 +01:00
TW
a36102e52b
Merge pull request #7165 from ThomasWaldmann/update-changes2
update CHANGES
2022-11-26 21:20:38 +01:00
TW
aef439eb1a
Merge pull request #7164 from ThomasWaldmann/vagrant-updates
Vagrant updates
2022-11-26 21:20:23 +01:00
Thomas Waldmann
a2f7435a3b
vagrant: use less cpus/concurrency 2022-11-26 19:43:36 +01:00
Thomas Waldmann
724762510d
use python 3.11 for the binary build
use python 3.10.1 for tests.
2022-11-26 19:42:42 +01:00
Thomas Waldmann
cc4bee6220
use pyinstaller 5.6.2, fixes #7160
support python 3.11 now!
2022-11-26 19:38:58 +01:00
Thomas Waldmann
82aaef12b0
update CHANGES 2022-11-26 19:35:30 +01:00
TW
7439f89a78
Merge pull request #7157 from ThomasWaldmann/fix-7156
fix crash in borg transfer, fixes #7156
2022-11-26 12:43:26 +01:00
Thomas Waldmann
83576ae94c
fix crash in borg transfer, fixes #7156 2022-11-25 13:32:47 +01:00
TW
a2205439a0
Merge pull request #7155 from ThomasWaldmann/cygwin-fixes
Cygwin fixes
2022-11-22 18:49:23 +01:00
Thomas Waldmann
ae0017d174
skip test_create_read_special_symlink on cygwin
test is broken on cygwin and hangs infinitely.
2022-11-22 18:16:18 +01:00
Thomas Waldmann
15c51ee3c6
fix test_recreate_basic on cygwin
looks like that chmod should only get done IF we are root (and on linux?).

taking away write permissions on windows/cygwin (and when running as normal
user) makes create_regular_file fail when it tries to create dir2/file3.
2022-11-22 18:16:15 +01:00
Thomas Waldmann
f088682bc9
ignore testsuite test for slow msgpack on cygwin
we don't want to have a failing test just because a
not compiled msgpack was used to run the tests.
2022-11-22 18:16:12 +01:00
TW
57c9f6193a
Merge pull request #7141 from RayyanAnsari/fix-repository-tests
Fix repository tests on Windows
2022-11-16 18:43:48 +01:00
Rayyan Ansari
4445fe3bdb testsuite: repository: skip some tests for RemoteRepository 2022-11-15 19:14:33 +00:00
Rayyan Ansari
c209daec63 file_integrity.py: make sure file_fd is always closed on exit 2022-11-15 18:46:08 +00:00
Rayyan Ansari
f3f6e3f448 testsuite: repository: close fd before deleting segment
See last commit.
2022-11-15 17:55:18 +00:00
Rayyan Ansari
2a8cacf517 repository: cleanup(): close segment before unlinking
On Windows, trying to delete a file that is already open raises an exception.

Docs:
https://docs.python.org/3/library/os.html#os.remove
2022-11-11 18:21:11 +00:00
Rayyan Ansari
62341673c1 repository: use os.replace instead of os.rename
On Windows, os.rename raises an exception if the destination file already exists, unlike os.replace which replaces the destination file.

Docs:
https://docs.python.org/3/library/os.html#os.rename
https://docs.python.org/3/library/os.html#os.replace
2022-11-10 17:56:45 +00:00
TW
5090f809ec
Merge pull request #7136 from ThomasWaldmann/fix-hashing-time-test
fix failing hashing_time test
2022-11-07 12:47:04 +01:00
Thomas Waldmann
85b0dc873a
fix failing hashing_time test
fast CPUs failed the test due to rounding down to 0.00s.
2022-11-07 10:51:04 +01:00
TW
31c53f6b78
Merge pull request #7134 from ThomasWaldmann/remove-py37-compat-code-master
remove python < 3.7 compatibility code
2022-11-07 09:04:54 +01:00
Thomas Waldmann
f5f38a1fbd
remove python < 3.7 compatibility code
not supported any more in master and 1.2-maint branches.
2022-11-06 18:22:56 +01:00
TW
473a74d9da
Merge pull request #7133 from ThomasWaldmann/black-same-version
use same black version on gh actions as locally
2022-11-06 17:39:38 +01:00
Thomas Waldmann
fa9381a476
use same black version on gh actions as locally 2022-11-06 17:34:59 +01:00
TW
5713908ce1
Merge pull request #7129 from ThomasWaldmann/fix-6070-master
improve/clarify strange test code, fixes #6070
2022-11-05 02:15:39 +01:00
Thomas Waldmann
5a4f07629c improve/clarify strange test code, fixes #6070 2022-11-05 00:46:40 +01:00
TW
b9ca421e27
Merge pull request #7127 from ThomasWaldmann/fix-root-paths-master
fix args.paths related argparsing, fixes #6994
2022-11-05 00:27:09 +01:00
Thomas Waldmann
17cc72ec28 fix args.paths related argparsing, fixes #6994
argparse: the default action is "store" and that overwrote an already
existing list in args.paths (e.g. from --pattern="R someroot") when it
started to process the positional PATH args.

with "extend" it now extends the existing args.paths with the list of
positional PATH arguments (which can be 0..N elements long, nargs="*").

note: "extend" is new since python 3.8, thus this can only be backported
to 1.2-maint, but not to 1.1-maint.
2022-11-04 23:29:58 +01:00
TW
c3ef6b3a72
Merge pull request #7125 from ThomasWaldmann/hashindex-test-win-master
Fix test_size_on_disk_accurate on Windows
2022-11-04 21:13:23 +01:00
Thomas Waldmann
05997e2867 Fix test_size_on_disk_accurate on Windows
Pass the python file object / fd instead of the file path.

On Windows, a tempfile cannot be opened again, unlike on Unix systems.
See https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
2022-11-04 20:32:53 +01:00
TW
edf12186fc
Merge pull request #7123 from RayyanAnsari/hashindex-test-win
Fix test_size_on_disk_accurate on Windows
2022-11-04 20:15:59 +01:00
Rayyan Ansari
cc0ad321dc Fix test_size_on_disk_accurate on Windows
Pass the file descriptor instead of the file path.
On Windows, a tempfile cannot be opened again, unlike on Unix systems.
See https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
2022-11-04 18:28:51 +00:00
TW
7aeae7cf7a
Merge pull request #7103 from RayyanAnsari/msys2-ci
Use MSYS2 for Windows CI
2022-10-27 15:06:34 +02:00
Rayyan Ansari
2b98a423ed
Add new Windows build scripts and CI with GitHub and MSYS2
Fixes #7097
2022-10-27 13:42:41 +01:00
Rayyan Ansari
83980e304e
Remove old Windows scripts and Appveyor CI 2022-10-27 13:34:32 +01:00
TW
1d387522e4
Merge pull request #7104 from ThomasWaldmann/py311-master
vagrant / github CI: use python 3.11.0 / 3.10.8
2022-10-27 08:16:44 +02:00
Thomas Waldmann
78094453b6 vagrant: use python 3.10.8 2022-10-27 07:24:43 +02:00
Thomas Waldmann
b19618506a vagrant / github CI: use python 3.11.0 2022-10-27 02:15:05 +02:00
Franco Ayala
eaccd9d578
Fix test_chunking_time (#7101)
test_chunking_time: use a bigger file to avoid test fail due to rounding to 0.0
2022-10-26 22:17:05 +02:00
nyuszika7h
54ec166219
tar_filter: recognize .tar.zst as zstd (#7093)
tar_filter: recognize .tar.zst as zstd
2022-10-22 14:46:12 +02:00
Franco Ayala
2ed7f317d3
Adding performance statistics to borg create (#6991)
- file status A/M/E counters
- chunking time
- hashing time
- rx_bytes / tx_bytes

Note: the sleep() in the test is needed due to timestamp granularity on linux being much more coarse than expected (uses the system timer, 100Hz or 250Hz).
2022-10-19 21:40:02 +02:00
TW
b8a0e0d6bd
Merge pull request #7087 from ThomasWaldmann/update-changes
update CHANGES
2022-10-17 00:12:55 +02:00
Thomas Waldmann
4b446dc146 update CHANGES 2022-10-12 22:49:58 +02:00
TW
a74bcb786d
Merge pull request #7081 from ThomasWaldmann/fix-transfer-chunker-params
transfer/upgrade: fix borg < 1.2 chunker_params, fixes #7079
2022-10-11 20:37:56 +02:00
Thomas Waldmann
c98f8e44b9 transfer/upgrade: fix borg < 1.2 chunker_params, fixes #7079
add the missing chunker_name as first element of the tuple.
2022-10-10 21:16:44 +02:00
TW
6e95e5464f
Merge pull request #7078 from ThomasWaldmann/fix-item-_dict
transfer/upgrade: do not access Item._dict, fixes #7077
2022-10-10 19:45:03 +02:00
Thomas Waldmann
3fa7837a8b transfer/upgrade: do not access Item._dict, fixes #7077
after the cython code refactor in #7063, accessing the internal _dict is
not possible any more.

but looks like we do not even need that.
2022-10-08 23:23:09 +02:00
TW
349b4905ce
Merge pull request #7074 from ThomasWaldmann/fix-nfiles-master
archive.save(): always use metadata from stats, fixes #7072
2022-10-08 19:59:09 +02:00
TW
13f90ed8b3
Merge pull request #7076 from ThomasWaldmann/fix-benchmark-compression-api
benchmark: fixed TypeError in compression benchmarks, fixes #7075
2022-10-05 23:19:15 +02:00
Thomas Waldmann
bf3f9b5e5b benchmark: fixed TypeError in compression benchmarks 2022-10-05 22:11:44 +02:00
Thomas Waldmann
2e83d18d35 archive.save(): always use metadata from stats, fixes #7072
e.g. nfiles, size, etc.

fixes:
- checkpoint archives did not have this metadata yet
- borg import-tar did not have this metadata yet
2022-10-03 23:25:02 +02:00
TW
16e8213716
Merge pull request #7071 from ThomasWaldmann/misc
misc updates / fixes
2022-10-03 21:59:19 +02:00
Thomas Waldmann
06a9336a58 vagrant: use 3.10.7 for binary building 2022-10-03 21:04:31 +02:00
Thomas Waldmann
4574ae0178 update quickstart docs with --match-archives 2022-10-03 20:30:34 +02:00
Thomas Waldmann
d527429339 update README for borg2 2022-10-03 20:23:56 +02:00
Thomas Waldmann
8342f74d5c docs: add rcompress to usage index 2022-10-03 13:50:29 +02:00
Thomas Waldmann
c326b9d160 fix repository.scan api minimum requirement 2022-10-02 23:47:50 +02:00
TW
94b881d6c9
Merge pull request #7069 from ThomasWaldmann/rel200b3
release 2.0.0b3
2022-10-02 22:46:59 +02:00
Thomas Waldmann
3f159ca3bb build_man / build_usage 2022-10-02 15:51:17 +02:00
Thomas Waldmann
5d8d21df4d rcompress docs / examples / markup fixes 2022-10-02 15:50:41 +02:00
Thomas Waldmann
c6785c8f15 set release date 2022-10-02 15:01:16 +02:00
TW
66249b7394
Merge pull request #7067 from ThomasWaldmann/update-changes
update CHANGES
2022-10-02 14:59:39 +02:00
Thomas Waldmann
fa74247ecb update CHANGES 2022-10-02 14:51:34 +02:00
TW
c29d4a096b
Hashindex header work, fixes #6960 (#7064)
support reading new, improved hashindex header format, fixes #6960

Bit of a pain to work with that code:
- C code
- needs to still be able to read the old hashindex file format,
- while also supporting the new file format.
- the hash computed while reading the file causes additional problems because
  it expects all places in the file get read exactly once and in sequential order.
  I solved this by separately opening the file in the python part of the code and
  checking for the magic.
  BORG_IDX means the legacy file format and legacy layout of the hashtable,
  BORG2IDX means the new file format and the new layout of the hashtable.

Done:
- added a version int32 directly after the magic and set it to 2 (like borg 2).
  the old header had no version info, but could be denoted as version 1 in case
  we ever need it (currently it decides based on the magic).
- added num_empty as indicated by a TODO in count_empty, so it does not need a
  full hashtable scan to determine the amount of empty buckets.
- to keep it simpler, I just filled the HashHeader struct with a
  `char reserved[1024 - 32];`
  1024 being the desired overall header size and 32 being the currently used size.
  this alignment might be useful in case we mmap() the hashindex file one day.
2022-10-02 14:35:21 +02:00
TW
5edc53d4d4
Merge pull request #7066 from ThomasWaldmann/fix-recreate-fixed-chunker-master
get_chunker: fix missing sparse=False argument, fixes #7056
2022-10-02 14:34:18 +02:00
Thomas Waldmann
c339be7df9 get_chunker: fix missing sparse=False argument, fixes #7056 2022-10-02 14:09:19 +02:00
Thomas Waldmann
e32d733612 add test for recreate with "fixed" chunker 2022-10-02 14:02:06 +02:00
TW
b5e88129b4
Merge pull request #7065 from ThomasWaldmann/vagrant-updates
Vagrant updates
2022-10-02 03:19:15 +02:00
Thomas Waldmann
8221afe965 use absolute import to make pyinstaller binaries work again 2022-10-02 01:33:57 +02:00
Thomas Waldmann
fa83fa1c23 vagrant: upgrade pyinstaller 4.10 -> 5.4.1 2022-10-02 01:32:13 +02:00
Thomas Waldmann
420ca41961 vagrant: add python 3.11.0rc2 2022-10-01 23:13:05 +02:00
Thomas Waldmann
6034d90996 vagrant: use python 3.9.14 for binary build 2022-10-01 23:06:38 +02:00
Thomas Waldmann
ef2188b7ca increase VMCPUS and xdistn to 16 2022-10-01 23:01:27 +02:00
TW
4e87c1b6be
Merge pull request #7063 from ThomasWaldmann/item-more-cython-rebased
item.pyx: re-doing PR #5763
2022-09-29 21:14:19 +02:00
Thomas Waldmann
215ccaebea cosmetic: spaces, typos 2022-09-29 20:40:07 +02:00
Thomas Waldmann
fd5019a7b2 cpdef variables -> cdef
warning: src/borg/item.pyx:199:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables

  warning: src/borg/item.pyx:200:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables

  warning: src/borg/item.pyx:202:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables
2022-09-29 20:40:07 +02:00
Thomas Waldmann
ce2dd6df24 item.pyx: use more cython and turn PropDict properties to a descriptor
this turns all python level classes into extension type classes.

additionally it turns the indirect properties into direct descriptors.

test_propdict_attributes runs about 30% faster.

base memory usage as reported by sys.getsizeof(Item()):
before: 48 bytes, after this PR: 40 bytes

Author: @RonnyPfannschmidt in PR #5763
2022-09-29 20:39:06 +02:00
Thomas Waldmann
7b3cdb1aea add benchmark for item attribute / dict access
Author: @RonnyPfannschmidt in PR #5763
2022-09-29 00:47:48 +02:00
Thomas Waldmann
57ca9f6e74 faster implementation of item.chunks_contents_equal
This is about 10x faster than before, thanks to Ronny!

Author: @RonnyPfannschmidt in PR #5763
2022-09-28 18:57:40 +02:00
TW
1274b56ad4
Merge pull request #7061 from ThomasWaldmann/update-changes
update CHANGES
2022-09-28 16:01:17 +02:00
Thomas Waldmann
9315ecb89e update CHANGES 2022-09-28 15:20:15 +02:00
TW
f2fe22522d
Merge pull request #7052 from ThomasWaldmann/fix-upgrader-user-group-none
transfer: fix user/group == None crash with borg1 archives
2022-09-28 14:35:40 +02:00
TW
b8f86abaa3
Merge pull request #7059 from ThomasWaldmann/ci-py311-fuse3
CI: test pyfuse3 with python 3.11
2022-09-28 13:14:39 +02:00
Thomas Waldmann
c3e5ff613f CI: test pyfuse3 with python 3.11 2022-09-28 02:57:20 +02:00
TW
1a89db0a70
Merge pull request #7058 from ThomasWaldmann/fix-memoryview-crash
avoid memoryview related TypeError in compressors
2022-09-28 00:52:55 +02:00
Thomas Waldmann
515833c664 avoid memoryview related TypeError in compressors
fixes:

https://github.com/borgbackup/borg/discussions/7020#discussioncomment-3741024
2022-09-27 23:41:21 +02:00
TW
58c375678a
Merge pull request #7055 from ThomasWaldmann/borg-lock-wait-env-var
BORG_LOCK_WAIT=n env var to set default for --lock-wait option, fixes #5279
2022-09-27 19:41:14 +02:00
TW
ba7b9cfd30
Merge pull request #7037 from ThomasWaldmann/rcompress
rcompress: do a repo-wide (re)compression
2022-09-27 19:13:58 +02:00
Thomas Waldmann
e57ff29f22 BORG_LOCK_WAIT=n env var to set default for --lock-wait option, fixes #5279 2022-09-27 17:09:19 +02:00
Thomas Waldmann
9455c1e278 rcompress: do a repo-wide (re)compression
reads all chunks in on-disk order and recompresses them if they are not already using
the desired compression type and level (and obfuscation level).

supports SIGINT/ctrl-c and --checkpoint-interval (default: 1800s).

this is a borg command that compacts when committing (without this, it would have
a huge space usage). it commits/compacts every checkpoint interval or when
pressing ctrl-c / receiving SIGINT.
2022-09-27 16:50:19 +02:00
Thomas Waldmann
803b2a8d38 remember obfuscation level 2022-09-27 11:39:32 +02:00
TW
78b1301b98
Merge pull request #7028 from ThomasWaldmann/match-archives
implement pattern support for --match-archives, fixes #6504
2022-09-27 11:38:27 +02:00
Thomas Waldmann
b71ab084ba transfer: fix user/group == None crash with borg1 archives 2022-09-26 23:00:29 +02:00
TW
098d80f843
Merge pull request #7043 from ThomasWaldmann/misc-fixes
misc fixes
2022-09-26 17:32:50 +02:00
TW
600606897e
Merge pull request #7044 from ThomasWaldmann/repoobj-fixes
repoobj: mutate meta + misc minor fixes / updates
2022-09-21 11:55:41 +02:00
Thomas Waldmann
55b137bdae repoobj: consistency / cleanups 2022-09-21 11:19:40 +02:00
Thomas Waldmann
acc5d9870a repoobj.format: mutate meta
we should modify the meta dict given by the caller, so the caller can know
about e.g. the compression/obfuscation that was done (this is useful for rcompress).
2022-09-21 11:19:40 +02:00
Thomas Waldmann
a07c93d7f4 add assertion to key_factory, fail early with zero-len manifest data 2022-09-21 09:06:59 +02:00
Thomas Waldmann
8c9fed105d hashindex: make NSIndex1 api compatible
some new stuff is not supported for NSIndex1,
but we can avoid crashing due to function signature mismatches or
missing methods and rather have more clear exceptions.
2022-09-21 08:56:37 +02:00
TW
d671707226
Merge pull request #7042 from ThomasWaldmann/fix3-scan
repository.scan: fix start_offset
2022-09-20 21:55:34 +02:00
Thomas Waldmann
b3c7d8f5f3 repository.scan: fix start_offset
start_offset (from state) is only valid for start_segment, otherwise we must use 0.
2022-09-20 21:25:36 +02:00
TW
63f736be4f
Merge pull request #7040 from ThomasWaldmann/fix2-scan
repository.scan: use same end_segment within same scan
2022-09-19 22:47:40 +02:00
Thomas Waldmann
c4e54ca44e repository.scan: use same end_segment within same scan
achieved by putting it into the state that is now used instead of the marker.
2022-09-19 21:14:25 +02:00
TW
c0e674ce61
Merge pull request #7038 from ThomasWaldmann/fix-scan
Fix repository.scan
2022-09-19 12:28:09 +02:00
Thomas Waldmann
49a4884cfe repository.scan: do not use chunkid as marker, but (segment, offset)
when using .scan(limit, marker), we used to use the last chunkid from
the previously returned scan result to remember how far we got and
from where we need to continue.

as this approach used the repo index to look up the respective segment/offset,
it was problematic if the code using scan was re-writing the chunk to
a new segment/offset, updating the repo index (e.g. when recompressing a chunk)
and basically destroying the memory about from where we need to continue
scanning.

thus, directly returning (segment, offset) as marker is easier and solves this issue.
2022-09-19 12:03:13 +02:00
Thomas Waldmann
ce08f92090 repository.scan: only iterate over committed chunks
otherwise, if we scan+get+put (e.g. if we read/modify/write chunks to
recompress them), it would scan past the last commit and run into the
newly written chunks (and potentially never terminate).
2022-09-19 11:05:07 +02:00
TW
7e3b6752cb
Merge pull request #7036 from ThomasWaldmann/fix-7034-master
check: fix uninitialised variable if repo is completely empty, fixes #7034
2022-09-17 21:22:43 +02:00
Thomas Waldmann
78de77e67a check: fix uninitialised variable if repo is completely empty, fixes #7034 2022-09-17 20:54:13 +02:00
TW
d1cd017bd5
Merge pull request #7032 from ThomasWaldmann/compat-setuptoolsscm4-master
do not use version_tuple placeholder in setuptools_scm template
2022-09-17 13:54:16 +02:00
Thomas Waldmann
3d311143f3 do not use version_tuple placeholder in setuptools_scm template
that would require setuptools_scm>=5.0.0 but some dists do not have that yet.

also, we do not use the version_tuple from _version.py, so it is not required anyway.

forward port of #7024.
2022-09-17 13:37:38 +02:00
TW
ca2cd9ad25
Merge pull request #7026 from ThomasWaldmann/empty-zero-unknown
metadata: differentiate between empty/zero and unknown
2022-09-16 21:52:31 +02:00
TW
2f803f83bf
Merge pull request #7030 from ThomasWaldmann/beta
beta status now
2022-09-16 21:52:07 +02:00
Thomas Waldmann
dae1b9cd82 beta status now 2022-09-16 21:26:41 +02:00
Thomas Waldmann
1a6b60f415 mode, user/group id/name: minor code refactor, remove None values at transfer time, #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224910916
2022-09-16 21:12:29 +02:00
TW
16787e48b7
Merge pull request #7029 from ThomasWaldmann/relative-imports
Relative imports
2022-09-16 20:48:32 +02:00
Thomas Waldmann
785cb4c21a __main__: remove absolute "borg" import 2022-09-16 19:37:54 +02:00
Thomas Waldmann
f348c86f08 mount cmd tests: remove absolute "borg" import 2022-09-16 19:09:46 +02:00
Thomas Waldmann
4493d396e6 implement pattern support for --match-archives, fixes #6504
also:
- rename --glob-archives option to --match-archives (short: -a, unchanged)
- globbing patterns now need sh: prefix
- regex patterns need re: prefix
- "identical" match "patterns" use an id: prefix
- new default style is id: pattern (--glob-archives used sh: glob pattern)
- source code: glob -> match, GLOB -> PATTERN
2022-09-16 15:10:13 +02:00
Thomas Waldmann
6e2419f3b2 timestamps: minor code refactor, nothing else to do, #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224886207
2022-09-14 18:19:35 +02:00
Thomas Waldmann
3280603e43 acls cleanup (linux), #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224872992

also:
- added some type assertions
- made NULL pointer checks more explicit
- fsencode only called when needed
- structure of code more similar now on all OSes
2022-09-14 13:57:40 +02:00
Thomas Waldmann
6a1c64b0dc xattrs cleanup, #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224870018
2022-09-14 13:57:40 +02:00
Thomas Waldmann
287907b218 bsdflags cleanup, #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224839170
2022-09-14 11:24:50 +02:00
TW
f5df35b36e
Merge pull request #7022 from ThomasWaldmann/split-archiver-tests
Split archiver tests
2022-09-14 09:51:14 +02:00
Thomas Waldmann
5d7b48ced8 add remote repo / borg binary testing 2022-09-14 09:11:45 +02:00
Thomas Waldmann
f410de690d remove log output checks
the intention of this test is testing whether borg check
returns an error when checking a corrupted repository.

the removed assertions were rather testing the test logging
configuration, which seems flaky:

- when running all tests, assertions failed
- when running only this one test, assertions succeeded
- assertions also succeeded when running all the tests before
  they were refactored to separate test modules, although the
  test code was not changed, just moved.
2022-09-13 16:22:16 +02:00
Thomas Waldmann
1cd105d9f5 update flake8 ignores in setup.cfg 2022-09-13 14:58:46 +02:00
Thomas Waldmann
f94eec199f move patterns tests to own module 2022-09-13 14:18:17 +02:00
Thomas Waldmann
87c3f11796 remove unneeded code 2022-09-13 14:14:56 +02:00
Thomas Waldmann
db0d15c182 move another test to argparsing 2022-09-13 14:12:15 +02:00
Thomas Waldmann
6ec6fc2496 move corruption tests to own module 2022-09-13 14:08:03 +02:00
Thomas Waldmann
acca64b057 move some checks to own module 2022-09-13 13:59:33 +02:00
Thomas Waldmann
c7146ffb47 move rcreate cmd tests to own module 2022-09-13 02:21:04 +02:00
Thomas Waldmann
8cee607652 move create cmd tests to own module 2022-09-13 02:00:18 +02:00
Thomas Waldmann
14f9d7d3cb move extract cmd tests to own module 2022-09-13 01:22:37 +02:00
Thomas Waldmann
4a720e9abd move item related test to item testing module 2022-09-13 00:29:20 +02:00
Thomas Waldmann
589ed91f4a move more help related stuff to help testing module 2022-09-13 00:29:20 +02:00
Thomas Waldmann
2e17ceb258 move argparsing tests to own module 2022-09-13 00:29:20 +02:00
Thomas Waldmann
32f81eff27 move config cmd tests to own module 2022-09-13 00:03:07 +02:00
Thomas Waldmann
8aaad71439 move disk full tests to own module 2022-09-12 23:55:13 +02:00
Thomas Waldmann
3c247b8109 move return codes tests to own module 2022-09-12 23:49:51 +02:00
Thomas Waldmann
245bdef4eb move benchmark cmd tests to own module 2022-09-12 23:45:11 +02:00
Thomas Waldmann
cc79c98b98 move help cmd tests to own module 2022-09-12 23:42:48 +02:00
Thomas Waldmann
e27bb0c1d0 move transfer cmd tests to own module 2022-09-12 23:37:26 +02:00
Thomas Waldmann
35d2710769 move lock cmd tests to own module 2022-09-12 23:35:21 +02:00
Thomas Waldmann
ec731bfaa0 remove unused imports from test init 2022-09-12 23:27:20 +02:00
Thomas Waldmann
4e932241b2 blacken init 2022-09-12 23:25:38 +02:00
Thomas Waldmann
e329152f01 move recreate cmd tests to own module 2022-09-12 23:25:38 +02:00
Thomas Waldmann
5fa1b7ea88 move (r)info cmd tests to own module 2022-09-12 23:25:38 +02:00
Thomas Waldmann
620d51d6bc move rename cmd tests to own module 2022-09-12 23:25:38 +02:00
Thomas Waldmann
a07311101a move (r)list cmds tests to own module 2022-09-12 23:25:38 +02:00
Thomas Waldmann
fcf7ca5e10 move fuse / mount cmds tests to own module 2022-09-12 23:25:38 +02:00
Thomas Waldmann
2288ee04fe move prune cmd tests to own module 2022-09-12 02:53:02 +02:00
Thomas Waldmann
4171e38d44 move key cmd tests to own module 2022-09-12 02:33:37 +02:00
Thomas Waldmann
c09ce2cb55 move delete/rdelete cmd tests to own modules 2022-09-12 02:05:25 +02:00
Thomas Waldmann
185951fb57 move diff cmd tests to own module 2022-09-12 01:42:36 +02:00
Thomas Waldmann
dadbe0ddf3 move check cmd tests to own module 2022-09-12 01:03:16 +02:00
Thomas Waldmann
c4a1cc5bb0 remove unused imports 2022-09-12 00:51:25 +02:00
Thomas Waldmann
d762833cd6 move debug cmd tests to own module 2022-09-12 00:50:12 +02:00
Thomas Waldmann
5beb3857f8 move tar and --bypass-lock tests to own modules 2022-09-12 00:03:26 +02:00
Thomas Waldmann
bef65e5722 make borg.testsuite.archiver a package
git mv archiver.py archiver/__init__.py

+ adapt import levels + adapt filenames
2022-09-12 00:03:26 +02:00
TW
1453b50b6f
Merge pull request #7018 from ThomasWaldmann/rel200b2
release 2.0.0b2
2022-09-10 23:38:44 +02:00
Thomas Waldmann
208475f707 xattrs: adapt tests to new error msgs 2022-09-10 22:06:34 +02:00
Thomas Waldmann
c27df634f1 vagrant: remove outdated netbsd hack, not needed any more
(same change as in 1.2-maint)
2022-09-10 18:21:17 +02:00
Thomas Waldmann
d39ecf4640 requirements: use latest Cython, tox 3.25.1
also remove the exclusion of the meanwhile outdated
broken Cython 0.27.

use tox 3.25.1 (as in 1.2-maint)
2022-09-10 18:15:45 +02:00
Thomas Waldmann
18ca2ab3ce build_usage build_man 2022-09-10 18:15:45 +02:00
Thomas Waldmann
c8964e92fd update CHANGES 2022-09-10 18:15:45 +02:00
TW
4c5bcf5e43
Merge pull request #7019 from bket/openssl_statically_linked
OpenBSD only - statically link OpenSSL (#6474)
2022-09-10 18:13:34 +02:00
Björn Ketelaars
730fca5bcc OpenBSD only - statically link OpenSSL (#6474)
Avoid conflicting with shared libcrypto from the base OS pulled in via
dependencies.
2022-09-10 17:49:24 +02:00
TW
b6469bb7d7
Merge pull request #7017 from ThomasWaldmann/remove-stretch64
Revert "re-add stretch64 vm, fixes #7010"
2022-09-10 15:32:45 +02:00
Thomas Waldmann
8d8a672895 Revert "re-add stretch64 vm, fixes #7010"
This reverts commit 7fec5ff051.
2022-09-10 15:26:26 +02:00
TW
bbe910091e
Merge pull request #7015 from ThomasWaldmann/update-changes
update CHANGES
2022-09-10 13:46:42 +02:00
Thomas Waldmann
057db79b44 update CHANGES 2022-09-10 01:06:42 +02:00
TW
c258eb45f4
Merge pull request #7008 from KN4CK3R/forwardport-6990
xattrs / extended stat: improve exception handling (master)
2022-09-10 00:52:38 +02:00
Thomas Waldmann
65a0d7fbca cosmetic: concat strings 2022-09-10 00:27:26 +02:00
TW
9ba03f0468
Merge pull request #7013 from ThomasWaldmann/replace-placeholders
refactor replace_placeholders, fixes #6966
2022-09-10 00:23:44 +02:00
TW
d02baed852
Merge pull request #7014 from ThomasWaldmann/revive-stretch64-vm
re-add stretch64 vm, fixes #7010
2022-09-10 00:23:27 +02:00
Thomas Waldmann
7fec5ff051 re-add stretch64 vm, fixes #7010
looks like rhel7 and co is still supported and needs the old glibc.

debian stretch is not supported any more by debian, so the binaries
created on this are provided on a "use on your own risk" basis.

reverts fc67453bf3
2022-09-09 23:55:28 +02:00
Thomas Waldmann
d3a2d831b7 refactor replace_placeholders, fixes #6966
fix replacing placeholders in archive name, --comment and --glob-archives values (even if overridden by other options like
--timestamp).

add test.
2022-09-09 23:28:34 +02:00
TW
c5352000a7
Merge pull request #7012 from ThomasWaldmann/separate-encrypted-metadata
2 more things...
2022-09-09 22:53:01 +02:00
Thomas Waldmann
f647fa9f08 transfer: check if correct upgrader class is used for v1 repos 2022-09-09 21:20:35 +02:00
Thomas Waldmann
bca36db0a1 transfer: fix csize/psize for obfuscated chunks 2022-09-09 21:20:35 +02:00
TW
36e852457a
Merge pull request #6992 from ThomasWaldmann/separate-encrypted-metadata
Separate encrypted metadata
2022-09-09 21:16:13 +02:00
Thomas Waldmann
c8830cde44 update docs 2022-09-08 22:26:23 +02:00
Thomas Waldmann
5afe94883a segment entry payload, metadata length: 16bit is enough
guess we will not have much more than size, csize, psize, ctype, clevel.
2022-09-08 21:52:19 +02:00
Thomas Waldmann
b28d6ee657 recompress: only read metadata to check for ctype/clevel 2022-09-08 20:47:40 +02:00
Thomas Waldmann
06eab6a228 RepositoryCache: cache complete and meta-only chunks separately 2022-09-08 19:38:18 +02:00
Thomas Waldmann
106abbe4d9 new read_data param for repository.get() and .get_many()
True (default): return full chunk (client can decrypt meta and data)

False: return enough so client can decrypt only the meta
2022-09-08 18:31:56 +02:00
Thomas Waldmann
74ffceabf4 simplify: read_data param of io.read() is not used (yet) 2022-09-08 13:17:59 +02:00
Thomas Waldmann
b64427c480 simplify: iter_objects always returns (..., size, data)
data might be None (if read_data is False).

also removed the include_data argument, not needed any more.
2022-09-08 12:48:39 +02:00
Thomas Waldmann
e827f98c45 transfer: add test
bit hard to test the 1.2 -> 2.0 transfer, but we can at least
test the 2.0 -> 2.0 "NoOp" transfer.
2022-09-07 21:10:54 +02:00
Thomas Waldmann
cf333cef91 upgrader fixes for new api 2022-09-07 20:27:03 +02:00
Thomas Waldmann
4c9ed2a6c6 refactor compressors to new api
legacy: add/remove ctype/clevel bytes prefix of compressed data

new: use a separate metadata dict

compressors: use an int as ID, not a len 1 bytestring
2022-09-07 19:23:47 +02:00
Thomas Waldmann
1e156ca02b fix upgrader 2022-09-07 19:23:11 +02:00
TW
68e43911f5 Merge pull request #6990 from ThomasWaldmann/more-fine-grained-extended-stat-1.2
xattrs / extended stat: improve exception handling (1.2-maint)
2022-09-07 09:34:52 +02:00
Thomas Waldmann
b6cbf045ff add a test for borg 1 -> 2 repo objects transformation 2022-09-05 22:17:51 +02:00
Thomas Waldmann
754c583799 decompression dispatching based on meta dict 2022-09-05 22:14:40 +02:00
Thomas Waldmann
fa986a9f19 repoobj: add a layer to format/parse repo objects
borg < 2:

obj = encrypted(compressed(data))

borg 2:

obj = enc_meta_len32 + encrypted(msgpacked(meta)) + encrypted(compressed(data))

handle compr / decompr in repoobj

move the assert_id call from decrypt to RepoObj.parse

also:
- for AEADKeyBase, add a dummy assert_id (not needed here)
- only test assert_id for other if not AEADKeyBase instance
- remove test_getting_wrong_chunk. assert_id is called elsewhere
  and is not needed any more anyway with the new AEAD crypto.
- only give manifest (includes key, repo, repo_objs)
- only return manifest from Manifest.load (includes key, repo, repo_objs)
2022-09-04 00:49:38 +02:00
TW
3a8354059c
Merge pull request #6998 from ThomasWaldmann/fix-typos
repository: start messages with uppercase letters.
2022-09-02 00:52:41 +02:00
Thomas Waldmann
062c860260 repository: start messages with uppercase letters. 2022-09-01 22:28:00 +02:00
TW
6c6f10df1e
Merge pull request #6986 from ThomasWaldmann/flags-repo-api
repository api: flags support, fixes #6982
2022-08-22 18:45:21 +02:00
Thomas Waldmann
90ca04f535 repository api: flags support, fixes #6982
- .list: only return IDs for objects where flags & mask == value.
- .flags(_many) (new) to set/query flags
2022-08-22 18:16:59 +02:00
TW
204ecece09
Merge pull request #6985 from ThomasWaldmann/minor-fixes
minor cleanup: fix typos and punctuation in comments
2022-08-22 11:17:43 +02:00
Thomas Waldmann
15d56b2ff7 minor cleanup: fix typos and punctuation in comments 2022-08-21 11:36:27 +02:00
TW
709d162ee7
Merge pull request #6974 from ThomasWaldmann/fixes-master
misc fixes
2022-08-17 08:31:58 +02:00
Thomas Waldmann
29ae701ec9 fix test_recreate_timestamp
it did not work in timezone utc-0800.
2022-08-17 08:07:14 +02:00
Thomas Waldmann
732ecb29fe update prune docs, -P is gone, -a replaces it 2022-08-14 22:01:14 +02:00
TW
66ace47316
Merge pull request #6972 from ThomasWaldmann/update-changes-master
update CHANGES
2022-08-14 01:22:06 +02:00
Thomas Waldmann
e078337c7c update CHANGES 2022-08-14 00:08:51 +02:00
TW
34a67d2872
Merge pull request #6971 from ThomasWaldmann/formatting-fixes
fix spacing (found by coala)
2022-08-13 23:56:21 +02:00
Thomas Waldmann
ac4f96ec9f fix spacing (found by coala) 2022-08-13 23:37:07 +02:00
TW
eb8f1c20c5
Merge pull request #6970 from ThomasWaldmann/refactor-archiver-cmds
archiver modules: rename to *_cmd[s]
2022-08-13 23:25:43 +02:00
Thomas Waldmann
96139ae3c9 adapt pep8 ignores 2022-08-13 23:03:29 +02:00
Thomas Waldmann
66e74e0471 archiver modules: rename to *_cmd[s]
this was already required for list_cmd (due to "list"
being a builtin), now renamed all else also.
2022-08-13 22:59:48 +02:00
TW
fe6cd9e008
Merge pull request #6969 from ThomasWaldmann/refactor-master
refactor, move stuff around
2022-08-13 22:45:33 +02:00
Thomas Waldmann
9367ad2f07 adapt pep8 ignores 2022-08-13 22:24:20 +02:00
Thomas Waldmann
403ff07dde move nanorst module to borg.helpers 2022-08-13 22:10:13 +02:00
Thomas Waldmann
ecd7bce5b8 move shellpattern module to borg.helpers 2022-08-13 22:03:44 +02:00
Thomas Waldmann
578639b35e move lrucache module to borg.helpers 2022-08-13 22:02:04 +02:00
Thomas Waldmann
9beaced33c move manifest module from helpers to borg.manifest 2022-08-13 21:55:12 +02:00
Thomas Waldmann
ded384929d move tar related code to borg.archiver.tar 2022-08-13 21:31:41 +02:00
TW
900398f927
Merge pull request #6968 from ThomasWaldmann/cleanup-prune-master
move prune related code to borg.archiver.prune
2022-08-13 21:28:33 +02:00
Thomas Waldmann
22804f05f9 move prune related code to borg.archiver.prune 2022-08-13 20:59:18 +02:00
TW
3715e327a6
Merge pull request #6964 from ThomasWaldmann/timestamps
Timestamps with timezones
2022-08-13 20:23:31 +02:00
Thomas Waldmann
29db66c8bc transfer: fix archive timestamps to have +00:00 2022-08-13 19:50:49 +02:00
Thomas Waldmann
4ab07b6acb create/recreate/import-tar --timestamp: default to local timezone
if you want to give UTC, just append: +00:00
2022-08-13 19:17:10 +02:00
Thomas Waldmann
b4933eb337 get rid of dateutil 2022-08-13 18:31:22 +02:00
Thomas Waldmann
ade08ce842 use timezones
- timezone aware timestamps
- str representation with +HHMM or +HH:MM
- get rid of to_locatime
- fix with_timestamp
- have archive start/end time always in local time with tz or as given
- idea: do not lose tz information

then we know when a backup was made and even from
which timezone it was made. if we want to compute
utc, we can do that using these infos.

this makes a quite nice archives list, with timestamps
as expected (in local time with timezone info).

at some places we just enforce utc, like for the
repo manifest timestamp or for the transaction log,
these are usually not looked at by the user.
2022-08-13 18:31:22 +02:00
Thomas Waldmann
bab68a8d25 use py37+ datetime.isoformat / .fromisoformat
since python 3.7, .isoformat() is usable IF timespec != "auto"
is given ("auto" [default] would be as evil as before, sometimes
formatting with, sometimes without microseconds).

also since python 3.7, there is now .fromisoformat().
2022-08-11 21:18:56 +02:00
TW
b392a60c08
Merge pull request #6962 from ThomasWaldmann/fixes-master
misc fixes / cleanups
2022-08-11 18:38:32 +02:00
Thomas Waldmann
c51a0626de remove remainders of borg key change-algorithm
most was already removed previously, just this was overlooked.
2022-08-11 17:42:27 +02:00
Thomas Waldmann
a7bc1f88c1 constants: reorder stuff, add comments 2022-08-11 17:36:57 +02:00
Thomas Waldmann
a18a9df364 run "black" 2022-08-11 06:34:09 +02:00
Thomas Waldmann
252b145833 remove now unused argument() 2022-08-11 06:30:16 +02:00
Thomas Waldmann
8562940b0d with_repository: fake mechanism not needed
was only used by borg create --dry-run, but that
internally does not use the repo anyway.
2022-08-11 06:29:34 +02:00
Thomas Waldmann
8bebf65bc2 with_repository: invert_fake arg is not used 2022-08-11 06:19:23 +02:00
Thomas Waldmann
73d901a22e with_repository: "exclusive" param is always bool 2022-08-11 06:12:07 +02:00
Thomas Waldmann
e54f109afa --nobsdflags does not exist any more
it was replaced by --noflags.
2022-08-11 06:00:12 +02:00
TW
c2bcecf2eb
Merge pull request #6942 from mh4ckt3mh4ckt1c4s/doc-shift-odg
update diagrams to odg format, fixes #6928
2022-08-09 22:03:09 +02:00
mh4ckt3mh4ckt1c4s
15a450c7e8 Fix transparency level 2022-08-09 21:20:44 +02:00
mh4ckt3mh4ckt1c4s
259d3fdc76 Tiny fix of transparency bug 2022-08-09 19:33:30 +02:00
mh4ckt3mh4ckt1c4s
be9e99e346 Fix size of images to match old ones 2022-08-09 19:21:16 +02:00
mh4ckt3mh4ckt1c4s
3e40f68409 Added the transparency thing to compaction schema 2022-08-09 19:15:09 +02:00
TW
217351804f
Merge pull request #6950 from borgbackup/rel200b1
release 2.0.0b1
2022-08-07 22:49:38 +02:00
Thomas Waldmann
050031fc98 vagrant: pyenv: use python 3.10.2
this fixes build on freebsd, which seems to be broken for 3.10.0.
2022-08-07 22:48:28 +02:00
Thomas Waldmann
460142f4a7 vagrant: fix py310 based testing on netbsd 2022-08-07 22:47:04 +02:00
mh4ckt3mh4ckt1c4s
45663552bf Updated compaction to an odg file 2022-08-07 22:13:33 +02:00
Thomas Waldmann
f5b7ae5b30 build_usage build_man 2022-08-07 19:20:34 +02:00
Thomas Waldmann
8148d4e400 fix sphinx warnings 2022-08-07 19:14:03 +02:00
Thomas Waldmann
3556bcb0db set release date 2022-08-07 19:09:06 +02:00
TW
35fbac1cd1
Merge pull request #6947 from ThomasWaldmann/update-changes-master
update CHANGES
2022-08-07 19:03:25 +02:00
Thomas Waldmann
97ec8a819d update CHANGES 2022-08-07 18:40:20 +02:00
TW
7b2be94262
Merge pull request #6949 from ThomasWaldmann/fix-ctrl-c-remote-repo-master
ctrl-c must not kill important subprocesses, fixes #6912
2022-08-07 18:35:45 +02:00
mh4ckt3mh4ckt1c4s
cd27313693 Changed structure schema to odg format 2022-08-07 00:55:22 +02:00
mh4ckt3mh4ckt1c4s
085b244bb7 Removed object-graph.vdg and added 'simplified' mention in schema 2022-08-07 00:25:31 +02:00
KN4CK3R
00aca33ba6
Forwardport: repository: add debug logging for issue (#6918) (#6946)
repository: add debug logging for issue #6687
2022-08-06 23:38:30 +02:00
Thomas Waldmann
4d570497be ctrl-c must not kill other subprocesses, fixes #6912
There are some other places with subprocesses:

- borg create --content-from-command
- borg create --paths-from-command
- (de)compression filter process of import-tar / export-tar
2022-08-06 23:37:38 +02:00
TW
9f0050d409
Merge pull request #6948 from ThomasWaldmann/fix-versionpy-format-master
_version.py: remove trailing blank, add LF at EOF
2022-08-06 23:36:51 +02:00
Thomas Waldmann
0ab82d57e4 ctrl-c must not kill the ssh subprocess, fixes #6912 2022-08-06 23:27:00 +02:00
Thomas Waldmann
b9cdeaaa20 _version.py: remove trailing blank, add LF at EOF 2022-08-06 23:19:34 +02:00
TW
76ef20105f
Merge pull request #6941 from ThomasWaldmann/archive-items-indirect
massively increase archive metadata stream size limit, fixes #1473
2022-08-06 22:46:23 +02:00
Thomas Waldmann
fb74fdb710 massively increase per archive metadata stream size limit, fixes #1473
implemented by introducing one level of indirection, the limit is now
very high, so it is not practically relevant any more.

we always use the indirection (storing the metadata stream chunk ids list not
directly into the archive item, but into some repo objects referenced by the new
ArchiveItem.item_ptrs list).

thus, the code behaves the same for all archive sizes.
2022-08-06 19:01:41 +02:00
mh4ckt3mh4ckt1c4s
7ed3fad470 Updated object-graph to an odg file 2022-08-06 11:32:32 +02:00
mh4ckt3mh4ckt1c4s
2c29da2553 Fix duplicate object in borg-data-flow graph 2022-08-06 10:53:13 +02:00
mh4ckt3mh4ckt1c4s
1716502cff Some visual fixes 2022-08-06 02:28:51 +02:00
mh4ckt3mh4ckt1c4s
dcc7fba2e5 Updated borg-data-flow to an odg file 2022-08-06 02:18:38 +02:00
TW
02580c09ea
Merge pull request #6935 from ThomasWaldmann/mkstemp_mode-master
use a custom mkstemp with mode support, fixes #6933, fixes #6400
2022-08-05 13:04:37 +02:00
TW
fecabc8215
Merge pull request #6938 from ThomasWaldmann/fix-warnings2-master
make setuptools happy, fixes #6874 (try 2, same as in 1.2-maint)
2022-08-04 18:23:46 +02:00
Thomas Waldmann
449b02742f make setuptools happy, fixes #6874 (try 2, same as in 1.2-maint)
work around setuptools puking about:

          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'borg.cache_sync' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.

          'borg.cache_sync' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).

          Please make sure that 'borg.cache_sync' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
2022-08-04 17:18:23 +02:00
Thomas Waldmann
52c47bd546 use a custom mkstemp with mode support, fixes #6933, fixes #6400
hopefully this is the final fix.

after first fixing of #6400 (by using os.umask after mkstemp), there
was a new problem that chmod was not supported on some fs.

even after fixing that, there were other issues, see the ACLs issue
documented in #6933.

the root cause of all this is tempfile.mkstemp internally using a
very secure, but hardcoded and for our use case problematic mode
of 0o600.

mkstemp_mode (mosty copy&paste from python stdlib tempfile module +
"black" formatting applied) supports giving the mode via the api,
that is the only change needed.

slightly dirty due to the _xxx imports from tempfile, but hopefully
this will be supported in some future python version.
2022-08-04 14:41:00 +02:00
TW
99c72c5f75
Merge pull request #6934 from ThomasWaldmann/fix-warnings-master
Fix warnings (master)
2022-08-04 14:08:30 +02:00
TW
23eb28d3b8
Merge pull request #6931 from ThomasWaldmann/copy-crypt-key
rename --copy-ae-key into --copy-crypt-key
2022-08-04 11:56:17 +02:00
Thomas Waldmann
0e0b33b5ff cache_sync directory: add a dummy __init__.py to get rid of setuptools warning 2022-08-04 11:55:03 +02:00
Thomas Waldmann
a7d4dd2ba6 unpack.h: fix compiler warnings, improve error handling 2022-08-04 11:20:23 +02:00
Thomas Waldmann
d003046078 hashindex.pyx: fix signedness warning 2022-08-04 10:50:38 +02:00
Thomas Waldmann
cc7984f423 _chunker.c: fix warnings on macOS
macOS does not have POSIX_FADV_DONTNEED, thus some variables are not
needed.
2022-08-04 10:46:36 +02:00
Thomas Waldmann
4ec17d969c rename --copy-ae-key into --copy-crypt-key 2022-08-04 10:32:24 +02:00
TW
afa282c977
Merge pull request #6930 from ThomasWaldmann/more-docs-updates
more docs updates
2022-08-04 10:12:02 +02:00
Thomas Waldmann
f621b21ec1 docs: update security.rst 2022-08-03 22:19:28 +02:00
Thomas Waldmann
c7c7690b26 build_man build_usage 2022-08-03 22:19:12 +02:00
Thomas Waldmann
c3345fe423 remove remainders of borg key migrate-to-repokey 2022-08-03 21:48:55 +02:00
Thomas Waldmann
78230dd299 docs: key: fix keyfile mode in example 2022-08-03 18:46:50 +02:00
Thomas Waldmann
17e75f3eea docs: transfer: talk of "related repo" 2022-08-03 18:33:02 +02:00
Thomas Waldmann
bcd7ab3dec docs: rcreate: explain "related repo" 2022-08-03 18:20:10 +02:00
TW
630097a99f
Merge pull request #6922 from ThomasWaldmann/one-crypt-key
Key: crypt_key instead of enc_key + enc_hmac_key, fixes #6611
2022-08-03 14:58:16 +02:00
Thomas Waldmann
d5df53732d increase Key.version to 2
Old borg (< 2.0) can not read/process the new keys that have crypt_key instead of enc_key and enc_hmac_key.
2022-08-03 12:25:58 +02:00
Thomas Waldmann
3ee69bc7ba Key: crypt_key instead of enc_key + enc_hmac_key, fixes #6611 2022-08-03 12:04:23 +02:00
TW
3794a3a9dc
Merge pull request #6923 from ThomasWaldmann/update-docs-master
update docs
2022-08-03 11:54:43 +02:00
Thomas Waldmann
89e4a52c56 docs: misc. updates
- remove outdated stuff
- fix infos for borg 2.0
2022-08-03 11:35:25 +02:00
TW
b0480a06d6
Merge pull request #6915 from horazont/docs/internal-details-master
docs(master): provide more details on object layout
2022-08-01 22:53:39 +02:00
TW
7fde480719
Merge pull request #6921 from ThomasWaldmann/new-ae-key
rcreate --copy-ae-key: copy AE key from key of other repo, fixes #6710
2022-08-01 15:30:58 +02:00
TW
1744c92967
Merge pull request #6919 from ThomasWaldmann/fix-delete-master
delete: remove unused option --keep-security-info
2022-08-01 15:12:06 +02:00
Thomas Waldmann
9878956140 rcreate --copy-ae-key: copy AE key from key of other repo, fixes #6710
default: create new, random authenticated encryption key.
2022-08-01 14:57:30 +02:00
TW
7222574214
Merge pull request #6920 from ThomasWaldmann/transfer-check-related
transfer: check whether ID hash method and chunker secret are same
2022-08-01 13:56:08 +02:00
Thomas Waldmann
a8dda5cb0c transfer: check whether ID hash method and chunker secret are same, fixes #6893
also: add PlaintextKey and AuthenticatedKey support to uses_same_id_hash function.
2022-08-01 13:27:47 +02:00
Thomas Waldmann
2c2afe4123 delete: remove unused option --keep-security-info
this option is only useful for deleting repos.
2022-08-01 11:41:39 +02:00
Jonas Schäfer
33b846e292 docs: update encryption drawing for new compression bytes
Since compression type identification has been split into type and
level, the graphic needed a slight update.

Unfortunately, I don't have access to Visio, so I converted this to odg.
2022-07-30 19:24:26 +02:00
Jonas Schäfer
c8ab490017 docs: provide more details on object layout
While writing my own out-of-band decoder, I had a hard time figuring out
how to unpack the manifest. From the description, I was only able to
read that the manifest is msgpack'd, but I had not been able to figure
out that it's also going through the same encryption+compression logic
as all other things do.

This should make it a little clearer and provide the necessary
information to understand how the compression works.
2022-07-30 19:24:26 +02:00
TW
c5a594688a
Merge pull request #6913 from ThomasWaldmann/prune-checkpointing-master
prune/delete --checkpoint-interval=1800 and ctrl-c/SIGINT support
2022-07-30 17:51:22 +02:00
Thomas Waldmann
0deb4352c1 prune/delete --checkpoint-interval=1800 and ctrl-c/SIGINT support, fixes #6284
manifest, repo and cache are committed every checkpoint interval.

also, when ctrl-c is pressed, finish deleting the current archive, commit and then terminate.
2022-07-30 17:24:40 +02:00
TW
762581a667
Merge pull request #6907 from ThomasWaldmann/fix-flags-formatting-master
list: fix {flags:<WIDTH>} formatting, fixes #6081
2022-07-30 15:32:34 +02:00
TW
2a4cf7c068
Merge pull request #6903 from ThomasWaldmann/fix-5719-master
check: try harder to create the key, fixes #5719
2022-07-30 15:29:47 +02:00
Thomas Waldmann
15cb54f623 list: fix {flags:<WIDTH>} formatting, fixes #6081
item.bsdflags is either not present or an int, thus we default to 0 (== no flags) if not present.
2022-07-29 10:44:37 +02:00
Thomas Waldmann
53830ecae9 check: try harder to create the key, fixes #5719
the old code did just 1 attempt to detect the repo decryption key.
if the first chunkid we got from the chunks hashtable iterator was accidentally
the id of the chunk we intentionally corrupted in test_delete_double_force,
setup of the key failed and that made the test crash.

in practice, this could of course also happen if chunks are corrupted, thus
we now do many retries with other chunks before giving up.

error handling was improved: do not return None (instead of a key), it just
leads to weird crashes elsewhere, but fail early with IntegrityError and a
reasonable error msg.

rename method to make_key to avoid confusion with borg.crypto.key.identify_key.
2022-07-29 10:34:58 +02:00
TW
e7c2506a7f
Merge pull request #6895 from ThomasWaldmann/ci-macos-master
CI: test on macOS 12 without fuse / fuse tests
2022-07-28 00:09:50 +02:00
Thomas Waldmann
ba1a26ffa5 CI: test on macOS 12 without fuse / fuse tests
too troublesome on github CI due to kernel extensions needed by macFUSE.
2022-07-27 22:31:06 +02:00
TW
61e8d9518b
Merge pull request #6784 from borgbackup/borg2
borg 2
2022-07-27 16:09:34 +02:00
Thomas Waldmann
ad7c7159b2 Merge branch 'master' into borg2 2022-07-27 13:49:50 +02:00
remyabel2
ddb805cd10
docs: add info on man page installation (#6888)
docs: add info about man page installation, fixes #6661
2022-07-27 12:48:27 +02:00
TW
19509f5fa5
Merge pull request #6889 from ThomasWaldmann/archive-progress-json-docs-master
docs: update archive_progress json description about "finished"
2022-07-27 12:47:12 +02:00
Thomas Waldmann
c7e719f209 docs: update archive_progress json description about "finished", see #6570 2022-07-25 13:05:16 +02:00
TW
a75b260fef
Merge pull request #6884 from a1346054/fixes
Fix typos and shellcheck warnings
2022-07-23 21:44:27 +02:00
Thomas Waldmann
dfbf638a5b Merge branch 'master' into borg2 2022-07-23 21:21:41 +02:00
a1346054
41d67bc449
fix shellcheck warnings in bash scripts 2022-07-22 15:52:04 +00:00
a1346054
160dd877ab
fix typos 2022-07-22 15:51:46 +00:00
TW
320190dacf
Merge pull request #6880 from ThomasWaldmann/new-crypto-no-assert-id-borg2
new crypto does not need to call ._assert_id()
2022-07-21 20:44:21 +02:00
Thomas Waldmann
b0db800b5a check: --verify-data does not need to decompress with new crypto modes 2022-07-20 15:51:33 +02:00
Thomas Waldmann
9d6c98d9f9 docs: remove _assert_id() call for new crypto 2022-07-20 14:31:37 +02:00
Thomas Waldmann
f82f123b56 new crypto does not need to call ._assert_id()
https://github.com/borgbackup/borg/pull/6463#discussion_r925436156
2022-07-20 14:13:25 +02:00
TW
b52781a999
Merge pull request #6876 from LocutusOfBorg/fix-template
Fix pyproject.toml to create a fixed _version.py file, compatible wi…
2022-07-18 19:42:32 +02:00
Gianfranco Costamagna
a92c156e05 Fix pyproject.toml to create a fixed _version.py file, compatible with both old and new setuptools_scm version (see: #6875) 2022-07-18 18:56:59 +02:00
TW
0037375148
Merge pull request #6869 from ThomasWaldmann/rel200a4
release 2.0.0a4
2022-07-17 16:03:45 +02:00
Thomas Waldmann
357aa5241b build_usage / build_man 2022-07-17 09:23:06 +02:00
TW
d9f72b6ed2
Merge pull request #6866 from ThomasWaldmann/update-changes-borg2
update CHANGES
2022-07-17 08:48:14 +02:00
Thomas Waldmann
32a7896573 update CHANGES 2022-07-16 23:16:39 +02:00
TW
17e74caccd
Merge pull request #6864 from ThomasWaldmann/remove-tilde-otheruser-borg2
ssh:// URLs: remove support for /~otheruser/, see #6855
2022-07-16 18:53:28 +02:00
Thomas Waldmann
47c2672a64 ssh:// URLs: remove support for /~otheruser/, see #6855
If you used this, just replace it by:

ssh://user@host:port/home/otheruser/
2022-07-15 16:02:45 +02:00
TW
65703df839
Merge pull request #6862 from ThomasWaldmann/mypy-borg2
add mypy
2022-07-15 15:23:07 +02:00
Thomas Waldmann
b8e48c5036 mypy: fixes / annotations 2022-07-15 14:54:48 +02:00
Thomas Waldmann
366ef73f88 mypy: rename yes module to yes_no to avoid name collision 2022-07-15 14:46:18 +02:00
Thomas Waldmann
f71f26ddfd mypy: fix platform package
clean up imports, remove unused stuff
2022-07-15 13:15:11 +02:00
Thomas Waldmann
b07aeef498 add mypy checking
also added some .pyi files needed to check the cython code (taken from #5703 and updated).

fixed "syntax error" in key.py.

all mypy complaints not fixed yet.
2022-07-15 12:49:38 +02:00
TW
c5fa64a9a4
Merge pull request #6860 from ThomasWaldmann/remove-legacy-cleanup-borg2
remove legacy_cleanup
2022-07-13 18:18:04 +02:00
TW
d5c91cd37b
Merge pull request #6859 from ThomasWaldmann/remove-attic-stuff-borg2
remove remainders of attic legacy
2022-07-13 18:17:47 +02:00
TW
b37f660d8b
Merge pull request #6858 from ThomasWaldmann/remove-scp-tilde-expansion-borg2
we remove scp style, also remove it for tilde expansion, fixes #6856
2022-07-13 18:16:57 +02:00
Thomas Waldmann
2d2f468410 remove legacy_cleanup
not needed any more.
2022-07-13 17:06:52 +02:00
Thomas Waldmann
7bc7f01342 remove remainders of attic legacy
we expect that everybody has upgraded to borg
using borg 1.2.x or older, thus we do not need
to care about attic repos any more in borg2.
2022-07-13 16:55:29 +02:00
Thomas Waldmann
1de12eacb7 we remove scp style, also remove it for tilde expansion, fixes #6856 2022-07-13 16:42:46 +02:00
TW
ca74118b61
Merge pull request #6849 from ThomasWaldmann/update-changes-borg2
update CHANGES
2022-07-09 16:58:27 +02:00
TW
a3035270da
Merge pull request #6848 from ThomasWaldmann/split-archiver
split archiver
2022-07-09 16:58:13 +02:00
Thomas Waldmann
55a5c5867a update CHANGES 2022-07-09 15:34:15 +02:00
Thomas Waldmann
ea6b373f85 move common options definition to archiver.common 2022-07-09 15:13:13 +02:00
Thomas Waldmann
b2fb334af0 sort build_parser calls / mixins 2022-07-09 15:13:13 +02:00
Thomas Waldmann
70b54a696f move create command to archiver.create 2022-07-09 15:13:13 +02:00
Thomas Waldmann
c871dbd8a5 move recreate command to archiver.recreate 2022-07-09 15:13:13 +02:00
Thomas Waldmann
ae6ef77495 move extract command to archiver.extract 2022-07-09 15:13:13 +02:00
Thomas Waldmann
e05f7971da move build_filter/build_matcher to archiver.common 2022-07-09 15:13:13 +02:00
Thomas Waldmann
e57f3bb424 move info command to archiver.info 2022-07-09 15:13:13 +02:00
Thomas Waldmann
4d5a89ebc3 move rinfo command to archiver.rinfo 2022-07-09 15:13:13 +02:00
Thomas Waldmann
add73745c6 move rlist command to archiver.rlist 2022-07-09 15:13:13 +02:00
Thomas Waldmann
b959ff913a move list command to archiver.list_cmd
note: can't be named "archiver.list" due to collision with builtin type "list".
2022-07-09 15:13:13 +02:00
Thomas Waldmann
382b37ef60 move list command to archiver.list 2022-07-09 15:13:13 +02:00
Thomas Waldmann
350a8fe252 move delete command to archiver.delete 2022-07-09 15:13:13 +02:00
Thomas Waldmann
06fe8d3e64 move rename command to archiver.rename 2022-07-09 15:13:13 +02:00
Thomas Waldmann
a31332ddb5 move rdelete command to archiver.rdelete 2022-07-09 15:13:13 +02:00
Thomas Waldmann
94aec46a01 move rcreate command to archiver.rcreate 2022-07-09 15:13:12 +02:00
Thomas Waldmann
ff411b5d98 move serve command to archiver.serve 2022-07-09 15:13:12 +02:00
Thomas Waldmann
68772484ce move mount/umount/borgfs command to archiver.mount 2022-07-09 15:13:12 +02:00
Thomas Waldmann
2ff2927aa3 move check command to archiver.check 2022-07-09 15:13:12 +02:00
Thomas Waldmann
df57d33b5f move compact command to archiver.compact 2022-07-09 15:13:12 +02:00
Thomas Waldmann
9fb224db6b move diff command to archiver.diff 2022-07-09 15:13:12 +02:00
Thomas Waldmann
ea03562b11 move prune command to archiver.prune 2022-07-09 15:13:12 +02:00
Thomas Waldmann
94e6477e51 move config command to archiver.config 2022-07-09 15:13:12 +02:00
Thomas Waldmann
8d9e47e374 move transfer command to archiver.transfer 2022-07-09 15:13:12 +02:00
Thomas Waldmann
6d60976c51 move help commands to archiver.help 2022-07-09 15:13:12 +02:00
Thomas Waldmann
f906d9d246 move locking commands to archiver.locks 2022-07-09 15:13:12 +02:00
Thomas Waldmann
af2ee7aeb1 move key commands to archiver.keys 2022-07-09 15:13:12 +02:00
Thomas Waldmann
5ea9fb73db move benchmark commands to archiver.benchmarks 2022-07-09 15:13:12 +02:00
Thomas Waldmann
27b63e7c48 move tar commands to archiver.tar 2022-07-09 15:13:12 +02:00
Thomas Waldmann
890d5950e7 move debug commands to archiver.debug 2022-07-09 15:13:12 +02:00
Thomas Waldmann
227ecb5b8e transform archiver module into a package 2022-07-07 22:40:27 +02:00
TW
a45ce6dcfe
Merge pull request #6842 from ThomasWaldmann/black
Use Black for automated code formatting
2022-07-07 22:35:13 +02:00
TW
2418795ed1
Merge pull request #6197 from hexagonrecursion/expect
Automate asciinema screencasts
2022-07-06 23:55:23 +02:00
Thomas Waldmann
45b3f6418d update ascinemacasts 2022-07-06 23:46:14 +02:00
Thomas Waldmann
0f5fb7d38d use borg 1.2.1 2022-07-06 23:34:35 +02:00
Andrey Bienkowski
1e83415c51 Screencasts/advanced: start where basic left off 2022-07-06 17:21:31 +02:00
Andrey Bienkowski
5e8e10a53c Screencasts/basic: use sample data 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
6e197f66f5 Screencasts: add wallpaper download urls
We need some sample data to propoerly demo the backup.

I have selected 30 random wallpapers form wikimedia commons
2022-07-06 17:19:10 +02:00
Andrey Bienkowski
1c10eabc80 rm advanced.sh 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
1cf184dfda Screencasts/advanced: type slowly 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
828a969174 Screencasts/advanced: do not print "spawn /bin/sh" 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
06a19dd87b Screencasts/advanced: fix the key export example
The previous example had an incorrect sequence of arguments
in the --qr-html case. I have also updated --paper
for consistency
2022-07-06 17:19:10 +02:00
Andrey Bienkowski
62d77454b2 Screencasts: do not start screencasts with "exit"
vagrant is magic: sometimes it decides to type "exit" into stdin
2022-07-06 17:19:10 +02:00
Andrey Bienkowski
aae1b439e4 Screencasts/install: do not timeout due to slow wget 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
9b9294d940 Screencasts: do not redownload borg 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
3391236d00 Update the screencasts 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
df0e8599de Automate the advanced usage screencast 2022-07-06 17:19:10 +02:00
Andrey Bienkowski
bff922a9ba Screencasts: improve the README 2022-07-06 17:19:10 +02:00
Thomas Waldmann
ee20262fea add .git-blame-ignore-revs 2022-07-06 16:35:31 +02:00
Thomas Waldmann
2e063a9c44 docs: using black for code formatting 2022-07-06 16:35:31 +02:00
Thomas Waldmann
7957af562d blacken all the code
https://black.readthedocs.io/
2022-07-06 16:34:38 +02:00
Thomas Waldmann
7f8f671102 add requirements.d/codestyle.txt with the preferred black version 2022-07-06 16:34:38 +02:00
Andrey Bienkowski
adb1c36215 black integration 2022-07-06 14:55:40 +02:00
TW
7973fc5ec2
Merge pull request #6841 from ThomasWaldmann/fix-codeql
codeql: empty env section is invalid
2022-07-06 14:21:46 +02:00
Thomas Waldmann
a1acc00a90 codeql: empty env section is invalid 2022-07-06 14:20:36 +02:00
TW
80289215d6
Merge pull request #6837 from ThomasWaldmann/recreate-recompress-considering-level
recreate: consider level for recompression, fixes #6698, fixes #3622
2022-07-06 14:11:06 +02:00
TW
1905f6289d
Merge pull request #6839 from ThomasWaldmann/hlid-docs
document hlid, fixes #2388
2022-07-06 14:08:07 +02:00
Thomas Waldmann
5e0c4a8fd4 document hlid, fixes #2388 2022-07-05 22:27:08 +02:00
TW
dbb9f62afd
Merge pull request #6836 from ThomasWaldmann/cleanups
Cleanups
2022-07-05 02:46:43 +02:00
TW
cb5b1d7dcb
Merge pull request #6834 from ThomasWaldmann/remove-libdeflate
stop using libdeflate
2022-07-05 02:46:27 +02:00
Thomas Waldmann
0dc25000a9 recreate: consider level for recompression, fixes #6698, fixes #3622 2022-07-05 02:38:09 +02:00
Thomas Waldmann
dbb63f874b docs: fix rst literal blocks 2022-07-05 00:38:37 +02:00
Thomas Waldmann
dbe62b8074 docs: replaced tabs by spaces 2022-07-05 00:32:57 +02:00
Thomas Waldmann
ff46a03b42 use language_level = 3str for cython
this will be the default in cython 3.
2022-07-05 00:16:48 +02:00
Thomas Waldmann
f04b2bd255 remove coding: from cython files, utf-8 is default encoding 2022-07-05 00:08:51 +02:00
Thomas Waldmann
350393c9fd remove unused imports 2022-07-05 00:05:07 +02:00
Thomas Waldmann
5c8a5f111f stop using libdeflate
borg2's new repo format does not need computing crc32 over big amounts of
(content) data any more (we now use xxh64 for that).

thus, having a quick crc32 implementation via libdeflate is not important
enough any more to rectify having libdeflate as a requirement.
2022-07-04 20:33:59 +02:00
TW
820a927b06
Merge pull request #6832 from ThomasWaldmann/rel200a3
release 2.0.0a3
2022-07-04 17:21:49 +02:00
Thomas Waldmann
0264f8dc92 fix benchmark tests 2022-07-04 14:53:31 +02:00
Thomas Waldmann
6fa8d11ecc build_usage ; build_man 2022-07-04 14:09:19 +02:00
Thomas Waldmann
907ffbecfa update CHANGES 2022-07-04 14:09:19 +02:00
Thomas Waldmann
c7ed985ffd Merge branch 'master' into borg2 2022-07-02 23:28:39 +02:00
TW
f9d68050d6
Merge pull request #6829 from ThomasWaldmann/remove-deprecated-stuff-borg2
remove deprecated stuff
2022-07-02 22:42:43 +02:00
Thomas Waldmann
0dac106812 remove deprecated --remote-buffer
--remote-buffer is deprecated since 1.2.

there is --upload-buffer for the same purpose.
2022-07-02 22:09:55 +02:00
Thomas Waldmann
1b88eb67e0 remove deprecated --remote-ratelimit
--remote-ratelimit is deprecated since 1.2.

there is --upload-ratelimit for the same purpose.
2022-07-02 22:08:19 +02:00
Thomas Waldmann
79696429b4 remove deprecated --numeric-owner
--numeric-owner is deprecated since 1.2.

there is --numeric-ids for the same purpose.
2022-07-02 22:05:47 +02:00
Thomas Waldmann
1196d14f45 remove deprecated --nobsdflags
--nobsdflags is deprecated since 1.2.

there is --flags for the same purpose.
2022-07-02 22:00:13 +02:00
Thomas Waldmann
d8735450c5 remove deprecated --noatime
not storing atime is the default since 1.2.
--noatime is deprecated since 1.2.

there is --atime if you want to store the atime.
2022-07-02 21:55:45 +02:00
TW
ac0e725815
Merge pull request #6828 from ThomasWaldmann/remove-prefix-option-borg2
remove -P (aka --prefix) option, fixes #6806
2022-07-02 21:48:02 +02:00
Thomas Waldmann
6888d5dcb2 remove -P (aka --prefix) option, fixes #6806
-a (aka --glob-archives) can be used for same purpose and is more powerful.
2022-07-02 20:52:41 +02:00
TW
01d40057db
Merge pull request #6827 from ThomasWaldmann/repo-info-borg2
check repo version / borg rinfo extended
2022-07-02 20:49:40 +02:00
TW
dff33f61d7
Merge pull request #6825 from ThomasWaldmann/fix-progress-percent-docs-master
docs: json progress_percent: some values are optional, fixes #4074
2022-07-02 20:21:24 +02:00
Thomas Waldmann
ea4ed6b98f docs: json progress_percent: some values are optional, fixes #4074
in the finished == true message, these are missing:
- message
- current / total
- info

This is to be somewhat consistent with #6683 by only providing a
minimal set of values for the finished case.

The finished messages is primarily intended for cleanup purposes,
e.g. clearing the progress display.
2022-07-01 14:35:44 +02:00
Thomas Waldmann
a7870ab5bd only accept old repos for --other-repo (e.g. rcreate/transfer)
we do not want to run the new borg code against old repos.

if you want to e.g. check an old repo, use an old borg version.
2022-07-01 00:30:01 +02:00
Thomas Waldmann
b0b5a2fd27 add repository.info(), giving some basic repo infos
there was no way to tell the repository version for a remote repo.
borg 2 needs that to reject doing most operations with an old repo,
except the stuff needed for borg transfer.
2022-06-30 23:55:51 +02:00
TW
2ab254cea0
Merge pull request #6821 from ThomasWaldmann/remove-legacy-repo-creation-borg2
rcreate: remove legacy crypto for new repos, fixes #6490
2022-06-30 21:33:46 +02:00
TW
f649b9f16f
Merge pull request #6818 from ThomasWaldmann/fix-hashindex-compact-master
hashindex_compact: fix eval order (check idx before use), fixes #5899
2022-06-30 20:57:17 +02:00
Thomas Waldmann
eabad3e3b7 rcreate: always use argon2 kdf for new repos, fixes #6820
this way, we can remove the legacy pbkdf2 key code in next release.
2022-06-30 20:52:48 +02:00
Thomas Waldmann
ef24dafb15 tests: use less RepoKey/KeyfileKey 2022-06-30 20:52:48 +02:00
Thomas Waldmann
dc2f2f47a8 rcreate: remove legacy encryption modes for new repos, fixes #6490
These are legacy crypto modes based on AES-CTR mode:
(repokey|keyfile)[-blake2]

New crypto modes with session keys and AEAD ciphers:

(repokey|keyfile)[-blake2]-(aes-ocb|chacha20-poly1305)

Tests needed some changes:
- most used repokey/keyfile, changed to new modes
- some nonce tests removed, the new crypto code does not generate
  the repo side nonces any more (were only used for AES-CTR)
2022-06-30 20:52:48 +02:00
Thomas Waldmann
2157a35212 hashindex_compact: fix eval order (check idx before use), fixes #5899
also: fix "off by one" comment
2022-06-29 20:12:29 +02:00
TW
241a56704b
Merge pull request #6815 from fantasya-pbem/docs/6572_mount-limitations
[DOCS] #6572 - Document FUSE limitations better
2022-06-29 19:46:57 +02:00
TW
677de50364
Merge pull request #6813 from ThomasWaldmann/other-repo-accepts-v1-repo
support repo version 1 also, fixes #6811
2022-06-29 18:54:43 +02:00
Thalian
e492c2281d [DOCS] #6572 - Document FUSE limitations better 2022-06-29 18:50:30 +02:00
Thomas Waldmann
8ebdb0b024 support repo version 1 also, fixes #6811
v2 is the default repo version for borg 2.0.
v1 repos must only be used in a read-only way, e.g. for
--other-repo=V1_REPO with borg init and borg transfer!
2022-06-29 17:31:50 +02:00
TW
e577ccb094
Merge pull request #6755 from fantasya-pbem/docs/5960_FAQ-quota-size
[DOCS] #5960 - FAQ: Full quota / full disk
2022-06-29 14:42:11 +02:00
TW
a44dbc1dc8
Merge pull request #6809 from ThomasWaldmann/refactor-transfer-upgrades-borg2
transfer: use an Upgrader class
2022-06-28 22:40:28 +02:00
Thomas Waldmann
f7ef674f29 fix memoryview/bytes issue in upgrader 2022-06-28 22:11:09 +02:00
Thomas Waldmann
5d8b29a93f transfer: --upgrader=NoOp is the default
This is to support general-purpose transfer of archives between related
borg2 repos.

To transfer (and convert) archives from borg 1.2 repos, users need to
give --upgrader=From12To20 .
2022-06-28 22:11:09 +02:00
TW
f2d276a892
Merge pull request #6808 from ThomasWaldmann/no-symlinked-hardlinks-macos-borg2
macOS does not support hardlinking symlinks, fixes #6802
2022-06-28 22:08:28 +02:00
TW
2fd01aaf89
Merge pull request #6810 from ThomasWaldmann/remove-old-upgrader-remainders-borg2
remove remainders of old borg/attic upgrader
2022-06-28 16:30:11 +02:00
Thomas Waldmann
b5aebcc253 remove remainders of old borg/attic upgrader 2022-06-28 15:47:35 +02:00
Thomas Waldmann
f749d0dccf macOS does not support hardlinking symlinks, fixes #6802 2022-06-28 13:35:36 +02:00
TW
6ebcfb7490
Merge pull request #6803 from ThomasWaldmann/fix-docs-borg2
borg2: fix docs
2022-06-26 23:01:34 +02:00
Thomas Waldmann
0a7baa53c4 docs: fix borg transfer formatting / rendering, fixes #6800 2022-06-26 20:29:10 +02:00
Thomas Waldmann
e2f7087aa8 docs: remove reference to borg upgrade 2022-06-26 20:09:54 +02:00
Thomas Waldmann
9680538a70 fix rendering of list/rlist help 2022-06-26 20:08:38 +02:00
Thomas Waldmann
a98c6ba479 changes: init -> rcreate 2022-06-26 19:59:08 +02:00
TW
70cc578fc2
Merge pull request #6795 from ThomasWaldmann/rel200a2
release 2.0.0 alpha 2
2022-06-26 16:38:36 +02:00
Thomas Waldmann
ab25bf8175 build_usage build_man 2022-06-26 13:56:33 +02:00
Thomas Waldmann
20bf97a8a4 CHANGES: set release date, formatting 2022-06-26 13:52:47 +02:00
TW
b157573c69
Merge pull request #6793 from ThomasWaldmann/more-fixes-borg2
more fixes/updates for borg2
2022-06-26 02:16:57 +02:00
Thomas Waldmann
3232cb4a7e transfer: add a specific transfer example 2022-06-26 01:22:28 +02:00
Thomas Waldmann
391178e68e update CHANGES 2022-06-26 01:03:58 +02:00
Thomas Waldmann
d15791e45f authors: remove 3rd party lib authors
we do not include the source code of these libs any more.
2022-06-26 00:30:13 +02:00
Thomas Waldmann
dbae8e60eb remove borg upgrade 2022-06-26 00:25:44 +02:00
Thomas Waldmann
3fbb297fd7 compact: remove --cleanup-commits
this was a one-time fix only needed for borg 1.2.

users are expected to use borg 1.2 to cleanup the commits.
2022-06-26 00:07:07 +02:00
TW
162035da91
Merge pull request #6790 from ThomasWaldmann/update-docs-borg2
borg2: update docs
2022-06-25 23:40:04 +02:00
TW
e535a99c7a
Merge pull request #6792 from ThomasWaldmann/check-always-glob-borg2
borg check: remove --name, better use -a
2022-06-25 22:59:25 +02:00
Thomas Waldmann
c36c75db59 borg check: remove --name, better use -a
The glob can also match precisely one archive,
so this does the same with less code.
2022-06-25 22:17:29 +02:00
Thomas Waldmann
51cf85e627 build_usage / build_man / doc updates 2022-06-25 21:58:19 +02:00
Thomas Waldmann
7f99aa155e update CHANGES, split changelog by major version 2022-06-25 21:58:19 +02:00
Thalian
036eb97f03 [DOCS] #5960 - FAQ: Full quota / full disk 2022-06-24 17:55:14 +02:00
TW
b14bf8110f
Merge pull request #6785 from ThomasWaldmann/new-info
simplified stats
2022-06-23 23:01:52 +02:00
TW
fdfce3d0a8
Merge pull request #6788 from ThomasWaldmann/chmod-optional-master
SaveFile: the chmod is optional, fixes #6786
2022-06-23 18:09:52 +02:00
Thomas Waldmann
4e4bfd27d0 SaveFile: the chmod is optional, fixes #6786
some filesystems do not support chmod, just ignore if it is failing.
2022-06-23 17:44:44 +02:00
Thomas Waldmann
31a081f695 simplify stats output
also:
- move stats related stuff to Statistics class
- repo ops give repo / overall stats
- archive ops give archive stats
- adapt tests
2022-06-23 16:00:12 +02:00
Thomas Waldmann
16b91a41ad fix accidental nesting of subparsers
python 3.11-dev threw a warning that this is deprecated.
2022-06-23 12:08:30 +02:00
Thomas Waldmann
e0c64629d1 Merge branch 'master' into borg2
strange conflicts, automated patches seemed to not have applied correctly.
also had to fix some stuff manually, tests were failing.
2022-06-23 11:25:01 +02:00
TW
d039f2685a
Merge pull request #6766 from ThomasWaldmann/split-repo-archive
borg2: split repo and archive name into separate args, fixes #948
2022-06-23 10:20:11 +02:00
Thomas Waldmann
f578c20b22 fix benchmark tests 2022-06-23 09:50:48 +02:00
Thomas Waldmann
d00d650d88 borg init -> borg rcreate
this is to complement borg rdelete, see also borg create / delete.
2022-06-23 09:16:29 +02:00
TW
1576859ec0
Merge pull request #6780 from ThomasWaldmann/paths-from-normpath-master
create --paths-from-(stdin|command): normalize paths, fixes #6778
2022-06-22 00:20:34 +02:00
Thomas Waldmann
34b6248d75 borg delete -a ARCH_GLOB, borg rdelete 2022-06-21 23:05:44 +02:00
Thomas Waldmann
9e5a8a352f borg info -a ARCH_GLOB, borg rinfo 2022-06-21 23:05:44 +02:00
Thomas Waldmann
1bf8f71e69 borg list ARCHIVE, borg rlist 2022-06-21 23:05:44 +02:00
Thomas Waldmann
6addafd784 borg mount -a ARCHIVE_GLOB mountpoint ... 2022-06-21 23:05:44 +02:00
Thomas Waldmann
e6a8984c99 borg (import|export)-tar NAME ... 2022-06-20 20:17:29 +02:00
Thomas Waldmann
1ed7e5b292 borg dump-archive NAME / dump-archive-items NAME 2022-06-20 20:17:29 +02:00
Thomas Waldmann
75b53de37e borg diff ARCH1 ARCH2 2022-06-20 20:17:29 +02:00
Thomas Waldmann
b8c7c53dde borg extract NAME ... 2022-06-20 20:17:29 +02:00
Thomas Waldmann
f8d2024578 borg recreate -a ARCHIVE_GLOB ... 2022-06-20 20:17:29 +02:00
Thomas Waldmann
3fd5b73e1e borg create NAME ... 2022-06-20 20:17:28 +02:00
Thomas Waldmann
c085c2744b borg rename NAME NEWNAME 2022-06-20 15:18:24 +02:00
Thomas Waldmann
28b32e7a57 create --paths-from-(stdin|command): normalize paths, fixes #6778 2022-06-20 14:21:37 +02:00
Thomas Waldmann
206245f3cd --repo: add -r short option 2022-06-16 15:41:37 +02:00
Thomas Waldmann
801ce819a3 help: archive name 2022-06-16 14:32:40 +02:00
Thomas Waldmann
3e765522de help: transfer from other repo 2022-06-16 14:23:47 +02:00
Thomas Waldmann
7dbf125083 Location: remove archive name 2022-06-16 14:18:47 +02:00
Thomas Waldmann
281bbbc16b fix tests and benchmarks 2022-06-16 14:18:39 +02:00
Thomas Waldmann
0f0cd24354 if --(other-)repo option is not given, use default from environment
remove tests composing a repo+archive location with repo from env
and location from cli.
2022-06-16 14:14:54 +02:00
Thomas Waldmann
1bf2a6a240 remove archive checks from location_validator, use --other-repo 2022-06-15 17:07:42 +02:00
Thomas Waldmann
1c707b7da2 cli: use --repo option instead of positional repo parameter
currently still with ::archive appended.
2022-06-15 16:36:56 +02:00
TW
9e5062c015
Merge pull request #6774 from ThomasWaldmann/fix-selftest-count-borg2
borg2: misc small fixes
2022-06-14 16:57:26 +02:00
TW
a3a1974c52
Merge pull request #6773 from wizeman/fix-obfuscate
fix test_obfuscate byte accounting
2022-06-14 15:43:30 +02:00
Thomas Waldmann
c01f3527e5 fix linter errors 2022-06-14 15:42:30 +02:00
Thomas Waldmann
72994a4432 also test pull requests against borg2 branch 2022-06-14 15:40:09 +02:00
Thomas Waldmann
f9132687e3 fix selftest count 2022-06-14 15:17:30 +02:00
Ricardo M. Correia
18f70be0e3 fix test_obfuscate byte accounting 2022-06-14 14:55:02 +02:00
TW
dc4a1e6d2d
Merge pull request #6705 from ThomasWaldmann/repoindex
borg2: repoindex improvements
2022-06-14 14:51:18 +02:00
Thomas Waldmann
e5ea016115 repository: set/query flags, iteration over flagged items (NSIndex)
use this to query or set/clear flags in the "extra" word.

also: remove direct access to the "extra" word, adapt tests.
2022-06-14 14:48:56 +02:00
Thomas Waldmann
bf9f42320e repository: sync write file in get_fd
this fixes a strange test failure that did not happen until now:
it could not read the MAGIC bytes from a (quite new) segment file,
it just returned the empty string.

maybe its appearance is related to the removed I/O calls.
2022-06-14 14:48:56 +02:00
Thomas Waldmann
3ce3fbcdff repository index: add payload size (==csize) and flags to NSIndex entries
This saves some segment file random IO that was previously necessary
just to determine the size of to be deleted data.

Keep old one as NSIndex1 for old borg compatibility.
Choose NSIndex or NSIndex1 based on repo index layout from HashHeader.

for an old repo index repo.get(key) returns segment, offset, None, None
2022-06-14 14:48:56 +02:00
TW
fc8a289647
Merge pull request #6763 from ThomasWaldmann/remove-csize
borg2: there is no csize
2022-06-14 12:15:56 +02:00
TW
9747ce459b
Merge pull request #6770 from ThomasWaldmann/safe-secure-erase-master
secure_erase: avoid collateral damage, fixes #6768
2022-06-13 19:41:23 +02:00
TW
e380136ae6
Merge pull request #6772 from sergeyklay/patch-1
Use license_files instead of license_file
2022-06-13 19:38:08 +02:00
Serghei Iakovlev
928d2925bb
Use license_files instead of license_file
Closes #6727

See: https://github.com/pypa/setuptools/pull/2620
2022-06-13 16:09:38 +02:00
Thomas Waldmann
ba1f8926cc secure_erase: avoid collateral damage, fixes #6768
if a hardlink copy of a repo was made and a new repo config
shall be saved, do NOT fill in random garbage before deleting
the previous repo config, because that would damage the hardlink
copy.
2022-06-13 15:57:01 +02:00
Thomas Waldmann
1393e4f391 remove csize references from docs 2022-06-12 18:01:57 +02:00
Thomas Waldmann
75ad3b8e35 remove csize expectation from do_transfer upgrade_item
the size is already remove via Item._update_internal method.
2022-06-12 17:50:12 +02:00
TW
a4fc8a29f4
Merge pull request #6764 from targhs/doc/correct-installation-shell-syntax
Correct shell syntax for installation using git
2022-06-12 17:20:48 +02:00
Thomas Waldmann
822aefc7b0 re-add dsize placeholder 2022-06-12 17:15:13 +02:00
Thomas Waldmann
49adb77157 calc_stats: deduplicated size now, was deduplicated csize
also: remove pre12_meta cache
2022-06-12 17:15:13 +02:00
Thomas Waldmann
19dfbe5c5c compute the deduplicated size before compression
so we do not need csize for it.
2022-06-12 17:15:13 +02:00
Thomas Waldmann
1fd571a4d0 fix comments 2022-06-12 17:15:13 +02:00
Thomas Waldmann
2c1f7951c4 remove csize from ChunkIndexEntry 2022-06-12 17:15:13 +02:00
targhs
35c031ed2c Correct shell syntax for installation using git 2022-06-12 20:19:31 +05:30
Thomas Waldmann
b82a39c3b3 remove csize from stats_against() 2022-06-12 15:48:33 +02:00
Thomas Waldmann
0211948cac remove csize from summarize return tuple 2022-06-12 15:48:33 +02:00
Thomas Waldmann
b726aa5665 remove csize support from get_size 2022-06-12 15:48:33 +02:00
Thomas Waldmann
ace5957524 remove csize from item.chunks elements 2022-06-12 15:48:33 +02:00
Thomas Waldmann
b9f9623a6d prepare to remove csize (set it to 0 for now) 2022-06-12 15:48:33 +02:00
TW
a55f3f7285
Merge pull request #6762 from Maltimore/docs_line_continuation
[DOCS] Remove unnecessary/dangerous line continuation
2022-06-11 20:17:55 +02:00
Maltimore
4902398554 [DOCS] Remove unnecessary/dangerous line continuation 2022-06-10 21:21:52 +03:00
TW
2c9be35886
Merge pull request #6704 from ThomasWaldmann/msgpack-str-bytes-cleanup
borg2: cleanup msgpack related str/bytes mess
2022-06-09 18:18:13 +02:00
Thomas Waldmann
d4ee968b07 use borg 2.0 to refer to this, not 1.3
also, some type conversions are now done in update_internal once,
not in the decode methods of the classes in item.pyx.
2022-06-09 18:13:40 +02:00
Thomas Waldmann
08228fbd32 Item: remove unused hardlink_masters param 2022-06-09 17:57:28 +02:00
Thomas Waldmann
421d4bdfb0 docs: fix bytes -> str in data-structures docs 2022-06-09 17:57:28 +02:00
Thomas Waldmann
58009f6773 Key: fix once, remove decode=... 2022-06-09 17:57:28 +02:00
Thomas Waldmann
ed22f721f3 EncryptedKey: fix once, remove decode=... 2022-06-09 17:57:28 +02:00
Thomas Waldmann
f2b085787b Item: disallow None value for .user/group/chunks/chunks_healthy
If we do not know the value, just do not have that key/value pair in the item.
2022-06-09 17:57:28 +02:00
Thomas Waldmann
64cc16a9f4 Item: fix xattr processing
Item.xattrs is now always a StableDict mapping bytes keys -> bytes values.

The special casing of empty values (b'') getting replaced by None was removed.
2022-06-09 17:57:28 +02:00
Thomas Waldmann
9d684120a2 Item: assert type also in property getter
also: fixed Item.xattrs to be StableDict (not just a dict, as the
msgpack unpacker gives us)
2022-06-09 17:57:28 +02:00
Thomas Waldmann
7b138cc710 Item: convert timestamps once, get rid of bigint code 2022-06-09 17:57:28 +02:00
Thomas Waldmann
8e58525fc6 Item: remove some decode= params
update_internal() makes sure they have the desired type already.
2022-06-09 17:57:28 +02:00
Thomas Waldmann
655c1b9cc2 update docstrings / comments 2022-06-09 17:57:28 +02:00
Thomas Waldmann
33444be926 more str vs bytes fixing 2022-06-09 17:57:28 +02:00
Thomas Waldmann
8e87f1111b cleanup msgpack related str/bytes mess, fixes #968
see ticket and borg.helpers.msgpack docstring.

this changeset implements the full migration to
msgpack 2.0 spec (use_bin_type=True, raw=False).

still needed compat to the past is done via want_bytes decoder in borg.item.
2022-06-09 17:57:28 +02:00
Thomas Waldmann
f8dbe5b542 cleanup msgpack related str/bytes mess, see #968
see ticket and borg.helpers.msgpack docstring.
2022-06-09 17:57:28 +02:00
TW
86fe8bdd57
Merge pull request #6703 from ThomasWaldmann/r2r-transfer
borg2: "borg transfer" cmd (and also getting rid of legacy)
2022-06-09 17:56:03 +02:00
Thomas Waldmann
c5540c2dd9 upgrade compressed chunk: fix treatment of ObfuscateSize chunks
the inner payload of ObfuscateSize chunks are compressed chunks and need
the same zlib fix and level patching as non-obfuscated compressed chunks.
2022-06-09 17:49:16 +02:00
Thomas Waldmann
72c68c49d0 obfuscation: fix byte order for size, fixes #6701 2022-06-09 17:49:16 +02:00
Thomas Waldmann
6584a92c81 compression: use the 2 bytes for type and level, fixes #6698
adapt borg transfer, transferred chunks are set to compression level "unknown".
2022-06-09 17:49:16 +02:00
Thomas Waldmann
32a3601e4a compute hlid from inode / device 2022-06-09 17:49:16 +02:00
Thomas Waldmann
8798b0340a use whitelist approach to make sure item._dict is clean 2022-06-09 17:49:16 +02:00
Thomas Waldmann
d3dfa3be30 use version 2 for new archives
but still be able to read v1 archives
for borg transfer.
2022-06-09 17:49:16 +02:00
TW
0e8c9941bb
Merge pull request #6747 from fantasya-pbem/docs/4776_FAW-swapped-targets
[DOCS] #4776 - FAQ: How to swap backup media
2022-06-05 18:20:36 +02:00
TW
eed5038922
Merge pull request #6750 from ThomasWaldmann/update-changes-rel1118-master
update CHANGES with 1.1.18 changelog
2022-06-05 18:09:03 +02:00
Thalian
c7c98ca0fd [DOCS] #4776 - FAQ: How to swap backup media
fixes #4776
2022-06-05 18:05:16 +02:00
Thomas Waldmann
7634426195 update CHANGES with 1.1.18 changelog 2022-06-05 17:47:41 +02:00
TW
4ff0a29209
Merge pull request #6741 from fantasya-pbem/docs/5310_overhaul-help-patterns
docs: overhaul borg help patterns, fixes #5310
2022-06-05 10:36:33 +02:00
Thalian
421a7ef52f [DOCS] #5310 - Overhaul borg help patterns
fixes #5310
2022-06-05 09:02:04 +02:00
TW
34bb4d904b
Merge pull request #6743 from ThomasWaldmann/msgpack104-master
msgpack 1.0.4 / py 3.11 (master)
2022-06-03 10:36:59 +02:00
Thomas Waldmann
c07afb26e4 add python 3.11 to pypi metadata 2022-06-03 10:05:04 +02:00
Thomas Waldmann
18a7debf75 CI: also test on python 3.11-dev 2022-06-03 10:05:04 +02:00
Thomas Waldmann
a970f000b0 allow msgpack 1.0.4, fixes #6716 2022-06-03 10:03:49 +02:00
TW
c4b05c18e0
Merge pull request #6739 from ThomasWaldmann/vagrant-updates-master
Vagrant updates (master)
2022-06-01 20:31:16 +02:00
Thomas Waldmann
de4b9198c3 vagrant: use python 3.9.13 for binary build 2022-06-01 19:56:52 +02:00
Thomas Waldmann
c00c48a27b vagrant: use pyinstaller 4.10
when installed via pip, this automatically build the bootloader now.
2022-06-01 19:54:48 +02:00
Thomas Waldmann
bd005c11a2 vagrant/testing: upgrade development.lock.txt
esp. the Cython version upgrade to 0.29.30 is important for python 3.11.
2022-06-01 19:54:11 +02:00
Elmar Hoffmann
c2317c4cce
make constants for files cache mode more clear (#6724)
* make constants for files cache mode more clear

Traditionally, DEFAULT_FILES_CACHE_MODE_UI and DEFAULT_FILES_CACHE_MODE
were - as the naming scheme implies - the same setting, one being the UI
representation as given to the --files-cache command line option and the
other being the same default value in the internal representation.

It happended that the actual value used in borg create always comes from
DEFAULT_FILES_CACHE_MODE_UI (because that does have the --files-cache
option) whereas for all other commands (that do not use the files cache) it
comes from DEFAULT_FILES_CACHE_MODE.

PR #5777 then abused this fact to implement the optimisation to skip loading
of the files cache in those other commands by changing the value of
DEFAULT_FILES_CACHE_MODE to disabled.
This however also changes the meaning of that variable and thus redesignates
it to something not matching the original naming anymore.

Anyone not aware of this change and the intention behind it looking at the
code would have a hard time figuring this out and be easily mislead.

This does away with the confusion making the code more maintainable by
renaming DEFAULT_FILES_CACHE_MODE to FILES_CACHE_MODE_DISABLED, making the
new intention of that internal default clear.

* make constant for files cache mode UI default match naming scheme
2022-05-30 14:01:19 +02:00
TW
d064f63ad7
Merge pull request #6726 from elho/use-relative-imports
Use relative imports
2022-05-29 14:05:23 +02:00
Elmar Hoffmann
fd34fa2d02 use relative imports
Use relative imports where trivially possible for more consistency and to
avoid using the borg module name explicitly.
2022-05-29 09:36:52 +02:00
Elmar Hoffmann
c34df51e3e import IntegrityError used as base class with according name
This not only brings code style in line with the other helpers that do the
same thing this way, but also does away with an unnecessary absolute import
using the borg module name explicitly.
2022-05-28 16:07:20 +02:00
TW
e8046bc761
Merge pull request #6723 from KN4CK3R/forwardport-6722
Forwardport: borg debug dump-repo-objs --ghost (#6722)
2022-05-28 13:37:56 +02:00
TW
7b08222256 Merge pull request #6722 from ThomasWaldmann/debug-get-chunk-1.2
borg debug dump-repo-objs --ghost: new --segment=S --offset=O options
2022-05-28 01:42:26 +02:00
TW
1614abd4b9
Merge pull request #6719 from fantasya-pbem/task/6407_document-pattern-changes
#6407 - Document Borg 1.2 pattern behavior change
2022-05-27 15:23:15 +02:00
Thalian
45fac2dc54 #6407 - Document Borg 1.2 pattern behavior change
Fix wrong root path that was accidently changed in last commit.
2022-05-27 15:17:43 +02:00
TW
b209fcce12
Merge pull request #6717 from fantasya-pbem/task/6407_document-pattern-changes
docs: document borg 1.2 pattern behaviour change, fixes #6407
2022-05-27 15:04:43 +02:00
Thalian
b4d3859b9e #6407 - Document Borg 1.2 pattern behavior change
Make clear that absolute paths always go into the matcher as if they are relative (without leading slash). Adapt all examples accordingly.

fixes #6407
2022-05-27 14:13:12 +02:00
TW
b10d661185
Merge pull request #6706 from ThomasWaldmann/revert-no-scp-in-master
Revert "Remove scp syntax for locations (#6697)"
2022-05-18 17:58:56 +02:00
Thomas Waldmann
61299d23db Revert "Remove scp syntax for locations (#6697)"
This reverts commit 1b4b84dfd8.
2022-05-18 17:31:10 +02:00
Thomas Waldmann
e5f1a4fb4d recreate: cachedir_masters not needed any more
now all hardlinked regular file items have chunks.
2022-05-18 14:20:01 +02:00
Thomas Waldmann
6bfdb3f630 refactor hardlink_master processing globally
borg now has the chunks list in every item with content.
due to the symmetric way how borg now deals with hardlinks using
item.hlid, processing gets much simpler.

but some places where borg deals with other "sources" of hardlinks
still need to do some hardlink management:
borg uses the HardLinkManager there now (which is not much more
than a dict, but keeps documentation at one place and avoids some
code duplication we had before).

item.hlid is computed via hardlink_id function.

support hardlinked symlinks, fixes #2379
as we use item.hlid now to group hardlinks together,
there is no conflict with the item.source usage for
symlink targets any more.

2nd+ hardlinks now add to the files count as did the 1st one.
for borg, now all hardlinks are created equal.
so any hardlink item with chunks now adds to the "file" count.

ItemFormatter: support {hlid} instead of {source} for hardlinks
2022-05-18 14:20:01 +02:00
Thomas Waldmann
7903dad183 transfer: convert timestamps int/bigint -> msgpack.Timestamp, see #2323
Timestamp scales to 64 or 96bit serialization formats, that should be enough for everybody.

We use this in archived items and also in the files cache.
2022-05-18 14:20:01 +02:00
Thomas Waldmann
e4a97ea8cc transfer: all hardlinks have chunks, maybe chunks_healty, hlid
Item.hlid: same id, same hardlink (xxh64 digest)
Item.hardlink_master: not used for new archives any more
Item.source: not used for hardlink slaves any more
2022-05-18 14:20:01 +02:00
Thomas Waldmann
01f72d15b4 transfer: remove the zlib type bytes hack
hack: see the docstring of ZLIB_legacy class.

New clean ZLIB class that works as every other compressor.

ZLIB ID 0x0500, ZLIB_legacy ID 0x.8..
2022-05-18 14:20:01 +02:00
Thomas Waldmann
ba1dbe6111 transfer: make sure items with chunks have precomputed size 2022-05-18 14:20:01 +02:00
Thomas Waldmann
98b7dc0bf5 transfer: clean item of attic 0.13 'acl' bug remnants
also: remove attic bug support code from borg check.

borg transfer removes the acl key. we do not run borg check on old repos.
2022-05-18 14:20:00 +02:00
Thomas Waldmann
116f67036f transfer: copy archives from another repo
this is somehow similar to borg recreate,
but with different focus and way simpler:

not changing compression algo
not changing chunking
not excluding files inside an archive by path match
only dealing with complete archives

but:
different src and dst repo
only reading each chunk once
keeping the compressed payload (no decompression/recompression effort)
--dry-run can be used before and afterwards to check
2022-05-18 14:20:00 +02:00
Emil M George
1b4b84dfd8
Remove scp syntax for locations (#6697)
remove scp syntax support from cli and from Location parser, add note about converting scp-style URLs to ssh-style, fixes #6691
2022-05-15 21:55:19 +02:00
Andrea Gelmini
c79fd61b5c
Fix typos (#6688)
fix typos

Co-authored-by: Thomas Waldmann <tw@waldmann-edv.de>
2022-05-15 21:23:48 +02:00
TW
ab4bef0372
Merge pull request #6694 from ThomasWaldmann/versions-mount-1archive-error-master
mount -o versions: give clear error msg instead of crashing
2022-05-15 19:52:32 +02:00
Thomas Waldmann
2bed467e92 mount -o versions: give clear error msg instead of crashing
it does not make sense to request versions view if you only
look at 1 archive, but the code shall not crash in that case
as it did, but give a clear error msg.
2022-05-15 00:37:45 +02:00
Christopher Klooz
594d83aad5
docs: authentication primitives: improved security and performance infos (master) (#6667)
docs: authentication primitives: improved security and performance infos
2022-05-14 22:57:22 +02:00
ReethuVinta
ac4666d7f4
documented workaround for getting help for sub-sub-commands (#6346)
docs: how to get help for sub-sub-commands
2022-05-13 18:29:43 +02:00
ReethuVinta
c85bcfd3ad
documented secret key usage against fingerprinting (#6345)
docs: secret key usage against fingerprinting

Co-authored-by: Thomas Waldmann <tw@waldmann-edv.de>
2022-05-10 21:18:40 +02:00
TW
0e3ff0ab70
Merge pull request #6682 from ThomasWaldmann/fix-archive-progress-json-master
show_progress: add finished=true/false to archive_progress json
2022-05-08 19:45:39 +02:00
TW
09a84fbd24
Merge pull request #6685 from ThomasWaldmann/fix-create-filter-master
fix create_filter_process exception handler, fixes #6681
2022-05-08 19:15:35 +02:00
Thomas Waldmann
18eb696a17 fix create_filter_process exception handler, fixes #6681
if cmd was falsy (e.g. None), there is no proc.
then, if "yield stream" raises an exception, the exception handler crashed at "proc.kill()".
2022-05-08 18:46:13 +02:00
Thomas Waldmann
1c0937958d show_progress: add finished=true/false to archive_progress json, fixes #6570
also:
- remove empty values from final json
- add test
2022-05-08 18:32:07 +02:00
TW
a3e99a2b51
Merge pull request #6659 from ThomasWaldmann/docs-fc-suffix-master
docs: mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL
2022-05-07 14:39:57 +02:00
TW
4acfcf23e9
Merge pull request #6670 from ThomasWaldmann/no-pytest-check-master
check that borg does not require pytest for normal usage, fixes #6563
2022-05-07 10:41:34 +02:00
Thomas Waldmann
2c25123284 check that borg does not require pytest for normal usage, fixes #6563
also: move the note about this to the very top of the affected modules.
2022-05-07 02:24:18 +02:00
TW
dc89798496
Merge pull request #6665 from ThomasWaldmann/fix-key-idhash-compat
fix key id hash compat check
2022-05-04 00:00:21 +02:00
Thomas Waldmann
af776ce7a6 refactor: borg.key.uses_same_id_hash(key_old, key_new) 2022-05-03 21:32:35 +02:00
Thomas Waldmann
3239836dce fix key id hash compat check: also support new->new
the check only considered old key -> new key changes, but
new key to new key is of course also fine.

e.g. repokey-aes-ocb -> repokey-aes-ocb (both use hmac-sha256
as id hash)
2022-05-03 21:25:44 +02:00
TW
b0f7dd0904
Merge pull request #6664 from ThomasWaldmann/api-give-compressed-master
api: enable giving already compressed data
2022-05-03 11:43:47 +02:00
Thomas Waldmann
0e53dc040a api: enable giving already compressed data
the api already offered getting compressed data,
but not giving compressed data.

thus: cache.add_chunk and key.encrypt improved.
2022-05-03 04:15:01 +02:00
TW
19ad926c70
Merge pull request #6662 from ThomasWaldmann/decrypt-fixes
fix key.decrypt calls
2022-05-02 21:25:26 +02:00
Thomas Waldmann
cc0e33da65 fix key.decrypt calls
the id must now always be given correctly because
the AEAD crypto modes authenticate the chunk id.

the special case when id == MANIFEST_ID is now handled
inside assert_id, so we never need to give a None id.
2022-05-02 20:56:50 +02:00
TW
3ba9bab66c
Merge pull request #6660 from ThomasWaldmann/reuse-key
init --other-location=OTHER_REPO: reuse key material from OTHER_REPO
2022-05-02 20:52:13 +02:00
Thomas Waldmann
4b070040d6 init --other-location=OTHER_REPO: reuse key material from OTHER_REPO, fixes #6554
it potentially will ask for the passphrase for the key of OTHERREPO.
for the newly created repo, it will use the same passphrase.

it will copy: enc_key, enc_hmac_key, id_key, chunker_seed.

keeping the id_key (and id algorithm) and the chunker seed (and chunker
algorithm and parameters) is desirable for deduplication.
the id algorithm is usually either HMAC-SHA256 or BLAKE2b.

keeping the enc_key / enc_hmac_key must be implemented carefully:
A) AES-CTR -> AES-CTR is INSECURE due to nonce reuse, thus not allowed.
B) AES-CTR -> AEAD with session keys is secure.
C) AEAD with session keys -> AEAD with session keys is secure.

AEAD modes with session keys: AES-OCB and CHACHA20-POLY1305.
2022-05-02 18:50:27 +02:00
Thomas Waldmann
020e2defaf implement with_other_repository and BORG_OTHER_REPO 2022-05-02 18:48:14 +02:00
Thomas Waldmann
a375335859 make some code from with_repository reusable 2022-05-02 18:45:14 +02:00
Thomas Waldmann
9f09a9e096 docs: mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, fixes #5602 2022-04-30 20:28:46 +02:00
TW
65c7829216
Merge pull request #6637 from ThomasWaldmann/docs-files-cache-master
FAQ: add a hint about --debug-topic=files_cache
2022-04-20 13:02:09 +02:00
Thomas Waldmann
c2ad118434 FAQ: add a hint about --debug-topic=files_cache 2022-04-20 13:00:02 +02:00
TW
12d27d7944
Merge pull request #6630 from ThomasWaldmann/fix-iec-master
fix --iec mode output for borg delete and prune
2022-04-19 23:39:13 +02:00
TW
f937a72a13
Merge pull request #6633 from ThomasWaldmann/fix-info-authenticated-master
info: fix authenticated mode repo to show "Encrypted: No", fixes #6462
2022-04-19 23:38:43 +02:00
Thomas Waldmann
16f6983b1d info: fix authenticated mode repo to show "Encrypted: No", fixes #6462 2022-04-19 22:12:23 +02:00
Thomas Waldmann
c86d19cc06 prune: fix --stats --iec output to use binary units, see #6606 2022-04-19 21:56:29 +02:00
Thomas Waldmann
8d1e012ecc delete: fix --stats --iec output to use binary units, see #6606 2022-04-19 21:56:19 +02:00
TW
5743ec7e09
Merge pull request #6616 from ThomasWaldmann/fix-files-cache-6353-master
fix transaction rollback: use files cache filename as found in txn.active
2022-04-19 21:16:29 +02:00
TW
0e9431b174
Merge pull request #6624 from ThomasWaldmann/fix-diff-6483-master
diff: support presence change for blkdev, chrdev and fifo items (master)
2022-04-19 17:16:13 +02:00
TW
c60a314ee0 diff: support presence change for blkdev, chrdev and fifo items (1.2-maint) (#6615)
diff: support presence change for blkdev, chrdev and fifo items

also: refactor / clean up / reuse code.
2022-04-19 16:49:21 +02:00
TW
299196ebcb
Merge pull request #6619 from ThomasWaldmann/invalid-repo-msg-master
better error msg for defect or unsupported repo configs, fixes #6566
2022-04-18 09:53:09 +02:00
Thomas Waldmann
1aba534c5a better error msg for defect or unsupported repo configs, fixes #6566 2022-04-18 09:27:26 +02:00
Thomas Waldmann
37430beda3 fix transaction rollback: use files cache filename as found in txn.active, fixes #6353 2022-04-18 09:03:37 +02:00
TW
7fd53903f4
Merge pull request #6604 from ThomasWaldmann/argon2-chacha
argon2 key: use chacha20-poly1305 instead of aes256-ctr+hmac-sha256
2022-04-17 07:10:46 +02:00
TW
195a45d1c1
Merge pull request #6609 from ThomasWaldmann/docs-table-formatting-master
init: docs table formatting fixed (master)
2022-04-17 01:59:30 +02:00
TW
f766a21fc7
Merge pull request #6610 from ThomasWaldmann/more-benchmarks-master
benchmark cpu: add some more compression benchmarks
2022-04-17 01:59:17 +02:00
Thomas Waldmann
77a8464a96 benchmark cpu: add some more compression benchmarks 2022-04-17 00:25:28 +02:00
Thomas Waldmann
0cf97dc6db build_usage 2022-04-17 00:07:12 +02:00
Thomas Waldmann
6166e391c9 init: reformat table in docs 2022-04-17 00:07:12 +02:00
Thomas Waldmann
ed59159649 argon2 key: use chacha20-poly1305 instead of aes256-ctr + hmac-sha256, fixes #6601
so we can completely get rid of aes-ctr some day.
2022-04-16 11:52:33 +02:00
TW
d2c22633e8
Merge pull request #6599 from ThomasWaldmann/fix-rtfd-master
setup.cfg: setup_requires setuptools_scm
2022-04-15 01:17:57 +02:00
Thomas Waldmann
0c27272f97 setup.cfg: setup_requires setuptools_scm
readthedocs.org uses python setup.py install (not pip install).
2022-04-15 00:51:41 +02:00
TW
201e849fdd
Merge pull request #6596 from borgbackup/rel130a1
release 1.3.0a1
2022-04-15 00:04:17 +02:00
Thomas Waldmann
9f86c375b4 python setup.py build_man 2022-04-14 21:25:12 +02:00
Thomas Waldmann
d7fe23c515 python setup.py build_usage 2022-04-14 21:25:12 +02:00
Thomas Waldmann
801751e44e set 1.3.0a1 release date
also: cosmetic fixes in changelog
2022-04-14 21:03:11 +02:00
TW
4c749eac2a
Merge pull request #6595 from ThomasWaldmann/update-changes3
update CHANGES
2022-04-14 20:47:48 +02:00
Thomas Waldmann
38a7a48d8e update CHANGES 2022-04-14 20:47:12 +02:00
TW
a1ba1c1149
Merge pull request #6593 from ThomasWaldmann/openbsd-openssl
openbsd: use openssl, remove libressl support, fixes #6474
2022-04-14 20:46:40 +02:00
Thomas Waldmann
be9e7d37c2 remove libressl support
currently it does not have what we need, so we can simplify our code.
2022-04-14 19:31:55 +02:00
Thomas Waldmann
c592b20262 use openssl on openbsd, fixes #6474 2022-04-14 19:31:55 +02:00
TW
3ef355a98f
Merge pull request #6592 from ThomasWaldmann/fix-md-chunks-processing-master
metadata stream can produce all-zero chunks, fixes #6587
2022-04-14 03:53:36 +02:00
Thomas Waldmann
e199f5bc6c metadata stream can produce all-zero chunks, fixes #6587
all-zero chunks are propagated as:
CH_ALLOC, data=None, size=len(zeros)

other chunks are:
CH_DATA, data=data, size=len(data)

also: remove the comment with the wrong assumption
2022-04-14 00:22:05 +02:00
TW
1b9a49c5c2
Merge pull request #6588 from ThomasWaldmann/docs-virt-master
virtualisation speed tips, fixes #6456
2022-04-13 23:08:00 +02:00
TW
cfb0821006
Merge pull request #6586 from ThomasWaldmann/alpha
master branch is alpha
2022-04-13 22:50:47 +02:00
Thomas Waldmann
18c398e708 virtualisation speed tips 2022-04-13 22:48:27 +02:00
Thomas Waldmann
2872d7acfd point to setup.cfg also 2022-04-13 03:50:54 +02:00
Thomas Waldmann
f5f85b9e76 use borgbackup.org as main site
the github site is linked via project_urls -> Source Code
2022-04-13 03:48:33 +02:00
Thomas Waldmann
4b561cfb95 master branch is alpha development status (or worse) 2022-04-13 03:42:05 +02:00
TW
b59230380f
Merge pull request #6580 from ThomasWaldmann/docs-max-duration-master
docs: improve borg check --max-duration description
2022-04-12 19:41:04 +02:00
TW
8d3db4637d
Merge pull request #6564 from ThomasWaldmann/deleted-key-master
load_key: no key is same as empty key, fixes #6441
2022-04-12 19:06:12 +02:00
TW
6c74cccbeb
Merge pull request #6578 from ThomasWaldmann/compact-docs-master
docs: borg compact --cleanup-commits also runs a normal compaction
2022-04-12 18:53:37 +02:00
Thomas Waldmann
e90cf8a32f docs: improve borg check --max-duration description 2022-04-12 18:43:52 +02:00
TW
bc3b2eb719
Merge pull request #6575 from ThomasWaldmann/more-robust-iterator-master
borg check improvements (master)
2022-04-12 18:13:51 +02:00
Thomas Waldmann
7ae76962f9 docs: borg compact --cleanup-commits also runs a normal compaction, fixes #6324 2022-04-12 18:10:44 +02:00
Thomas Waldmann
b5f7f2376c check archives: improve error handling for corrupt archive metadata block
this is similar to #4777.

borg check must not crash if an archive metadata block does not decrypt.

Instead, report the archive_id, remove the archive from the manifest and skip to the next archive.
2022-04-12 17:47:43 +02:00
Thomas Waldmann
ced3d8b9d5 check archive: make robust_iterator more robust, fixes #4777
borg check must not crash if an archive metadata chunk does not decrypt.

Instead, report the chunk and skip to the next one.
2022-04-12 17:47:32 +02:00
TW
6bb75ddf6b
Merge pull request #6568 from jwilk-forks/secure-erase-msg
Remove stray punctuation from secure-erase message
2022-04-11 19:51:39 +02:00
Jakub Wilk
3a5c79e881 remove stray punctuation from secure-erase message 2022-04-11 18:47:59 +02:00
TW
b2ce258066
Merge pull request #6565 from hexagonrecursion/move-tests
Fix selftest
2022-04-11 11:23:05 +02:00
Andrey Andreyevich Bienkowski
08f82ee408
Argon2: documentation and changelog (#6560)
docs: borg key change-algorithm
docs: borg init --key-algorithm
docs: "this is not a borg repo" can be due to argon2 and old borg
2022-04-11 11:21:07 +02:00
Andrey Bienkowski
8e8e14c374 Fix selftest
selftest imports testsuite.crypto
I did not realise this and imported pytest from testsuite.crypto
This broke the selftest.

Solution: move the tests that depend on pytest to testsuite.key.
All three affected tests are tests for the Key classes, so
this is probably a better plase for them anyway.
2022-04-11 07:00:29 +03:00
Thomas Waldmann
f5cddf0224 load_key: no key is same as empty key, fixes #6441
when migrating from repokey to keyfile, we just store an empty key into the repo config,
because we do not have a "delete key" RPC api. thus, empty key means "there is no key".

here we fix load_key, so that it does not behave differently for no key and empty key:
in both cases, it just returns an empty value.

additionally, we strip the value we get from the config, so whitespace does not matter.

All callers now check for the repokey not being empty, otherwise RepoKeyNotFoundError
is raised.
2022-04-10 20:58:59 +02:00
TW
dfd4bd7e00
Merge pull request #6556 from hexagonrecursion/kdf-refactor
Move the key derivation code from helpers.Passphrase to crypto.FlexiKey
2022-04-10 17:07:17 +02:00
Andrey Bienkowski
0c29faddec Simplify tests 2022-04-10 15:44:51 +03:00
Andrey Bienkowski
6cf5ae4ca1 Give types for every argument 2022-04-10 15:36:46 +03:00
Andrey Bienkowski
fc6d423052 Passphrase.argon2 -> FlexiKey.argon2 2022-04-10 15:06:26 +03:00
Andrey Bienkowski
0850a7c295 Passphrase.kdf -> FlexiKey.pbkdf2 2022-04-10 05:33:10 +03:00
TW
eba6d5cd1c
Merge pull request #6553 from ThomasWaldmann/update-changes2
update CHANGES
2022-04-09 21:26:50 +02:00
Thomas Waldmann
83941d0b83 update CHANGES 2022-04-09 20:42:40 +02:00
TW
28fa9e0f0b
Merge pull request #6523 from ThomasWaldmann/pax-borg-item-master
import/export-tar: --tar-format=BORG: roundtrip ALL item metadata
2022-04-09 20:22:36 +02:00
TW
1b95950613
Merge pull request #6514 from ThomasWaldmann/repo-v2
repository v2
2022-04-09 19:27:00 +02:00
Thomas Waldmann
38f390ae45 repository: create and use version 2 repos only for now
for now, this code shall only work on v2 repos (created by this code).

the code to read v1 repos is still present though, so for experiments,
it is possible to change the repo version in the repo config from 1 to
2 manually.

having version 2 in the repo config also avoids that borg < 1.3 is
used on such a repo, which would cause damage:
old borg would not recognize the PUT2 tagged segment entries and
old borg check --repair would likely kill them all due to that.

also: keep repo version in Repository.version
2022-04-09 18:58:47 +02:00
Thomas Waldmann
85d4b98a16 docs: updated for repository version 2, PUT2 tag 2022-04-09 18:58:47 +02:00
Thomas Waldmann
52f75d7722 repository: implement PUT2: header crc32, overall xxh64, fixes #1704
note: this required a slight increase of MAX_OBJECT_SIZE so that MAX_DATA_SIZE
      could stay the same as before.

For PUT2, compute the hash over the whole entry (header and content, excluding
hash and crc32 fields, because the crc32 computation includes the hash).

Also: refactor crc32 checks into function, use f-strings, structure _read in
a more logical sequential order.

write_put: avoid creating a large temporary bytes object

why use xxh64?
- fast even without hw acceleration
- borg depends on it already anyway
- stronger than crc32 and strong enough for this purpose
2022-04-09 18:58:47 +02:00
TW
7d33ad3db1
Merge pull request #6552 from hexagonrecursion/cpu
Argon2 fourth part: borg benchmark cpu: use ARGON2_ARGS
2022-04-09 15:48:07 +02:00
Andrey Bienkowski
18963bff5f Remove outdated comment 2022-04-09 16:18:03 +03:00
Andrey Bienkowski
102ce3c5b6 borg benchmark cpu: use ARGON2_ARGS 2022-04-09 14:14:00 +03:00
Andrey Andreyevich Bienkowski
d386b0346d
Argon2 the third part: borg key change-algorithm (#6549)
add `borg key change-algorithm` to change the kdf / key processing
2022-04-09 12:42:05 +02:00
TW
1a9841347a
Merge pull request #6550 from ThomasWaldmann/update-changes
update CHANGES (master)
2022-04-08 19:49:21 +02:00
Thomas Waldmann
6ffd11fc12 update CHANGES (master) 2022-04-08 19:40:20 +02:00
TW
1e213e93a3
Merge pull request #6544 from ThomasWaldmann/fix-progress-archivename-master
escape % chars in archive name, fixes #6500
2022-04-07 20:22:20 +02:00
TW
d1c018bef4
Merge pull request #6546 from ThomasWaldmann/modernize-setuptools_scm
modernize setuptools _scm usage
2022-04-07 20:10:28 +02:00
Thomas Waldmann
f930fe3f26 relax Cython requirement
0.27 was broken, but it will install the latest release anyway now.
2022-04-07 19:12:19 +02:00
Thomas Waldmann
9642ace953 require/configure setuptools_scm via pyproject.toml 2022-04-07 19:11:15 +02:00
Thomas Waldmann
911da7a1cf escape % chars in archive name, fixes #6500
also: fix percentage format for float value.
2022-04-07 18:07:50 +02:00
Andrey Andreyevich Bienkowski
56c27a99d0
Argon2 the second part: implement key encryption / decryption (#6469)
Argon2 the second part: implement encryption/decryption of argon2 keys

borg init --key-algorithm=argon2 (new default, older pbkdf2 also still available)

borg key change-passphrase: keep key algorithm the same
borg key change-location: keep key algorithm the same

use env var BORG_TESTONLY_WEAKEN_KDF=1 to resource limit (cpu, memory, ...) the kdf when running the automated tests.
2022-04-07 16:22:34 +02:00
TW
6c38bf3fdc
Merge pull request #6536 from bket/master_fix_#2055
Fix OpenBSD symlink mode test failure (#2055)
2022-04-05 01:30:33 +02:00
Björn Ketelaars
e86fde5364 Fix OpenBSD symlink mode test failure (#2055)
OpenBSD does not have `lchmod()` causing `os.lchmod` to be unavailable
on this platform. As a result ArchiverTestCase::test_basic_functionality
fails when run manually (#2055).

OpenBSD does have `fchmodat()`, which has a flag that makes it behave
like `lchmod()`. In Python this can be used via `os.chmod(path, mode,
follow_symlinks=False)`.

As of Python 3.3 `os.lchmod(path, mode)` is equivalent to
`os.chmod(path, mode, follow_symlinks=False)`. As such, switching to the
latter is preferred as it enables more platforms to do the right thing.
2022-04-04 21:55:48 +02:00
TW
6d55324b72
Merge pull request #6529 from ThomasWaldmann/fix-ipv6-url-parsing-master
fix scp repo url parsing for ip v6 addrs, fixes #6526
2022-04-04 20:39:14 +02:00
Thomas Waldmann
b2eaa2fba4 use same host regex for ssh and scp style, refactor/clean up
although bug #6526 did not show with ssh style URLs, we should
not have different regexes for the host part for ssh and scp style.

thus i extracted the host_re from both and also cleaned up a bit.
2022-04-03 20:42:48 +02:00
Thomas Waldmann
f24979bc09 fix scp repo url parsing for ip v6 addrs, fixes #6526
added a negative lookahead/lookbehind to make sure an ipv6 addr
(enclosed in square brackets) does not get badly matched by the
regex part intended for hostnames and ipv4 addrs only.

the other part of that regex which is actually intended to match
ipv6 addrs only matches if they are enclosed in square brackets.

also added tests for ssh and scp style repo URLs with ipv6 addrs
in brackets.

also: made regex more readable, putting these 2 cases on separate lines.
2022-04-03 20:42:48 +02:00
TW
269b948284
Merge pull request #6524 from bcat/patch-1
(docs) Recommend umask for passphrase file perms
2022-04-03 17:57:50 +02:00
Jonathan Rascher
da07c36d6b
(docs) Recommend umask for passphrase file perms
The previous sample for creating a ~/.borg-passphrase file creates it first and then chmod's it to 400 permissions. That's probably fine in practice, but means there's a tiny window where the passphrase file is sitting with default permissions (likely world readable, depending on the system umask).

It seems safer to first change the umask to remove all group & world bits (0077) _before_ creating the file. To be polite and avoid messing with the user's previous umask, we do this in a subshell. (Note that umask 0077 leads to a mode of 600 rather than the previous 400, because removing the owner write bit doesn't seem to buy much since the owner can just chmod the file anyway.)
2022-04-03 00:34:33 -05:00
Thomas Waldmann
e8069a8f80 import/export-tar: --tar-format=BORG: roundtrip ALL item metadata, fixes #5830
export-tar: just msgpack and b64encode all item metadata and
            put that into a BORG specific PAX header.
            this is *additional* to the standard tar metadata.

import-tar: when detecting the BORG specific PAX header, just get
            all metadata from there (and ignore the standard tar
            metadata).
2022-04-02 22:25:44 +02:00
TW
22fc6d1bdd
Merge pull request #6522 from ThomasWaldmann/tar-pax-master
import/export-tar: PAX format, ctime and atime support
2022-04-02 19:08:53 +02:00
TW
3c0779afa7
Merge pull request #6520 from ThomasWaldmann/memoryviews
memoryviews
2022-04-02 19:04:42 +02:00
Thomas Waldmann
78e92fa9e1 import/export-tar: --tar-format, support ctime/atime
--tar-format=GNU|PAX (default: GNU)

changed the tests which use GNU tar cli tool to use --tar-format=GNU
explicitly, so they don't break in case we change the default.

atime timestamp is only present in output if the archive item has it
(which is not the case by default, needs "borg create --atime ...").
2022-04-02 18:30:55 +02:00
Thomas Waldmann
154e5d87e7 micro opt: callers shall provide a memoryview to .decompress()
if they would call with a bytes object, it would usually cause
1 object copy to remove the compression type bytes.
2022-04-01 21:22:31 +02:00
Thomas Waldmann
df23f3ed22 micro opt lz4/zstd decompress: keep memoryview a bit longer, fixes #3412
if LZ4/ZSTD.decompress gets called with a memoryview idata, keep
it until after the super().decompress(idata) call, so we save one
copy operation just to remove the 2 bytes long compression type
header.
2022-04-01 21:03:28 +02:00
TW
e8456ff7d9
Merge pull request #6516 from ThomasWaldmann/remove-attic
upgrade: remove the "attic backup" repo upgrader and tests
2022-04-01 13:53:03 +02:00
Thomas Waldmann
c7b1cd56d8 upgrade: remove the "attic backup" repo upgrader and tests
attic is borg's parent project, but it stalled in 2015 and was not updated since then.

guess we can assume that most attic users have meanwhile noticed this and already
converted their repos to borg.

if some did not yet, they are advised to use borg < 1.3 to do that ASAP.

note: borg can still DETECT an attic repo by recognizing its ATTIC_MAGIC value
      and then gives exactly that advice.
2022-04-01 12:41:11 +02:00
TW
7abc62b308
Merge pull request #6511 from ThomasWaldmann/repo-cleanup
repo code cleanup
2022-03-31 21:33:29 +02:00
Thomas Waldmann
cfa34bdf71 repository: simplify LoggedIO._read
Code gets simpler if we always only use the (shorter) header_fmt.
That format ALWAYS applies, to all tags borg writes.

If the tag unpacked from there indicates that there is also a chunkid
to read (like for PUT and DEL), we can decide that inside _read and
then read the chunkid from the fd.
2022-03-31 20:50:55 +02:00
TW
b9ea17da77
Merge pull request #6506 from ThomasWaldmann/update-security-support-master
borg 1.2 is security supported
2022-03-30 00:11:38 +02:00
Thomas Waldmann
2dbf11b154 borg 1.2 is security supported 2022-03-29 23:58:37 +02:00
TW
da565f53ea
Merge pull request #6499 from ThomasWaldmann/usage-fixes
docs: usage: add benchmark cpu and key change-location
2022-03-28 00:13:18 +02:00
Thomas Waldmann
a91dd04d11 docs: usage: add benchmark cpu and key change-location 2022-03-26 23:40:03 +01:00
TW
28731c56d1
Merge pull request #6498 from ThomasWaldmann/vagrant-fixes-master
vagrant: use generic/freebsd13, FUSE fixes
2022-03-26 22:55:32 +01:00
Thomas Waldmann
705336a7b6 vagrant: use generic/freebsd13, FUSE fixes
also: some stuff has pkg-config support now, remove env vars.
2022-03-26 22:44:18 +01:00
TW
9390f54225
Merge pull request #6497 from ThomasWaldmann/vagrant-py3.9.12
vagrant: use Python 3.9.12
2022-03-26 21:47:09 +01:00
Thomas Waldmann
417e790fee vagrant: use Python 3.9.12 2022-03-26 21:38:37 +01:00
TW
312cae5ebb
Merge pull request #6495 from ThomasWaldmann/kdf-timings
borg benchmark cpu: add kdf timings
2022-03-26 20:29:45 +01:00
TW
e5ab19c4c3
Merge pull request #6496 from ThomasWaldmann/fix-manifest-id
bugfix: correctly give manifest id
2022-03-26 20:29:19 +01:00
Thomas Waldmann
7083e6738f bugfix: correctly give manifest id
but do not verify chunk-id for it (does not match because the ID is
fixed at all-zero).
2022-03-26 20:07:52 +01:00
TW
09e2afe951
Merge pull request #6492 from ThomasWaldmann/use-compare_digest
use hmac.compare_digest instead of ==, fixes #6470
2022-03-26 19:48:18 +01:00
Thomas Waldmann
3fe622dd92 borg benchmark cpu: add kdf timings
Note: A KDF shall be expensive to compute to slow down
attacks on your key encryption / your passphrase.
2022-03-26 19:47:43 +01:00
Thomas Waldmann
fe7eb5702b use hmac.compare_digest instead of ==, fixes #6470 2022-03-26 18:51:36 +01:00
TW
e443588329
Merge pull request #6487 from ThomasWaldmann/update-ubuntu-link
docs: update link to ubuntu packages, fixes #6485
2022-03-26 18:21:06 +01:00
Thomas Waldmann
359a347fdd docs: update link to ubuntu packages, fixes #6485 2022-03-26 18:06:08 +01:00
TW
23b27cfd0c
Merge pull request #6486 from ThomasWaldmann/update-docs
docs: add libdeflate requirement to install docs, fixes #6446
2022-03-26 18:03:38 +01:00
Thomas Waldmann
b2ab823fea docs: update cygwin install notes to python 3.9 2022-03-26 17:56:54 +01:00
Thomas Waldmann
07cf06f9e1 docs: add libdeflate requirement to install docs, fixes #6446
there was no change required due to argon2-cffi, because that will be automatically installed by pip.
2022-03-26 17:52:46 +01:00
TW
fbdeaa89bc
Merge pull request #6463 from ThomasWaldmann/new-crypto
new AEAD crypto with session keys
2022-03-26 17:27:58 +01:00
Thomas Waldmann
c66826528b init olen to avoid some (false positive) compiler warnings
olen is assigned by OpenSSL, but the compiler can't know that and generates these warnings:

  warning: src/borg/crypto/low_level.pyx:271:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:274:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:314:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:317:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:514:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:517:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:566:22: local variable 'olen' referenced before assignment
  warning: src/borg/crypto/low_level.pyx:572:22: local variable 'olen' referenced before assignment
2022-03-26 17:05:57 +01:00
Thomas Waldmann
10cbdcc67e add encryption-aead diagram 2022-03-26 17:05:57 +01:00
Thomas Waldmann
af26835dfc delete pointless assert
thanks @hexagonrecursion for finding this.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
dd2a054ac4 crypto: key: reduce class inheritance depth 2022-03-26 17:05:57 +01:00
Thomas Waldmann
3a0e1a1cc2 crypto: low_level: reduce class inheritance depth 2022-03-26 17:05:57 +01:00
Thomas Waldmann
e4b65dea76 crypto: add IV overflow check
will never happen, but better play safe.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
900a812e9c crypto: bump API_VERSION to 1.3_01 2022-03-26 17:05:57 +01:00
Thomas Waldmann
ce247526c2 docs: update borg init examples 2022-03-26 17:05:57 +01:00
Thomas Waldmann
298c5ee539 docs: security infos only applying to legacy encryption 2022-03-26 17:05:57 +01:00
Thomas Waldmann
b3383a4d53 update borg init docs 2022-03-26 17:05:57 +01:00
Thomas Waldmann
ccf0875053 EVP_DecryptFinal_ex: fix check for return value
seems like the current docs were updated.
was "positive return code".
now specifically mentions 0 and 1.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
e1313ccc05 crypto.low_level: simplify return code checks (legacy) 2022-03-26 17:05:57 +01:00
Thomas Waldmann
948d67efd8 crypto.low_level: simplify return code checks (AEAD) 2022-03-26 17:05:57 +01:00
Thomas Waldmann
f4a6ad080b docs: add new AEAD modes to security docs 2022-03-26 17:05:57 +01:00
Thomas Waldmann
c50e1124b5 also authenticate the chunkid when using the AEAD ciphers (AES-OCB/CHACHA-POLY) 2022-03-26 17:05:57 +01:00
Thomas Waldmann
8bd9477b96 add aad parameter to borg.crypto.low_level api
added it for all classes there, so the caller just give it.

for the legacy AES-CTR based classes, the given aad is completely ignored.
this is to stay compatible with repo data of borg < 1.3.

for the new AEAD based classes:
encrypt: the aad is fed into the auth tag computation
decrypt: same. decrypt will fail on auth tag mismatch.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
d3b78a6cf5 minor key.encrypt api change/cleanup
we already have .decrypt(id, data, ...).
i changed .encrypt(chunk) to .encrypt(id, data).

the old borg crypto won't really need or use the id,
but the new AEAD crypto will authenticate the id in future.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
41b8a04d82 use faster hmac.digest api 2022-03-26 17:05:57 +01:00
Thomas Waldmann
74ecb63671 fix new crypto benchmarks for api change 2022-03-26 17:05:57 +01:00
Thomas Waldmann
0b5a21275f avoid losing the key (old crypto)
if we just have a pointer to a bytes object which might go out of scope, we can lose it.

also: cython can directly assign a bytes object into a same-size char array.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
6d6d3caa24 avoid losing the key
if we just have a pointer to a bytes object which might go out of scope, we can lose it.

also: cython can directly assign a bytes object into a same-size char array.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
41082f558f crypto: add some tests for new key types 2022-03-26 17:05:57 +01:00
Thomas Waldmann
6f2c587080 tests: consistently give iv_int to ciphersuite 2022-03-26 17:05:57 +01:00
Thomas Waldmann
6c7b499d3f set aead auth tag directly before EVP_DecryptFinal_ev
https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption
2022-03-26 17:05:57 +01:00
Thomas Waldmann
bb949b25ea EVP_DecryptFinal_ex: fix check for return value
seems like the current docs were updated.
was "positive return code".
now specifically mentions 0 and 1.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
c010800f55 header_len=0 fits header=b'' default 2022-03-26 17:05:57 +01:00
Thomas Waldmann
5c66fa4caa crypto: layout updates, low-level does not deal with IV
encrypt used to "patch" the IV into the header,
decrypt used to fetch it from there.

encrypt now takes the header just "as is" and
also decrypt expects that the IV is already set.
2022-03-26 17:05:57 +01:00
Thomas Waldmann
0f6f278b0f crypto: AEAD key classes
also:

cleanup class structure: less inheritance, more mixins.

define type bytes using the 4:4 split

upper 4 bits are ciphersuite:
0 == legacy AES-CTR based stuff
1+ == new AEAD stuff

lower 4 bits are keytype:
legacy: a bit mixed up, as it was...
new stuff: 0=keyfile 1=repokey, ...
2022-03-26 17:05:35 +01:00
TW
3e1cfd009e
Merge pull request #6459 from ThomasWaldmann/vagrant-fixes
vagrant fixes
2022-03-25 01:32:22 +01:00
Thomas Waldmann
dea54df2e4 vagrant: use a openbsd-current ("7.1") box 2022-03-25 01:31:11 +01:00
Thomas Waldmann
b43ce32188 vagrant: remove focal64 VM (no py39) 2022-03-25 01:30:03 +01:00
Thomas Waldmann
93ca8f79be vagrant: py39 / libs related fixes 2022-03-25 01:29:48 +01:00
Manu
25ecde56b5
Simplify libs setup (#6482) 2022-03-24 10:28:02 +04:00
Manu
710d76e5c2 Move system lib comment up, formatting, expand lib not found error. 2022-03-24 08:41:34 +04:00
Manu
f36a0fc6b6 Remove Python 3.8 from tox 2022-03-23 17:47:34 +04:00
Manu
c86a5491d9 Rever xxhash version 2022-03-23 17:40:33 +04:00
Manu
e686ec0d8c Fix openssl ext 2022-03-23 17:28:27 +04:00
Manu
249de7eb45 Add feedback, part 1 2022-03-23 17:19:43 +04:00
Manu
ec11905f11 Add src path to setup.cfg 2022-03-23 16:19:25 +04:00
Manu
dd17c0e869 Fix xxhash version 2022-03-23 15:53:26 +04:00
Manu
3732c45f42 Initial commit 2022-03-23 15:42:34 +04:00
TW
89f192edb2
Merge pull request #6455 from Whissi/issue_6453
delete: add repository id and location to prompt
2022-03-23 05:16:47 +01:00
Thomas Waldmann
9633273622 crypto: simplify api for new crypto, AEAD only needs 1 key 2022-03-22 20:08:34 +01:00
Thomas Waldmann
3473b17a8d crypto: improve attr naming 2022-03-22 20:07:33 +01:00
Thomas Waldmann
57479fb989 crypto: put the IV into the header, at the end of it
one openssl call less due to simpler layout!

also change default for aad_offset to 0:
by default, we want to authenticate the complete header.
2022-03-22 20:07:33 +01:00
Thomas Waldmann
e647360a0e crypto: better raise NotImplementedError if we have no id_hash 2022-03-22 20:07:33 +01:00
Thomas Waldmann
aff626119a crypto: cleanup, remove references to AES-GCM
A lot of people have concerns about AES-GCM.

Considering we can use AES-OCB, I guess we will
not use AES-GCM anyway, thus no need to talk
about it.
2022-03-22 20:07:33 +01:00
Thomas Waldmann
d3f069cb3b crypto: fix/update borg version comments
new AEAD crypto can be used with borg >= 1.3.
old crypto is used by attic and borg < 1.3.
2022-03-22 20:07:33 +01:00
Andrey Bienkowski
78f041440c
Argon2 the first part: Implement key derivation (was: part 0) (#6468)
add a argon2 based kdf, using argon2-cffi
2022-03-21 21:51:54 +01:00
Thomas Deutschmann
19c7b85eca
delete: add repository id and location to prompt
Closes: https://github.com/borgbackup/borg/issues/6453
2022-03-21 21:11:46 +01:00
TW
dfd7ea8171
Merge pull request #6464 from ThomasWaldmann/exclude-checksums-c
fixup: fix some algorithms/* ignores
2022-03-18 01:18:39 +01:00
Thomas Waldmann
1f90d4a77a fixup: fix some algorithms/* ignores 2022-03-17 23:34:26 +01:00
TW
cb0e4fc2b2
Merge pull request #6460 from ThomasWaldmann/move-checksums
remove algorithms package, move checksums module to borg package
2022-03-17 12:55:43 +01:00
Thomas Waldmann
cc3b5c062c remove algorithms package, move checksums module to borg package 2022-03-17 00:24:49 +01:00
TW
c641e31e82
Merge pull request #6454 from bket/fix-benchmark-cpu
`borg benchmark cpu` fails with libressl
2022-03-14 20:13:02 +01:00
Björn Ketelaars
3d86df6649 borg benchmark cpu fails with libressl
`borg benchmark cpu` fails on OpenBSD with the error below, which is
caused by LibreSSL currently not supporting AES256_OCB and
CHACHA20_POLY1305.

Work around this by checking if borg is used with LibreSSL. Tested on
OpenBSD.

```
Chunkers =======================================================
buzhash,19,23,21,4095    1GB        14.294s
fixed,1048576            1GB        0.244s
Non-cryptographic checksums / hashes ===========================
crc32 (libdeflate, used) 1GB        0.724s
crc32 (zlib)             1GB        1.953s
xxh64                    1GB        0.361s
Cryptographic hashes / MACs ====================================
hmac-sha256              1GB        7.039s
blake2b-256              1GB        9.845s
Encryption =====================================================
aes-256-ctr-hmac-sha256  1GB        18.312s
aes-256-ctr-blake2b      1GB        21.213s
Local Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/borg/archiver.py", line 5241, in main
    exit_code = archiver.run(args)
  File "/usr/local/lib/python3.9/site-packages/borg/archiver.py", line 5172, in run
    return set_ec(func(args))
  File "/usr/local/lib/python3.9/site-packages/borg/archiver.py", line 607, in do_benchmark_cpu
    print(f"{spec:<24} {size:<10} {timeit(func, number=100):.3f}s")
  File "/usr/local/lib/python3.9/timeit.py", line 233, in timeit
    return Timer(stmt, setup, timer, globals).timeit(number)
  File "/usr/local/lib/python3.9/timeit.py", line 177, in timeit
    timing = self.inner(it, self.timer)
  File "<timeit-src>", line 6, in inner
  File "/usr/local/lib/python3.9/site-packages/borg/archiver.py", line 602, in <lambda>
    ("aes-256-ocb", lambda: AES256_OCB(
  File "src/borg/crypto/low_level.pyx", line 636, in borg.crypto.low_level.AES256_OCB.__init__
  File "src/borg/crypto/low_level.pyx", line 633, in borg.crypto.low_level.AES256_OCB.requirements_check
ValueError: AES OCB is not implemented by LibreSSL (yet?).

Platform: OpenBSD gateway.lan 7.1 GENERIC.MP#418 amd64
Borg: 1.2.1.dev98+gebaf0c32  Python: CPython 3.9.10 msgpack: 1.0.3 fuse: None [pyfuse3,llfuse]
PID: 38614  CWD: /storage/8899fc1454db04de.a/home/code/git/ports/sysutils/borg
sys.argv: ['/usr/local/bin/borg', 'benchmark', 'cpu']
SSH_ORIGINAL_COMMAND: None
```
2022-03-14 18:56:01 +01:00
TW
ebaf0c32d3
Merge pull request #6388 from ThomasWaldmann/benchmark-cpu-master
borg benchmark cpu: display benchmarks of cpu bound stuff
2022-03-13 23:25:39 +01:00
Thomas Waldmann
79eee27936 borg benchmark cpu: display benchmarks of cpu bound stuff 2022-03-13 22:49:52 +01:00
TW
a6634c0779
Merge pull request #6387 from ThomasWaldmann/crc32
use crc32 from libdeflate, remove bundled crc32 code
2022-03-13 22:00:28 +01:00
Thomas Waldmann
98a675f62a use crc32 from libdeflate, remove bundled crc32 code
we use zlib.crc32 (macOS) or libdeflate_crc32 (Linux and all others) now.
2022-03-13 21:39:34 +01:00
TW
d9d1e44b67
Merge pull request #6415 from ThomasWaldmann/borg-key
borg key change-location, cleanups
2022-03-12 18:36:48 +01:00
Thomas Waldmann
0b3b78e139 dedup code: assert_type 2022-03-11 23:05:32 +01:00
Thomas Waldmann
b3e7e90c29 improve storage type handling, dedup code 2022-03-11 23:05:32 +01:00
Thomas Waldmann
a63614e35b move key type/storage constants to borg.constants 2022-03-11 23:05:32 +01:00
Thomas Waldmann
2e536bcbe2 borg key change-location 2022-03-11 23:05:32 +01:00
Thomas Waldmann
766d976f46 move passphrase related stuff to borg.helpers.passphrase 2022-03-11 21:05:42 +01:00
Thomas Waldmann
8011fade91 move key loading/saving code to FlexiKey 2022-03-11 21:05:42 +01:00
Thomas Waldmann
ad405892ca rename KeyfileKeyBase -> FlexiKeyBase
it is used as direct base class for both:
- RepoKey
- KeyfileKey
2022-03-11 21:05:42 +01:00
Thomas Waldmann
d42e6f2c41 key: uses key_cls.TYPES_ACCEPTABLE to dispatch
for now only a quite simple change, replacing the hardcoded PassphraseKey -> RepoKey dispatching.
2022-03-11 21:05:42 +01:00
TW
6cd0f6de49
Merge pull request #6431 from mikefarmer01/patch-1
use --numeric-ids in pull doc
2022-03-10 01:29:45 +01:00
Michael Bauer
638774761c
use --numeric-ids in pull doc
replace flag --numeric-owner with --numeric-ids
2022-03-09 21:43:22 +01:00
TW
153b6c3c70
Merge pull request #6429 from ThomasWaldmann/fix-savefile-mode-master
respect umask for files / dirs (master)
2022-03-09 19:00:58 +01:00
Thomas Waldmann
dd0ae1e48d ensure_dir: respect umask for created directory modes, fixes #6400
we tried to be very private / secure here, but that created the issue
that a less secure umask (like e.g. 0o007) just did not work.

to make the umask work, we must start from 0o777 mode and let the
umask do its work, like e.g. 0o777 & ~0o007 --> 0o770.

with borg's default umask of 0o077, it usually ends up being 0o700,
so only permissions for the user (not group, not others).
2022-03-09 17:16:58 +01:00
Thomas Waldmann
0f9d88bf2e SaveFile: respect umask for final file mode, fixes #6400 2022-03-09 17:16:31 +01:00
TW
32a0bf8b4f
Merge pull request #6428 from braewoods/cflags
Allow extra compiler flags for every extension build
2022-03-09 16:14:26 +01:00
TW
c1fc1df5e8
Merge pull request #6426 from braewoods/warnings
properly suppress -Wimplicit-fallthrough
2022-03-09 16:09:12 +01:00
TW
68d5e33b06
Merge pull request #6425 from m3nu/issue/6305/performance-faq
Add discussion and note on file attrs.
2022-03-09 16:05:00 +01:00
Manu
af5103d833 Incorporate feedback by TW 2022-03-09 15:48:57 +04:00
James Buren
820de65562 Allow extra compiler flags for every extension build
This is mainly intended for explicit warnings but it can be
used for other flags as well.
2022-03-09 05:18:52 -06:00
James Buren
596e33b68d properly suppress -Wimplicit-fallthrough
It turns out that explaining the comment actually breaks its
intended usage.
2022-03-09 05:00:56 -06:00
Manu
dd1023df44 Add discussion and note on file attrs. 2022-03-09 14:06:40 +04:00
TW
9a8fb9c902
Merge pull request #6422 from ThomasWaldmann/fix-cython-warnings-master
fix "useless trailing comma" cython warnings
2022-03-08 21:58:02 +01:00
Thomas Waldmann
f0bf5915c5 fix "useless trailing comma" cython warnings 2022-03-08 21:15:24 +01:00
TW
a82673e708
Merge pull request #6416 from hexagonrecursion/unicode
Fix compilation warnings: ‘PyUnicode_AsUnicode’ is deprecated
2022-03-07 19:36:22 +01:00
Andrey Bienkowski
f75a6152ab ‘PyUnicode_AsUnicode’ is deprecated
Fix compilation warnings:
```
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9 -c src/borg/platform/posix.c -o build/temp.linux-x86_64-3.9/src/borg/platform/posix.o
src/borg/platform/posix.c: In function ‘__pyx_pf_4borg_8platform_5posix_2swidth’:
src/borg/platform/posix.c:1572:3: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
 1572 |   __pyx_t_2 = __Pyx_PyUnicode_AsUnicode(__pyx_v_s); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
      |   ^~~~~~~~~
In file included from /opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9/unicodeobject.h:1026,
                 from /opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9/Python.h:93,
                 from src/borg/platform/posix.c:19:
/opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      |                                             ^~~~~~~~~~~~~~~~~~~
```

Ref: https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AsUnicode
2022-03-07 10:36:22 +03:00
TW
0714339d3f
Merge pull request #6412 from ThomasWaldmann/remove-passphrasekey
remove PassphraseKey code and borg key migrate-to-repokey command
2022-03-06 15:51:06 +01:00
Thomas Waldmann
37f237d3e0 remove PassphraseKey code and borg key migrate-to-repokey command
"passphrase" encryption mode repos can not be created since borg 1.0.
back then, users were advised to switch existing repos of that type
to repokey mode using the "borg key migrate-to-repokey" command.
that command is still available in borg 1.0, 1.1 and 1.2, but not
any more in borg >= 1.3.

while we still might see the PassphraseKey.TYPE byte in old repos,
it is handled by the RepoKey code since borg 1.0.
2022-03-06 15:26:18 +01:00
TW
e4e243be0b
Merge pull request #6408 from ThomasWaldmann/hmac-digest-master
hmac and blake2b minor optimizations and cleanups
2022-03-06 01:32:30 +01:00
TW
b3c4cee8f9
Merge pull request #6409 from ThomasWaldmann/fix-codeql-master
fix codeql complaining about missing headers needed by borg
2022-03-06 00:20:26 +01:00
TW
a457e90a95
Merge pull request #6411 from aspargas2/master
Forward port: import-tar fixes
2022-03-06 00:18:43 +01:00
Thomas Waldmann
862eefb96d fixup: fix SELFTEST_COUNT 2022-03-05 22:26:04 +01:00
Thomas Waldmann
83deedb13a kill filter process in case of borg exceptions, fixes #6401
in the finally-block, we wait for the filter process to die. but it only dies
voluntarily if all data was processed by the filter and it terminates due to EOF.

otoh, if borg has thrown an early exception, e.g. "archive already exists",
we need to kill the filter process to bring it to an early end. in that
case, we also do not need to check the filter rc, because we know we killed it.
2022-03-05 16:25:10 -05:00
Thomas Waldmann
2bcee08b88 import-tar: fix mtime type bug
looks like with a .tar file created by the tar tool,
tarinfo.mtime is a float [s]. So, after converting to
nanoseconds, we need to cast to int because that's what
Item.mtime wants.

also added a safe_ns() there to clip values to the safe range.
2022-03-05 16:24:59 -05:00
TW
d18d1370ac
Merge pull request #6410 from ThomasWaldmann/remove-stretch64-vm
vagrant: remove debian stretch VM, not supported any more
2022-03-05 22:19:16 +01:00
Thomas Waldmann
2cad8c925d fix codeql complaining about missing headers needed by borg
thus:
- install requirements first
- codeql init
- build borg
- codeql analyzse
2022-03-05 22:17:44 +01:00
Thomas Waldmann
fc67453bf3 vagrant: remove debian stretch VM, not supported any more 2022-03-05 22:09:41 +01:00
Thomas Waldmann
41536f9f79 fixup: remove now unused import 2022-03-05 21:55:23 +01:00
Thomas Waldmann
c5540229c4 remove the blake2b compat checker script
this was used to compare compatibility of our vendored
blake2b code (which we do not have any more) against the
python stdlib blake2b code (which we always use now anyway).
2022-03-05 21:51:50 +01:00
Thomas Waldmann
07159342ba remove our blake2b_128/256 tests
as we're just calling python stdlib there,
we can assume that they have tests for it.
2022-03-05 21:47:40 +01:00
Thomas Waldmann
2566671d85 remove our hmac_sha256 tests
as we're just calling python stdlib there,
we can assume that they have tests for it.
2022-03-05 21:37:31 +01:00
Thomas Waldmann
c63bd36a6c hmac.digest: some more minor optimizations
also some cosmetic changes:
- import hmac module
- use hmac.compare_digest
2022-03-05 21:29:42 +01:00
Thomas Waldmann
8317698f9b hmac_sha256: replace own cython wrapper code by hmac.digest python stdlib (since py38)
i measured performance of both: pretty much the same.
2022-03-05 21:22:24 +01:00
TW
34261aac0e
Merge pull request #6378 from braewoods/warnings
suppress -Wimplicit-fallthrough warning
2022-03-05 14:20:24 +01:00
TW
47a9e4686b
Merge pull request #6377 from ThomasWaldmann/fix-6374-master
create: skip with warning if opening the parent dir of recursion root fails, fixes #6374
2022-03-05 14:18:57 +01:00
TW
e37a55c5eb
Merge pull request #6355 from hexagonrecursion/pyproject
Add pyproject.toml
2022-03-01 14:02:34 +01:00
Andrey Bienkowski
aba16ba0d4 CodeQL: Use venv
A bug in pip or possibly setuptools broke editable
installs into the per-user directory
for packages that have pyproject.toml

See https://github.com/pypa/setuptools/issues/3019
2022-03-01 08:44:40 +03:00
Andrey Bienkowski
a929b2db0a Merge remote-tracking branch 'origin/master' into pyproject 2022-03-01 08:43:36 +03:00
James Buren
4a55d9de3c suppress -Wimplicit-fallthrough warning
These instances of implicit switch case fallthrough appear to be
intentional. Add comments that the compiler understands to suppress
the false positive warning.
2022-02-27 14:29:53 -06:00
TW
49de070799
Merge pull request #6382 from ThomasWaldmann/pyupgrade-38-master
run pyupgrade (py38+)
2022-02-27 21:07:41 +01:00
Thomas Waldmann
fade3c4799 manual formatting fixes (cosmetic / pep8) 2022-02-27 20:12:04 +01:00
Thomas Waldmann
cbeef56454 pyupgrade --py38-plus ./**/*.py 2022-02-27 20:11:56 +01:00
TW
d1bcea9e61
Merge pull request #6363 from ThomasWaldmann/require-py39
require python >= 3.9, fixes #6315
2022-02-27 19:13:05 +01:00
Thomas Waldmann
64e7ccd3fc require python >= 3.9, fixes #6315 2022-02-27 18:46:30 +01:00
TW
e8b2ca8b20
Merge pull request #6372 from ThomasWaldmann/unbundle-3rd-party
Unbundle most 3rd party code
2022-02-27 18:41:22 +01:00
Thomas Waldmann
8375d44328 create: skip with warning if opening the parent dir of recursion root fails, fixes #6374 2022-02-27 02:52:03 +01:00
Thomas Waldmann
b755f47775 vagrant: add required system libs (esp. xxhash) 2022-02-26 23:26:17 +01:00
Thomas Waldmann
9b872104da setup_crypto: remove unused function 2022-02-26 23:10:27 +01:00
TW
52f9bc926d
Merge pull request #6368 from braewoods/warnings
fix multiple warnings related to _hashindex.c
2022-02-26 23:03:38 +01:00
TW
1dca742494
Merge pull request #6370 from bket/fix_build_libressl
Fix build with LibreSSL
2022-02-26 23:02:59 +01:00
Thomas Waldmann
606ba08587 fix ci: we need xxhash system lib on macOS
also: we do not need libb2 (directly) any more, this is provided indirectly via python3 now
2022-02-26 22:40:16 +01:00
Thomas Waldmann
64e02887c0 fix codeql: borg needs required libs/headers now
nothing bundled any more.
2022-02-26 22:35:47 +01:00
Thomas Waldmann
80c21b2e23 remove docs of previously bundled blake2 code 2022-02-26 22:22:02 +01:00
Thomas Waldmann
96d93dcf0e do not support bundled 3rd party code any more, fixes #6316 2022-02-26 22:18:12 +01:00
Björn Ketelaars
73c426497f Fix build with LibreSSL
#6338 introduces regression when building with LibreSSL (3.5.0).

```
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -g -fPIC -O2 -pipe -g -O2 -pipe -g -O2 -pipe -fPIC -Isrc/borg/crypto -I/usr/local/include/python3.9 -c src/borg/crypto/low_level.c -o /tmp/ports/pobj/borgbackup-1.2.1/borg-eec359cf228caf00d9c72bde07bf939872e9d3fa/temp.openbsd-7.1-amd64-3.9/src/borg/crypto/low_level.o
src/borg/crypto/low_level.c:12439:48: error: use of undeclared identifier 'EVP_chacha20_poly1305'; did you mean 'EVP_aead_chacha20_poly1305'?
  __pyx_v_self->__pyx_base.__pyx_base.cipher = EVP_chacha20_poly1305;
                                               ^~~~~~~~~~~~~~~~~~~~~
                                               EVP_aead_chacha20_poly1305
/usr/include/openssl/evp.h:1161:17: note: 'EVP_aead_chacha20_poly1305' declared here
const EVP_AEAD *EVP_aead_chacha20_poly1305(void);
                ^
1 error generated.
```

Unfortunately `EVP_aead_chacha20_poly1305`, offered by LibreSSL, is not
a drop in replacement for `EVP_chacha20_poly1305`. More info on the
first can be found at https://man.openbsd.org/EVP_AEAD_CTX_init.3.
2022-02-26 22:03:00 +01:00
Thomas Waldmann
159bd06412 unbundle xxh64 3rd party code, see #6316 2022-02-26 21:37:34 +01:00
Thomas Waldmann
ecd0865d9c unbundle zstd 3rd party code, see #6316 2022-02-26 21:36:30 +01:00
Thomas Waldmann
7c8f288a18 unbundle lz4 3rd party code, see #6316 2022-02-26 21:35:17 +01:00
James Buren
5c94c932bb src/borg/cache_sync/unpack.h: fix compiler warnings
The key argument being sent to hashindex_get and hashindex_set by
multiple functions is a different signedness from what the functions
expect. This resolves the issue by changing the key type in the
unpack_user struct to unsigned char.
2022-02-26 14:02:29 -06:00
James Buren
5f3d61e2f0 src/borg/_hashindex.c: fix compiler warnings
The value argument of hashindex_set is causing harmless pointer type
mismatches. This resolves the issue by changing the type to void*
which silences these types of warnings.
2022-02-26 14:02:29 -06:00
TW
eec359cf22
Merge pull request #6340 from ThomasWaldmann/remove-deprecated-hmac
remove deprecated HMAC_*
2022-02-26 20:41:28 +01:00
Thomas Waldmann
0f2a45b474 crypto: get rid of deprecated HMAC_* functions
These were deprecated in OpenSSL 3.0.
2022-02-26 20:20:11 +01:00
TW
8f945ea252
Merge pull request #6338 from ThomasWaldmann/drop-openssl10
drop openssl 1.0.x support
2022-02-26 20:18:56 +01:00
TW
d707542a57
Merge pull request #6366 from braewoods/warnings
src/borg/compress.pyx: fix compiler warning, closes #6365
2022-02-26 14:46:32 +01:00
James Buren
e27a3eff0a src/borg/compress.pyx: fix compiler warning, closes #6365
This resolves a compiler warning from the generated code that
resulted from a comparison of two local variables of different
signedness. The issue is resolved by changing the type of both
to int since this seems like the safest choice available.
2022-02-25 22:28:34 -06:00
Thomas Waldmann
d1d3d1dfa4 crypto: remove support for: OpenSSL < 1.1.1, LibreSSL < 2.7.0
All these are unsupported since long.

Newer versions of LibreSSL have gained chacha20-poly1305 support,
but still lack aes256-ocb support.
Also they have the HMAC_CTX_new/free api now.

docs: openssl >= 1.1.1 is required now
anything older is out of support anyway.
2022-02-26 00:55:19 +01:00
TW
cf4a1abb87
Merge pull request #6341 from ThomasWaldmann/require-msgpack10
Require msgpack 1.0.3
2022-02-26 00:51:53 +01:00
TW
d45269dff8
Merge pull request #6362 from braewoods/warnings
src/borg/crypto/low_level.pyx: fix compiler warning
2022-02-26 00:24:36 +01:00
Thomas Waldmann
428efa221d vagrant: darwin64: remove fakeroot, fixes #6314
deprecated / unsupported / 404.
2022-02-25 23:46:32 +01:00
James Buren
0d2fae6e7b src/borg/crypto/low_level.pyx: fix compiler warning
The generated source code was producing a compiler warning due to
the pointers differing in constness. The called function expects
a non-const pointer while the generated code produces a const pointer
via a cast. This changes the cast to drop 'const' to make the compiler
happy.
2022-02-25 16:42:24 -06:00
Julian Picht
091c48bc37
docs: Clarify on-disk order and size of log entry fields (#6357)
docs: clarify on-disk order and size of log entry fields

The order of the fields of a log entry on disk is CRC32 first, the docs had the size first.

I tried to make this list similar to the HashIndex struct description.
2022-02-25 12:53:58 +01:00
TW
472eba0323
Merge pull request #6356 from hexagonrecursion/patch-1
s/apt/apt-get/
2022-02-25 12:31:58 +01:00
Andrey Bienkowski
55d5223338
s/apt/apt-get/
> WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2022-02-25 05:24:00 +00:00
Andrey Bienkowski
30c145ec53 pyproject.toml: running setup.py also requires Cython 2022-02-25 08:17:34 +03:00
Andrey Bienkowski
4df8255e62 Add pkgconfig build requirement
setup_crypto.crypto_ext_kwargs needs pkgconfig to find OpenSSL
2022-02-25 08:04:45 +03:00
Andrey Bienkowski
142bb0e3d4 setup.py: add parent to sys.path
When using pyproject.toml the parent of setup.py
is not on sys.path by default.

See <https://github.com/pypa/setuptools/discussions/3134>
2022-02-25 07:52:50 +03:00
Andrey Bienkowski
6cbb7d650f Add pyproject.toml
This blocks #6264 because black configuration is stored in pyproject.toml.
See <https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format>
I copied this from <https://setuptools.pypa.io/en/latest/userguide/quickstart.html#basic-use>
2022-02-25 06:29:01 +03:00
TW
f61e92c600
Merge pull request #6350 from hexagonrecursion/fwp-smartquote
docs: do not transform --/--- to unicode dashes (master)
2022-02-24 19:49:45 +01:00
Thomas Waldmann
d6756d0070 docs: do not transform --/--- to unicode dashes 2022-02-24 08:44:51 +03:00
Thomas Waldmann
200ed0ad39 msgpack: remove deprecated max_*_len from unpacking api 2022-02-23 04:01:51 +01:00
Thomas Waldmann
0937ae9078 msgpack: require msgpack >= 1.0.3
... and remove support code for older versions.
2022-02-23 04:01:51 +01:00
TW
9e669f6db8
Merge pull request #6313 from borgbackup/rel120
release 1.2.0
2022-02-22 22:25:25 +01:00
TW
561b164540
Merge pull request #6335 from ThomasWaldmann/vagrant-jammy
vagrant: add ubuntu "jammy" 22.04 LTS VM
2022-02-22 15:36:53 +01:00
Thomas Waldmann
d4dee41a5b vagrant: add ubuntu "jammy" 22.04 LTS VM 2022-02-22 14:27:42 +01:00
Andrey Bienkowski
0132eee1d4
Write a test for safe_unlink (#6311)
write a test for safe_unlink
2022-02-20 14:27:44 +01:00
Andrey Bienkowski
f225d15093 Update the screencasts 2022-02-20 11:51:17 +03:00
Andrey Bienkowski
ccf48ade3d Screencasts: implement the remoteserver example 2022-02-20 11:51:07 +03:00
Andrey Bienkowski
904897bce1 Screencasts: echo the current borg version 2022-02-20 10:46:32 +03:00
Andrey Bienkowski
1b633c1ca1 Reimplement screencasts using Vagrant 2022-02-19 13:00:04 +03:00
Andrey Bienkowski
e3a0b5fde8 Automate the installation asciinema screencast 2022-02-07 20:05:12 +03:00
Andrey Bienkowski
3c380f8a90 Compile the screencast 2022-01-29 17:16:16 +03:00
Andrey Bienkowski
e4c08f0643 rm basic.sh 2022-01-29 17:03:08 +03:00
Andrey Bienkowski
cc6768ec71 Add prompts 2022-01-29 16:36:19 +03:00
Andrey Bienkowski
c67646857f Remove commented-out code 2022-01-29 16:36:13 +03:00
Andrey Bienkowski
7a6454618c Automate the basic usage screencast 2022-01-29 16:31:29 +03:00
Andrey Bienkowski
910852acbf Begin automating asciinema screencasts 2022-01-29 15:54:30 +03:00
608 changed files with 70369 additions and 128878 deletions

View file

@ -1,27 +0,0 @@
version: '{build}'
environment:
matrix:
- PYTHON: C:\Python38-x64
# Disable automatic builds
build: off
# Build artifacts: all wheel and exe files in the dist folder
artifacts:
- path: 'dist\*.whl'
- path: 'dist\*.exe'
install:
- ps: scripts\win-download-openssl.ps1
- ps: |
& $env:PYTHON\python.exe -m venv borg-env
borg-env\Scripts\activate.ps1
python -m pip install -U pip
pip install -r requirements.d/development.txt
pip install wheel pyinstaller
build_script:
- ps: |
borg-env\Scripts\activate.ps1
scripts\win-build.ps1

View file

@ -1,41 +0,0 @@
[all]
# note: put developer specific settings into ~/.coarc (e.g. editor = ...)
max_line_length = 255
use_spaces = True
ignore = src/borg/(chunker.c|compress.c|hashindex.c|item.c),
src/borg/algorithms/(checksums.c|crc32*.c),
src/borg/algorithms/blake2/**,
src/borg/algorithms/lz4/**,
src/borg/algorithms/xxh64/**,
src/borg/algorithms/zstd/**,
src/borg/crypto/low_level.c,
src/borg/platform/*.c
[all.general]
files = src/borg/**/*.(py|pyx|c)
bears = SpaceConsistencyBear, FilenameBear, InvalidLinkBear, LineLengthBear
file_naming_convention = snake
[all.python]
files = src/borg/**/*.py
bears = PEP8Bear, PyDocStyleBear, PyLintBear
pep_ignore = E123,E125,E126,E127,E128,E226,E301,E309,E402,F401,F405,F811,W690
pylint_disable = C0103, C0111, C0112, C0122, C0123, C0301, C0302, C0325, C0330, C0411, C0412, C0413, C1801,
I1101,
W0102, W0104, W0106, W0108, W0120, W0201, W0212, W0221, W0231, W0401, W0404,
W0511, W0603, W0611, W0612, W0613, W0614, W0621, W0622, W0640, W0702, W0703,
W1201, W1202, W1401,
R0101, R0201, R0204, R0901, R0902, R0903, R0904, R0911, R0912, R0913, R0914, R0915,
R0916, R1701, R1704, R1705, R1706, R1710,
E0102, E0202, E0401, E0601, E0611, E0702, E1101, E1102, E1120, E1129, E1130
pydocstyle_ignore = D100, D101, D102, D103, D104, D105, D200, D201, D202, D203, D204, D205, D209, D210,
D212, D213, D300, D301, D400, D401, D402, D403, D404
[all.c]
files = src/borg/**/*.c
bears = CPPCheckBear
[all.html]
files = src/borg/**/*.html
bears = HTMLLintBear
htmllint_ignore = *

View file

@ -1,24 +0,0 @@
[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

2
.git-blame-ignore-revs Normal file
View file

@ -0,0 +1,2 @@
# Migrate code style to Black
7957af562d5ce8266b177039783be4dc8bdd7898

5
.github/FUNDING.yml vendored
View file

@ -1,5 +1,6 @@
# These are supported funding model platforms
# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
# liberapay: borgbackup
github: borgbackup
liberapay: borgbackup
open_collective: borgbackup
custom: ['https://www.borgbackup.org/support/fund.html']

View file

@ -1,56 +1,54 @@
<!--
Thank you for reporting an issue.
*IMPORTANT* - *before* creating a new issue please look around:
- Borgbackup documentation: http://borgbackup.readthedocs.io/en/stable/index.html
*IMPORTANT* Before creating a new issue, please look around:
- BorgBackup documentation: https://borgbackup.readthedocs.io/en/stable/index.html
- FAQ: https://borgbackup.readthedocs.io/en/stable/faq.html
and
- open issues in Github tracker: https://github.com/borgbackup/borg/issues
- Open issues in the GitHub tracker: https://github.com/borgbackup/borg/issues
If you cannot find a similar problem, then create a new issue.
Please fill in as much of the template as possible.
-->
## Have you checked borgbackup docs, FAQ, and open Github issues?
## Have you checked the BorgBackup docs, FAQ, and open GitHub issues?
No
## Is this a BUG / ISSUE report or a QUESTION?
## Is this a bug/issue report or a question?
Invalid
Bug/Issue/Question
## System information. For client/server mode post info for both machines.
## System information. For client/server mode, post info for both machines.
#### Your borg version (borg -V).
#### Your Borg version (borg -V).
#### Operating system (distribution) and version.
#### Hardware / network configuration, and filesystems used.
#### Hardware/network configuration and filesystems used.
#### How much data is handled by borg?
#### How much data is handled by Borg?
#### Full borg commandline that lead to the problem (leave away excludes and passwords)
#### Full Borg command line that led to the problem (leave out excludes and passwords).
## Describe the problem you're observing.
#### Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.
#### Include any warning/errors/backtraces from the system logs
#### Include any warnings/errors/backtraces from the system logs
<!--
If this complaint relates to borg performance, please include CRUD benchmark
If this complaint relates to Borg performance, please include CRUD benchmark
results and any steps you took to troubleshoot.
How to run benchmark: http://borgbackup.readthedocs.io/en/stable/usage/benchmark.html
How to run the benchmark: https://borgbackup.readthedocs.io/en/stable/usage/benchmark.html
*IMPORTANT* - Please mark logs and text output from terminal commands
or else Github will not display them correctly.
*IMPORTANT* Please mark logs and terminal command output, otherwise GitHub will not display them correctly.
An example is provided below.
Example:
```
this is an example how log text should be marked (wrap it with ```)
this is an example of how log text should be marked (wrap it with ```)
```
-->

View file

@ -1,8 +0,0 @@
Thank you for contributing code to Borg, your help is appreciated!
Please, before you submit a pull request, make sure it complies with the
guidelines given in our documentation:
https://borgbackup.readthedocs.io/en/latest/development.html#contributions
**Please remove all above text before submitting your pull request.**

18
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,18 @@
<!--
Thank you for contributing to BorgBackup!
Please make sure your PR complies with our contribution guidelines:
https://borgbackup.readthedocs.io/en/latest/development.html#contributions
-->
## Description
<!-- What does this PR do? Reference any related issues with "fixes #XXXX". -->
## Checklist
- [ ] PR is against `master` (or maintenance branch if only applicable there)
- [ ] New code has tests and docs where appropriate
- [ ] Tests pass (run `tox` or the relevant test subset)
- [ ] Commit messages are clean and reference related issues

24
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
- package-ecosystem: "pip"
directory: "/requirements.d"
ignore:
- dependency-name: "black"
schedule:
interval: "weekly"
cooldown:
semver-major-days: 90
semver-minor-days: 30
groups:
pip-dependencies:
patterns:
- "*"

38
.github/workflows/backport.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Backport pull request
on:
pull_request_target:
types: [closed]
issue_comment:
types: [created]
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
jobs:
backport:
name: Backport pull request
runs-on: ubuntu-24.04
timeout-minutes: 5
# Only run when pull request is merged
# or when a comment starting with `/backport` is created by someone other than the
# https://github.com/backport-action bot user (user id: 97796249). Note that if you use your
# own PAT as `github_token`, that you should replace this id with yours.
if: >
(
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
) || (
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.id != 97796249 &&
startsWith(github.event.comment.body, '/backport')
)
steps:
- uses: actions/checkout@v6
- name: Create backport pull requests
uses: korthout/backport-action@v4
with:
label_pattern: '^port/(.+)$'

30
.github/workflows/black.yaml vendored Normal file
View file

@ -0,0 +1,30 @@
# https://black.readthedocs.io/en/stable/integrations/github_actions.html#usage
# See also what we use locally in requirements.d/codestyle.txt — this should be the same version here.
name: Lint
on:
push:
paths:
- '**.py'
- 'pyproject.toml'
- '.github/workflows/black.yaml'
pull_request:
paths:
- '**.py'
- 'pyproject.toml'
- '.github/workflows/black.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: psf/black@6305bf1ae645ab7541be4f5028a86239316178eb # 26.1.0
with:
version: "~= 24.0"

View file

@ -5,16 +5,8 @@ name: CI
on:
push:
branches: [ master ]
paths:
- '**.py'
- '**.pyx'
- '**.c'
- '**.h'
- '**.yml'
- '**.cfg'
- '**.ini'
- 'requirements.d/*'
- '!docs/**'
tags:
- '2.*'
pull_request:
branches: [ master ]
paths:
@ -23,110 +15,671 @@ on:
- '**.c'
- '**.h'
- '**.yml'
- '**.toml'
- '**.cfg'
- '**.ini'
- 'requirements.d/*'
- '!docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- uses: astral-sh/ruff-action@v3
security:
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: 3.8
- name: Lint with flake8
python-version: '3.10'
- name: Install dependencies
run: |
pip install flake8
flake8 src scripts conftest.py
python -m pip install --upgrade pip
pip install bandit[toml]
- name: Run Bandit
run: |
bandit -r src/borg -c pyproject.toml
pytest:
asan_ubsan:
needs: lint
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [lint]
steps:
- uses: actions/checkout@v6
with:
# Just fetching one commit is not enough for setuptools-scm, so we fetch all.
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y pkg-config build-essential
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.d/development.txt
- name: Build Borg with ASan/UBSan
# Build the C/Cython extensions with AddressSanitizer and UndefinedBehaviorSanitizer enabled.
# How this works:
# - The -fsanitize=address,undefined flags inject runtime checks into our native code. If a bug is hit
# (e.g., buffer overflow, use-after-free, out-of-bounds, or undefined behavior), the sanitizer prints
# a detailed error report to stderr, including a stack trace, and forces the process to exit with
# non-zero status. In CI, this will fail the step/job so you will notice.
# - ASAN_OPTIONS/UBSAN_OPTIONS configure the sanitizers' runtime behavior (see below for meanings).
env:
CFLAGS: "-O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined"
CXXFLAGS: "-O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined"
LDFLAGS: "-fsanitize=address,undefined"
# ASAN_OPTIONS controls AddressSanitizer runtime tweaks:
# - detect_leaks=0: Disable LeakSanitizer to avoid false positives with CPython/pymalloc in short-lived tests.
# - strict_string_checks=1: Make invalid string operations (e.g., over-reads) more likely to be detected.
# - check_initialization_order=1: Catch uses that depend on static initialization order (C++).
# - detect_stack_use_after_return=1: Detect stack-use-after-return via stack poisoning (may increase overhead).
ASAN_OPTIONS: "detect_leaks=0:strict_string_checks=1:check_initialization_order=1:detect_stack_use_after_return=1"
# UBSAN_OPTIONS controls UndefinedBehaviorSanitizer runtime:
# - print_stacktrace=1: Include a stack trace for UB reports to ease debugging.
# Note: UBSan is recoverable by default (process may continue after reporting). If you want CI to
# abort immediately and fail on the first UB, add `halt_on_error=1` (e.g., UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1").
UBSAN_OPTIONS: "print_stacktrace=1"
# PYTHONDEVMODE enables additional Python runtime checks and warnings.
PYTHONDEVMODE: "1"
run: pip install -e .
- name: Run tests under sanitizers
env:
ASAN_OPTIONS: "detect_leaks=0:strict_string_checks=1:check_initialization_order=1:detect_stack_use_after_return=1"
UBSAN_OPTIONS: "print_stacktrace=1"
PYTHONDEVMODE: "1"
# Ensure the ASan runtime is loaded first to avoid "ASan runtime does not come first" warnings.
# We discover libasan/libubsan paths via gcc and preload them for the Python test process.
# the remote tests are slow and likely won't find anything useful
run: |
set -euo pipefail
export LD_PRELOAD="$(gcc -print-file-name=libasan.so):$(gcc -print-file-name=libubsan.so)"
echo "Using LD_PRELOAD=$LD_PRELOAD"
pytest -v --benchmark-skip -k "not remote"
native_tests:
needs: [lint]
permissions:
contents: read
id-token: write
attestations: write
strategy:
matrix:
include:
- os: ubuntu-20.04
python-version: '3.8'
toxenv: py38-fuse2
- os: ubuntu-20.04
python-version: '3.9'
toxenv: py39-fuse3
- os: ubuntu-20.04
python-version: '3.10'
toxenv: py310-fuse3
- os: macos-10.15 # macos-latest is macos 11.6.2 and hanging at test_fuse, #6099
python-version: '3.8'
toxenv: py38-fuse2
fail-fast: true
# noinspection YAMLSchemaValidation
matrix: >-
${{ fromJSON(
github.event_name == 'pull_request' && '{
"include": [
{"os": "ubuntu-22.04", "python-version": "3.10", "toxenv": "mypy"},
{"os": "ubuntu-22.04", "python-version": "3.11", "toxenv": "docs"},
{"os": "ubuntu-22.04", "python-version": "3.10", "toxenv": "py310-llfuse"},
{"os": "ubuntu-24.04", "python-version": "3.14", "toxenv": "py314-mfusepy"}
]
}' || '{
"include": [
{"os": "ubuntu-22.04", "python-version": "3.11", "toxenv": "py311-pyfuse3", "binary": "borg-linux-glibc235-x86_64-gh"},
{"os": "ubuntu-22.04-arm", "python-version": "3.11", "toxenv": "py311-pyfuse3", "binary": "borg-linux-glibc235-arm64-gh"},
{"os": "ubuntu-24.04", "python-version": "3.12", "toxenv": "py312-llfuse"},
{"os": "ubuntu-24.04", "python-version": "3.13", "toxenv": "py313-pyfuse3"},
{"os": "ubuntu-24.04", "python-version": "3.14", "toxenv": "py314-mfusepy"},
{"os": "macos-15-intel", "python-version": "3.11", "toxenv": "py311-none", "binary": "borg-macos-15-x86_64-gh"},
{"os": "macos-15", "python-version": "3.11", "toxenv": "py311-none", "binary": "borg-macos-15-arm64-gh"}
]
}'
) }}
env:
# Configure pkg-config to use OpenSSL from Homebrew
PKG_CONFIG_PATH: /usr/local/opt/openssl@1.1/lib/pkgconfig
TOXENV: ${{ matrix.toxenv }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
# macOS machines can be slow, if overloaded.
timeout-minutes: 360
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
with:
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all
# Just fetching one commit is not enough for setuptools-scm, so we fetch all.
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ hashFiles('requirements.d/development.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
${{ runner.os }}-${{ runner.arch }}-pip-
${{ runner.os }}-${{ runner.arch }}-
- name: Cache tox environments
uses: actions/cache@v5
with:
path: .tox
key: ${{ runner.os }}-${{ runner.arch }}-tox-${{ matrix.toxenv }}-${{ hashFiles('requirements.d/development.txt', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-tox-${{ matrix.toxenv }}-
${{ runner.os }}-${{ runner.arch }}-tox-
- name: Install Linux packages
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config build-essential
sudo apt-get install -y libxxhash-dev || true
sudo apt-get install -y libb2-dev || true
sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
sudo apt-get install -y pkg-config build-essential
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
sudo apt-get install -y bash zsh fish # for shell completion tests
sudo apt-get install -y rclone openssh-server curl
if [[ "$TOXENV" == *"llfuse"* ]]; then
sudo apt-get install -y libfuse-dev fuse # Required for Python llfuse module
elif [[ "$TOXENV" == *"pyfuse3"* || "$TOXENV" == *"mfusepy"* ]]; then
sudo apt-get install -y libfuse3-dev fuse3 # Required for Python pyfuse3 module
fi
- name: Install macOS packages
if: ${{ runner.os == 'macOS' }}
run: |
brew install pkg-config || brew upgrade pkg-config
brew install zstd || brew upgrade zstd
brew install lz4 || brew upgrade lz4
brew install openssl@1.1 || brew upgrade openssl@1.1
brew install --cask macfuse || brew upgrade --cask macfuse # Required for Python llfuse module
brew unlink pkg-config@0.29.2 || true
brew bundle install
- name: Configure OpenSSH SFTP server (test only)
if: ${{ runner.os == 'Linux' && !contains(matrix.toxenv, 'mypy') && !contains(matrix.toxenv, 'docs') }}
run: |
sudo mkdir -p /run/sshd
sudo useradd -m -s /bin/bash sftpuser || true
# Create SSH key for the CI user and authorize it for sftpuser
mkdir -p ~/.ssh
chmod 700 ~/.ssh
test -f ~/.ssh/id_ed25519 || ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ed25519
sudo mkdir -p /home/sftpuser/.ssh
sudo chmod 700 /home/sftpuser/.ssh
sudo cp ~/.ssh/id_ed25519.pub /home/sftpuser/.ssh/authorized_keys
sudo chown -R sftpuser:sftpuser /home/sftpuser/.ssh
sudo chmod 600 /home/sftpuser/.ssh/authorized_keys
# Allow publickey auth and enable Subsystem sftp
sudo sed -i 's/^#\?PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PubkeyAuthentication .*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
if ! grep -q '^Subsystem sftp' /etc/ssh/sshd_config; then echo 'Subsystem sftp /usr/lib/openssh/sftp-server' | sudo tee -a /etc/ssh/sshd_config; fi
# Ensure host keys exist to avoid slow generation on first sshd start
sudo ssh-keygen -A
# Start sshd (listen on default 22 inside runner)
sudo /usr/sbin/sshd -D &
# Add host key to known_hosts so paramiko trusts it
ssh-keyscan -H localhost 127.0.0.1 | tee -a ~/.ssh/known_hosts
# Start ssh-agent and add our key so paramiko can use the agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Export SFTP test URL for tox via GITHUB_ENV
echo "BORG_TEST_SFTP_REPO=sftp://sftpuser@localhost:22/borg/sftp-repo" >> $GITHUB_ENV
- name: Install and configure MinIO S3 server (test only)
if: ${{ runner.os == 'Linux' && !contains(matrix.toxenv, 'mypy') && !contains(matrix.toxenv, 'docs') }}
run: |
set -e
arch=$(uname -m)
case "$arch" in
x86_64|amd64) srv_url=https://dl.min.io/server/minio/release/linux-amd64/minio; cli_url=https://dl.min.io/client/mc/release/linux-amd64/mc ;;
aarch64|arm64) srv_url=https://dl.min.io/server/minio/release/linux-arm64/minio; cli_url=https://dl.min.io/client/mc/release/linux-arm64/mc ;;
*) echo "Unsupported arch: $arch"; exit 1 ;;
esac
curl -fsSL -o /usr/local/bin/minio "$srv_url"
curl -fsSL -o /usr/local/bin/mc "$cli_url"
sudo chmod +x /usr/local/bin/minio /usr/local/bin/mc
export PATH=/usr/local/bin:$PATH
# Start MinIO on :9000 with default credentials (minioadmin/minioadmin)
MINIO_DIR="$GITHUB_WORKSPACE/.minio-data"
MINIO_LOG="$GITHUB_WORKSPACE/.minio.log"
mkdir -p "$MINIO_DIR"
nohup minio server "$MINIO_DIR" --address ":9000" >"$MINIO_LOG" 2>&1 &
# Wait for MinIO port to be ready
for i in $(seq 1 60); do (echo > /dev/tcp/127.0.0.1/9000) >/dev/null 2>&1 && break; sleep 1; done
# Configure client and create bucket
mc alias set local http://127.0.0.1:9000 minioadmin minioadmin
mc mb --ignore-existing local/borg
# Export S3 test URL for tox via GITHUB_ENV
echo "BORG_TEST_S3_REPO=s3:minioadmin:minioadmin@http://127.0.0.1:9000/borg/s3-repo" >> $GITHUB_ENV
- name: Install Python requirements
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.d/development.txt
- name: Install borgbackup
run: |
# pip install -e .
python setup.py -v develop
- name: run pytest via tox
if [[ "$TOXENV" == *"llfuse"* ]]; then
pip install -ve ".[llfuse,cockpit,s3,sftp]"
elif [[ "$TOXENV" == *"pyfuse3"* ]]; then
pip install -ve ".[pyfuse3,cockpit,s3,sftp]"
elif [[ "$TOXENV" == *"mfusepy"* ]]; then
pip install -ve ".[mfusepy,cockpit,s3,sftp]"
else
pip install -ve ".[cockpit,s3,sftp]"
fi
- name: Build Borg fat binaries (${{ matrix.binary }})
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
run: |
pip install -r requirements.d/pyinstaller.txt
mkdir -p dist/binary
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
- name: Smoke-test the built binary (${{ matrix.binary }})
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
run: |
pushd dist/binary
echo "single-file binary"
chmod +x borg.exe
./borg.exe -V
echo "single-directory binary"
chmod +x borg-dir/borg.exe
./borg-dir/borg.exe -V
tar czf borg.tgz borg-dir
popd
# Ensure locally built binary in ./dist/binary/borg-dir is found during tests
export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH"
echo "borg.exe binary in PATH"
borg.exe -V
- name: Prepare binaries (${{ matrix.binary }})
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir -p artifacts
if [ -f dist/binary/borg.exe ]; then
cp dist/binary/borg.exe artifacts/${{ matrix.binary }}
fi
if [ -f dist/binary/borg.tgz ]; then
cp dist/binary/borg.tgz artifacts/${{ matrix.binary }}.tgz
fi
echo "binary files"
ls -l artifacts/
- name: Attest binaries provenance (${{ matrix.binary }})
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
uses: actions/attest-build-provenance@v3
with:
subject-path: 'artifacts/*'
- name: Upload binaries (${{ matrix.binary }})
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.binary }}
path: artifacts/*
if-no-files-found: error
- name: run tox env
run: |
# do not use fakeroot, but run as root. avoids the dreaded EISDIR sporadic failures. see #2482.
#sudo -E bash -c "tox -e py"
tox --skip-missing-interpreters
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
# Ensure locally built binary in ./dist/binary/borg-dir is found during tests
export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH"
tox --skip-missing-interpreters -- --junitxml=test-results.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() && !contains(matrix.toxenv, 'mypy') && !contains(matrix.toxenv, 'docs') }}
uses: codecov/codecov-action@v5
env:
OS: ${{ runner.os }}
python: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS, python
report_type: test_results
env_vars: OS,python
files: test-results.xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() && !contains(matrix.toxenv, 'mypy') && !contains(matrix.toxenv, 'docs') }}
uses: codecov/codecov-action@v5
env:
OS: ${{ runner.os }}
python: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: coverage
env_vars: OS,python
vm_tests:
permissions:
contents: read
id-token: write
attestations: write
runs-on: ubuntu-24.04
timeout-minutes: 90
needs: [lint]
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- os: freebsd
version: '14.3'
display_name: FreeBSD
# Controls binary build and provenance attestation on tags
do_binaries: true
artifact_prefix: borg-freebsd-14-x86_64-gh
- os: netbsd
version: '10.1'
display_name: NetBSD
do_binaries: false
- os: openbsd
version: '7.7'
display_name: OpenBSD
do_binaries: false
- os: omnios
version: 'r151056'
display_name: OmniOS
do_binaries: false
- os: haiku
version: 'r1beta5'
display_name: Haiku
do_binaries: false
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Test on ${{ matrix.display_name }}
id: cross_os
uses: cross-platform-actions/action@v0.32.0
env:
DO_BINARIES: ${{ matrix.do_binaries }}
with:
operating_system: ${{ matrix.os }}
version: ${{ matrix.version }}
shell: bash
run: |
set -euxo pipefail
case "${{ matrix.os }}" in
freebsd)
export IGNORE_OSVERSION=yes
sudo -E pkg update -f
sudo -E pkg install -y xxhash liblz4 zstd pkgconf
sudo -E pkg install -y fusefs-libs
sudo -E kldload fusefs
sudo -E sysctl vfs.usermount=1
sudo -E chmod 666 /dev/fuse
sudo -E pkg install -y rust
sudo -E pkg install -y gmake
sudo -E pkg install -y git
sudo -E pkg install -y python310 py310-sqlite3
sudo -E pkg install -y python311 py311-sqlite3 py311-pip py311-virtualenv
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip3
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip
# required for libsodium/pynacl build
export MAKE=gmake
python -m venv .venv
. .venv/bin/activate
python -V
pip -V
python -m pip install --upgrade pip wheel
pip install -r requirements.d/development.txt
pip install -e ".[mfusepy,cockpit,s3,sftp]"
tox -e py311-mfusepy
if [[ "${{ matrix.do_binaries }}" == "true" && "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
python -m pip install -r requirements.d/pyinstaller.txt
mkdir -p dist/binary
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
pushd dist/binary
echo "single-file binary"
chmod +x borg.exe
./borg.exe -V
echo "single-directory binary"
chmod +x borg-dir/borg.exe
./borg-dir/borg.exe -V
tar czf borg.tgz borg-dir
popd
mkdir -p artifacts
if [ -f dist/binary/borg.exe ]; then
cp -v dist/binary/borg.exe artifacts/${{ matrix.artifact_prefix }}
fi
if [ -f dist/binary/borg.tgz ]; then
cp -v dist/binary/borg.tgz artifacts/${{ matrix.artifact_prefix }}.tgz
fi
fi
;;
netbsd)
arch="$(uname -m)"
sudo -E mkdir -p /usr/pkg/etc/pkgin
echo "https://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/${arch}/10.1/All" | sudo tee /usr/pkg/etc/pkgin/repositories.conf > /dev/null
sudo -E pkgin update
sudo -E pkgin -y upgrade
sudo -E pkgin -y install zstd lz4 xxhash git
sudo -E pkgin -y install rust
sudo -E pkgin -y install pkg-config
sudo -E pkgin -y install py311-pip py311-virtualenv py311-tox
sudo -E ln -sf /usr/pkg/bin/python3.11 /usr/pkg/bin/python3
sudo -E ln -sf /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip3
sudo -E ln -sf /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv3
sudo -E ln -sf /usr/pkg/bin/tox-3.11 /usr/pkg/bin/tox3
# Ensure base system admin tools are on PATH for the non-root shell
export PATH="/sbin:/usr/sbin:$PATH"
echo "--- Preparing an extattr-enabled filesystem ---"
# On many NetBSD setups /tmp is tmpfs without extended attributes.
# Create a FFS image with extended attributes enabled and use it for TMPDIR.
VNDDEV="vnd0"
IMGFILE="/tmp/fs.img"
sudo -E dd if=/dev/zero of=${IMGFILE} bs=1m count=1024
sudo -E vndconfig -c "${VNDDEV}" "${IMGFILE}"
sudo -E newfs -O 2ea /dev/r${VNDDEV}a
MNT="/mnt/eafs"
sudo -E mkdir -p ${MNT}
sudo -E mount -t ffs -o extattr /dev/${VNDDEV}a $MNT
export TMPDIR="${MNT}/tmp"
sudo -E mkdir -p ${TMPDIR}
sudo -E chmod 1777 ${TMPDIR}
touch ${TMPDIR}/testfile
lsextattr user ${TMPDIR}/testfile && echo "[xattr] *** xattrs SUPPORTED on ${TMPDIR}! ***"
tox3 -e py311-none
;;
openbsd)
sudo -E pkg_add xxhash lz4 zstd git
sudo -E pkg_add rust
sudo -E pkg_add openssl%3.4
sudo -E pkg_add py3-pip py3-virtualenv py3-tox
export BORG_OPENSSL_NAME=eopenssl34
tox -e py312-none
;;
omnios)
sudo pkg install gcc14 git pkg-config python-313 gnu-make gnu-coreutils
sudo ln -sf /usr/bin/python3.13 /usr/bin/python3
sudo ln -sf /usr/bin/python3.13-config /usr/bin/python3-config
sudo python3 -m ensurepip
sudo python3 -m pip install virtualenv
# install libxxhash from source
git clone --depth 1 https://github.com/Cyan4973/xxHash.git
cd xxHash
sudo gmake install INSTALL=/usr/gnu/bin/install PREFIX=/usr/local
cd ..
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH:-}"
python3 -m venv .venv
. .venv/bin/activate
python -V
pip -V
python -m pip install --upgrade pip wheel
pip install -r requirements.d/development.txt
# no fuse support on omnios in our tests usually
pip install -e .
tox -e py313-none
;;
haiku)
pkgman refresh
pkgman install -y git pkgconfig zstd lz4 xxhash
pkgman install -y openssl3
pkgman install -y rust_bin
pkgman install -y python3.10
pkgman install -y cffi
pkgman install -y lz4_devel zstd_devel xxhash_devel openssl3_devel libffi_devel
# there is no pkgman package for tox, so we install it into a venv
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade pip wheel
python3 -m venv .venv
. .venv/bin/activate
export PKG_CONFIG_PATH="/system/develop/lib/pkgconfig:/system/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export BORG_LIBLZ4_PREFIX=/system/develop
export BORG_LIBZSTD_PREFIX=/system/develop
export BORG_LIBXXHASH_PREFIX=/system/develop
export BORG_OPENSSL_PREFIX=/system/develop
pip install -r requirements.d/development.txt
pip install -e .
# troubles with either tox or pytest xdist, so we run pytest manually:
pytest -v -rs --benchmark-skip -k "not remote and not socket"
;;
esac
- name: Upload artifacts
if: startsWith(github.ref, 'refs/tags/') && matrix.do_binaries
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact_prefix }}
path: artifacts/*
if-no-files-found: ignore
- name: Attest provenance
if: startsWith(github.ref, 'refs/tags/') && matrix.do_binaries
uses: actions/attest-build-provenance@v3
with:
subject-path: 'artifacts/*'
windows_tests:
if: true # can be used to temporarily disable the build
runs-on: windows-latest
timeout-minutes: 90
needs: [lint]
env:
PY_COLORS: 1
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
- name: Install system packages
run: ./scripts/msys2-install-deps development
- name: Build python venv
run: |
# building cffi / argon2-cffi in the venv fails, so we try to use the system packages
python -m venv --system-site-packages env
. env/bin/activate
# python -m pip install --upgrade pip
# pip install --upgrade setuptools build wheel
pip install -r requirements.d/pyinstaller.txt
- name: Build
run: |
# build borg.exe
. env/bin/activate
pip install -e ".[cockpit,s3,sftp]"
mkdir -p dist/binary
pyinstaller -y --clean --distpath=dist/binary scripts/borg.exe.spec
# build sdist and wheel in dist/...
python -m build
- uses: actions/upload-artifact@v6
with:
name: borg-windows
path: dist/binary/borg.exe
- name: Run tests
run: |
# Ensure locally built binary in ./dist/binary/borg-dir is found during tests
export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH"
borg.exe -V
. env/bin/activate
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --junitxml=test-results.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
env:
OS: ${{ runner.os }}
python: '3.11'
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
env_vars: OS,python
files: test-results.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
OS: ${{ runner.os }}
python: '3.11'
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: coverage
env_vars: OS,python

View file

@ -5,16 +5,33 @@ name: "CodeQL"
on:
push:
branches: [ master ]
paths:
- '**.py'
- '**.pyx'
- '**.c'
- '**.h'
- '.github/workflows/codeql-analysis.yml'
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
paths:
- '**.py'
- '**.pyx'
- '**.c'
- '**.h'
- '.github/workflows/codeql-analysis.yml'
schedule:
- cron: '39 2 * * 5'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 20
permissions:
actions: read
contents: read
@ -25,42 +42,45 @@ jobs:
matrix:
language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
# Learn more about CodeQL language support at https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all
# Just fetching one commit is not enough for setuptools-scm, so we fetch all.
fetch-depth: 0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
- name: Set up Python
uses: actions/setup-python@v6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
python-version: 3.11
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
- name: Install requirements, build and install Borg
- name: Install requirements
run: |
sudo apt install libacl1-dev
pip3 install -r requirements.d/development.txt
pip3 install -e .
sudo apt-get update
sudo apt-get install -y pkg-config build-essential
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Build and install Borg
run: |
python3 -m venv ../borg-env
source ../borg-env/bin/activate
pip3 install -r requirements.d/development.txt
pip3 install -ve .
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v4

14
.gitignore vendored
View file

@ -2,15 +2,14 @@ MANIFEST
docs/_build
build
dist
external
borg-env
.tox
src/borg/compress.c
src/borg/crypto/low_level.c
src/borg/hashindex.c
src/borg/item.c
src/borg/chunker.c
src/borg/algorithms/checksums.c
src/borg/chunkers/buzhash.c
src/borg/chunkers/buzhash64.c
src/borg/chunkers/reader.c
src/borg/checksums.c
src/borg/platform/darwin.c
src/borg/platform/freebsd.c
src/borg/platform/linux.c
@ -23,12 +22,9 @@ src/borg/_version.py
*.pyd
*.so
.idea/
.cache/
.junie/
.vscode/
borg.build/
borg.dist/
borg.exe
.coverage
.coverage.*
.vagrant
.eggs

9
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff

33
.readthedocs.yaml Normal file
View file

@ -0,0 +1,33 @@
# .readthedocs.yaml - Read the Docs configuration file.
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details.
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_checkout:
- git fetch --unshallow
apt_packages:
- build-essential
- pkg-config
- libacl1-dev
- libssl-dev
- liblz4-dev
- libzstd-dev
- libxxhash-dev
python:
install:
- requirements: requirements.d/development.lock.txt
- requirements: requirements.d/docs.txt
- method: pip
path: .
sphinx:
configuration: docs/conf.py
formats:
- htmlzip

28
AUTHORS
View file

@ -1,5 +1,5 @@
E-mail addresses listed here are not intended for support, please see
the `support section`_ instead.
Email addresses listed here are not intended for support.
Please see the `support section`_ instead.
.. _support section: https://borgbackup.readthedocs.io/en/stable/support.html
@ -44,27 +44,3 @@ Attic Patches and Suggestions
- Johann Klähn
- Petros Moisiadis
- Thomas Waldmann
BLAKE2
------
Borg includes BLAKE2: Copyright 2012, Samuel Neves <sneves@dei.uc.pt>, 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.
xxHash
------
XXH64, a fast non-cryptographic hash algorithm. Copyright 2012-2016 Yann Collet,
licensed under a BSD 2-clause license.

12
Brewfile Normal file
View file

@ -0,0 +1,12 @@
brew 'pkgconf'
brew 'zstd'
brew 'lz4'
brew 'xxhash'
brew 'openssl@3'
# osxfuse (aka macFUSE) is only required for "borg mount",
# but won't work on GitHub Actions' workers.
# It requires installing a kernel extension, so some users
# may want it and some won't.
#cask 'osxfuse'

View file

@ -1,4 +1,4 @@
Copyright (C) 2015-2022 The Borg Collective (see AUTHORS file)
Copyright (C) 2015-2025 The Borg Collective (see AUTHORS file)
Copyright (C) 2010-2014 Jonas Borgström <jonas@borgstrom.se>
All rights reserved.

View file

@ -1,7 +1,7 @@
# stuff we need to include into the sdist is handled automatically by
# The files we need to include in the sdist are handled automatically by
# setuptools_scm - it includes all git-committed files.
# but we want to exclude some committed files/dirs not needed in the sdist:
exclude .coafile .editorconfig .gitattributes .gitignore .mailmap Vagrantfile
# But we want to exclude some committed files/directories not needed in the sdist:
exclude .editorconfig .gitattributes .gitignore .mailmap Vagrantfile
prune .github
include src/borg/platform/darwin.c src/borg/platform/freebsd.c src/borg/platform/linux.c src/borg/platform/posix.c
include src/borg/platform/syncfilerange.c

View file

@ -1,6 +1,23 @@
|screencast_basic|
This is borg2!
--------------
Please note that this is the README for borg2 / master branch.
For the stable version's docs, please see here:
https://borgbackup.readthedocs.io/en/stable/
Borg2 is currently in beta testing and might get major and/or
breaking changes between beta releases (and there is no beta to
next-beta upgrade code, so you will have to delete and re-create repos).
Thus, **DO NOT USE BORG2 FOR YOUR PRODUCTION BACKUPS!** Please help with
testing it, but set it up *additionally* to your production backups.
TODO: the screencasts need a remake using borg2, see here:
https://github.com/borgbackup/borg/issues/6303
More screencasts: `installation`_, `advanced usage`_
What is BorgBackup?
-------------------
@ -8,17 +25,17 @@ 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 main goal of Borg is to provide an efficient and secure way to back up 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.
The authenticated encryption technique makes it suitable for backups to targets not
fully trusted.
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
.. _installation manual: https://borgbackup.readthedocs.io/en/master/installation.html
.. _offline documentation: https://readthedocs.org/projects/borgbackup/downloads
Main features
@ -52,15 +69,16 @@ Main features
**Speed**
* performance-critical code (chunking, compression, encryption) is
implemented in C/Cython
* local caching of files/chunks index data
* local caching
* 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.
All data can be protected client-side using 256-bit authenticated encryption
(AES-OCB or chacha20-poly1305), ensuring data confidentiality, integrity and
authenticity.
**Obfuscation**
Optionally, borg can actively obfuscate e.g. the size of files / chunks to
Optionally, Borg can actively obfuscate, e.g., the size of files/chunks to
make fingerprinting attacks more difficult.
**Compression**
@ -73,24 +91,24 @@ Main features
* 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, ...).
Borg can store data on any remote host accessible over SSH. If Borg is
installed on the remote host, significant performance gains can be achieved
compared to using a network file system (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).
**Backups mountable as file systems**
Backup archives are mountable as user-space file systems 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
* macOS
* FreeBSD
* OpenBSD and NetBSD (no xattrs/ACLs support or binaries yet)
* Cygwin (experimental, no binaries yet)
* Linux Subsystem of Windows 10 (experimental)
* Windows Subsystem for Linux (WSL) on Windows 10/11 (experimental)
**Free and Open Source Software**
* security and functionality can be audited independently
@ -100,61 +118,57 @@ Main features
Easy to use
~~~~~~~~~~~
Initialize a new backup repository (see ``borg init --help`` for encryption options)::
For ease of use, set the BORG_REPO environment variable::
$ borg init -e repokey /path/to/repo
$ export BORG_REPO=/path/to/repo
Create a backup archive::
Create a new backup repository (see ``borg repo-create --help`` for encryption options)::
$ borg create /path/to/repo::Saturday1 ~/Documents
$ borg repo-create -e repokey-aes-ocb
Now doing another backup, just to show off the great deduplication::
Create a new backup archive::
$ 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
$ borg create Monday1 ~/Documents
Unique chunks Total chunks
Chunk index: 167 330
-----------------------------------------------------------------------------
Now do another backup, just to show off the great deduplication::
$ borg create -v --stats Monday2 ~/Documents
Repository: /path/to/repo
Archive name: Monday2
Archive fingerprint: 7714aef97c1a24539cc3dc73f79b060f14af04e2541da33d54c7ee8e81a00089
Time (start): Mon, 2022-10-03 19:57:35 +0200
Time (end): Mon, 2022-10-03 19:57:35 +0200
Duration: 0.01 seconds
Number of files: 24
Original size: 29.73 MB
Deduplicated size: 520 B
For a graphical frontend refer to our complementary project `BorgWeb <https://borgweb.readthedocs.io/>`_.
Helping, Donations and Bounties, becoming a Patron
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:
You can also give monetary support to the project, see here for details:
https://www.borgbackup.org/support/fund.html
Links
-----
* `Main Web Site <https://borgbackup.readthedocs.org/>`_
* `Main website <https://borgbackup.readthedocs.io/>`_
* `Releases <https://github.com/borgbackup/borg/releases>`_,
`PyPI packages <https://pypi.python.org/pypi/borgbackup>`_ and
`ChangeLog <https://github.com/borgbackup/borg/blob/master/docs/changes.rst>`_
* `Offline Documentation <https://readthedocs.org/projects/borgbackup/downloads>`_
`PyPI packages <https://pypi.org/project/borgbackup/>`_ and
`Changelog <https://github.com/borgbackup/borg/blob/master/docs/changes.rst>`_
* `Offline documentation <https://readthedocs.org/projects/borgbackup/downloads>`_
* `GitHub <https://github.com/borgbackup/borg>`_ and
`Issue Tracker <https://github.com/borgbackup/borg/issues>`_.
* `Web-Chat (IRC) <https://web.libera.chat/#borgbackup>`_ and
`Mailing List <https://mail.python.org/mailman/listinfo/borgbackup>`_
* `License <https://borgbackup.readthedocs.org/en/stable/authors.html#license>`_
* `Security contact <https://borgbackup.readthedocs.io/en/latest/support.html#security-contact>`_
`Issue tracker <https://github.com/borgbackup/borg/issues>`_.
* `Web chat (IRC) <https://web.libera.chat/#borgbackup>`_ and
`Mailing list <https://mail.python.org/mailman/listinfo/borgbackup>`_
* `License <https://borgbackup.readthedocs.io/en/master/authors.html#license>`_
* `Security contact <https://borgbackup.readthedocs.io/en/master/support.html#security-contact>`_
Compatibility notes
-------------------
@ -164,22 +178,18 @@ 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.
THIS IS SOFTWARE IN DEVELOPMENT, DECIDE FOR 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|
|doc| |build| |coverage| |bestpractices|
.. |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
.. |doc| image:: https://readthedocs.org/projects/borgbackup/badge/?version=master
:alt: Documentation
:target: https://borgbackup.readthedocs.org/en/stable/
:target: https://borgbackup.readthedocs.io/en/master/
.. |build| image:: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master
:alt: Build Status (master)

View file

@ -1,48 +0,0 @@
Borg Native on Windows
======================
Running borg natively on windows is in a early alpha stage. Expect many things to fail.
Do not use the native windows build on any data which you do not want to lose!
Build Requirements
------------------
- VC 14.0 Compiler
- OpenSSL Library v1.1.1c, 64bit (available at https://github.com/python/cpython-bin-deps)
Please use the `win-download-openssl.ps1` script to download and extract the library to
the correct location. See also the OpenSSL section below.
- Patience and a lot of coffee / beer
What's working
--------------
.. note::
The following examples assume that the `BORG_REPO` and `BORG_PASSPHRASE` environment variables are set
if the repo or passphrase is not explicitly given.
- Borg does not crash if called with ``borg``
- ``borg init --encryption repokey-blake2 ./demoRepo`` runs without an error/warning.
Note that absolute paths only work if the protocol is explicitly set to file://
- ``borg create ::backup-{now} D:\DemoData`` works as expected.
- ``borg list`` works as expected.
- ``borg extract --strip-components 1 ::backup-XXXX`` works.
If absolute paths are extracted, it's important to pass ``--strip-components 1`` as
otherwise the data is restored to the original location!
What's NOT working
------------------
- Extracting a backup which was created on windows machine on a non windows machine will fail.
- And many things more.
OpenSSL, Windows and Python
---------------------------
Windows does not ship OpenSSL by default, so we need to get the library from somewhere else.
However, a default python installation does include `libcrypto` which is required by borg.
The only things which are missing to build borg are the header and `*.lib` files.
Luckily the python developers provide all required files in a separate repository.
The `win-download-openssl.ps1` script can be used to download the package from
https://github.com/python/cpython-bin-deps and extract the files to the correct location.
For Anaconda, the required libraries can be installed with `conda install -c anaconda openssl`.

View file

@ -2,15 +2,18 @@
## Supported Versions
These borg releases are currently supported with security updates.
These Borg releases are currently supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 1.1.x | :white_check_mark: |
|---------|--------------------|
| 2.0.x | :x: (beta) |
| 1.4.x | :white_check_mark: |
| 1.2.x | :x: (no new releases, critical fixes may still be backported) |
| 1.1.x | :x: |
| < 1.1 | :x: |
## Reporting a Vulnerability
See there:
See here:
https://borgbackup.readthedocs.io/en/latest/support.html#security-contact

325
Vagrantfile vendored
View file

@ -1,10 +1,10 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Automated creation of testing environments / binaries on misc. platforms
# Automated creation of testing environments/binaries on miscellaneous platforms
$cpus = Integer(ENV.fetch('VMCPUS', '4')) # create VMs with that many cpus
$xdistn = Integer(ENV.fetch('XDISTN', '4')) # dispatch tests to that many pytest workers
$cpus = Integer(ENV.fetch('VMCPUS', '8')) # create VMs with that many cpus
$xdistn = Integer(ENV.fetch('XDISTN', '8')) # dispatch tests to that many pytest workers
$wmem = $xdistn * 256 # give the VM additional memory for workers [MB]
def packages_debianoid(user)
@ -15,7 +15,8 @@ def packages_debianoid(user)
apt-get -y -qq update
apt-get -y -qq dist-upgrade
# for building borgbackup and dependencies:
apt install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config
apt install -y pkg-config
apt install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev || true
apt install -y libfuse-dev fuse || true
apt install -y libfuse3-dev fuse3 || true
apt install -y locales || true
@ -37,14 +38,17 @@ def packages_freebsd
# install all the (security and other) updates, base system
freebsd-update --not-running-from-cron fetch install
# for building borgbackup and dependencies:
pkg install -y liblz4 zstd pkgconf
pkg install -y xxhash liblz4 zstd pkgconf
pkg install -y fusefs-libs || true
pkg install -y fusefs-libs3 || true
pkg install -y rust
pkg install -y git bash # fakeroot causes lots of troubles on freebsd
# for building python (for the tests we use pyenv built pythons):
pkg install -y python38 py38-sqlite3 py38-virtualenv py38-pip
# make sure there is a python3 command
ln -sf /usr/local/bin/python3.8 /usr/local/bin/python3
pkg install -y python310 py310-sqlite3
pkg install -y python311 py311-sqlite3 py311-pip py311-virtualenv
# make sure there is a python3/pip3/virtualenv command
ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3
ln -sf /usr/local/bin/pip-3.11 /usr/local/bin/pip3
ln -sf /usr/local/bin/virtualenv-3.11 /usr/local/bin/virtualenv
# make bash default / work:
chsh -s bash vagrant
mount -t fdescfs fdesc /dev/fd
@ -52,7 +56,7 @@ def packages_freebsd
# make FUSE work
echo 'fuse_load="YES"' >> /boot/loader.conf
echo 'vfs.usermount=1' >> /etc/sysctl.conf
kldload fuse
kldload fusefs
sysctl vfs.usermount=1
pw groupmod operator -M vagrant
# /dev/fuse has group operator
@ -61,80 +65,86 @@ def packages_freebsd
pkg update
yes | pkg upgrade
echo 'export BORG_OPENSSL_PREFIX=/usr' >> ~vagrant/.bash_profile
# (re)mount / with acls
mount -o acls /
EOF
end
def packages_openbsd
return <<-EOF
hostname "openbsd77.localdomain"
echo "$(hostname)" > /etc/myname
echo "127.0.0.1 localhost" > /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.0.1 $(hostname) $(hostname -s)" >> /etc/hosts
echo "https://ftp.eu.openbsd.org/pub/OpenBSD" > /etc/installurl
ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/$(uname -m)/comp$(uname -r | tr -d .).tgz
tar -C / -xzphf comp$(uname -r | tr -d .).tgz
rm comp$(uname -r | tr -d .).tgz
pkg_add bash
chsh -s bash vagrant
pkg_add xxhash
pkg_add lz4
pkg_add zstd
pkg_add git # no fakeroot
pkg_add rust
pkg_add openssl%3.4
pkg_add py3-pip
pkg_add py3-virtualenv
echo 'export BORG_OPENSSL_NAME=eopenssl30' >> ~vagrant/.bash_profile
EOF
end
def packages_netbsd
return <<-EOF
# use the latest stuff, some packages in "9.2" are quite broken
echo 'http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$arch/9.0_current/All' > /usr/pkg/etc/pkgin/repositories.conf
echo 'https://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$arch/9.3/All' > /usr/pkg/etc/pkgin/repositories.conf
pkgin update
pkgin -y upgrade
pkg_add zstd lz4 xxhash git
pkg_add rust
pkg_add bash
chsh -s bash vagrant
echo "export PROMPT_COMMAND=" >> ~vagrant/.bash_profile # bug in netbsd 9.2, .bash_profile broken for screen
echo "export PROMPT_COMMAND=" >> ~root/.bash_profile # bug in netbsd 9.2, .bash_profile broken for screen
echo "export PROMPT_COMMAND=" >> ~vagrant/.bash_profile # bug in netbsd 9.3, .bash_profile broken for screen
echo "export PROMPT_COMMAND=" >> ~root/.bash_profile # bug in netbsd 9.3, .bash_profile broken for screen
pkg_add pkg-config
# pkg_add fuse # llfuse supports netbsd, but is still buggy.
# https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
pkg_add python38 py38-sqlite3 py38-pip py38-virtualenv py38-expat
ln -s /usr/pkg/lib/python3.8/_sysconfigdata_netbsd9.py /usr/pkg/lib/python3.8/_sysconfigdata__netbsd9_.py # bug in netbsd 9.2, expected filename not there.
pkg_add python39 py39-sqlite3 py39-pip py39-virtualenv py39-expat
ln -s /usr/pkg/bin/python3.9 /usr/pkg/bin/python
ln -s /usr/pkg/bin/python3.9 /usr/pkg/bin/python3
ln -s /usr/pkg/bin/pip3.9 /usr/pkg/bin/pip
ln -s /usr/pkg/bin/pip3.9 /usr/pkg/bin/pip3
ln -s /usr/pkg/bin/virtualenv-3.9 /usr/pkg/bin/virtualenv
ln -s /usr/pkg/bin/virtualenv-3.9 /usr/pkg/bin/virtualenv3
ln -s /usr/pkg/lib/python3.9/_sysconfigdata_netbsd9.py /usr/pkg/lib/python3.9/_sysconfigdata__netbsd9_.py # bug in netbsd 9.2, expected filename not there.
pkg_add py311-sqlite3 py311-pip py311-virtualenv py311-expat
ln -s /usr/pkg/bin/python3.11 /usr/pkg/bin/python
ln -s /usr/pkg/bin/python3.11 /usr/pkg/bin/python3
ln -s /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip
ln -s /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip3
ln -s /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv
ln -s /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv3
EOF
end
def packages_darwin
def package_update_openindiana
return <<-EOF
# install all the (security and other) updates
sudo softwareupdate --ignore iTunesX
sudo softwareupdate --ignore iTunes
sudo softwareupdate --ignore Safari
sudo softwareupdate --ignore "Install macOS High Sierra"
sudo softwareupdate --install --all
which brew || CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update > /dev/null
brew install pkg-config readline openssl@1.1 zstd lz4 xz fakeroot
brew install --cask macfuse
# brew upgrade # upgrade everything (takes rather long)
echo 'export PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig' >> ~vagrant/.bash_profile
echo "nameserver 1.1.1.1" > /etc/resolv.conf
# needs separate provisioning step + reboot to become effective:
pkg update
EOF
end
def packages_openindiana
return <<-EOF
# needs separate provisioning step + reboot:
#pkg update
#pkg install gcc-7 python-39 setuptools-39
ln -sf /usr/bin/python3.9 /usr/bin/python3
pkg install gcc-13 git
pkg install pkg-config libxxhash
pkg install python-313
ln -sf /usr/bin/python3.13 /usr/bin/python3
ln -sf /usr/bin/python3.13-config /usr/bin/python3-config
python3 -m ensurepip
ln -sf /usr/bin/pip3.9 /usr/bin/pip3
ln -sf /usr/bin/pip3.13 /usr/bin/pip3
pip3 install virtualenv
# let borg's pkg-config find openssl:
pfexec pkg set-mediator -V 3 openssl
EOF
end
def install_pyenv(boxname)
return <<-EOF
echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
echo 'export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared"' >> ~/.bash_profile
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
. ~/.bash_profile
@ -147,18 +157,11 @@ def install_pyenv(boxname)
EOF
end
def fix_pyenv_darwin(boxname)
return <<-EOF
echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
EOF
end
def install_pythons(boxname)
return <<-EOF
. ~/.bash_profile
pyenv install 3.10.0 # tests, version supporting openssl 1.1
pyenv install 3.9.10 # tests, version supporting openssl 1.1, binary build
pyenv install 3.8.0 # tests, version supporting openssl 1.1
echo "PYTHON_CONFIGURE_OPTS: ${PYTHON_CONFIGURE_OPTS}"
pyenv install 3.13.8
pyenv rehash
EOF
end
@ -175,9 +178,9 @@ def build_pyenv_venv(boxname)
return <<-EOF
. ~/.bash_profile
cd /vagrant/borg
# use the latest 3.9 release
pyenv global 3.9.10
pyenv virtualenv 3.9.10 borg-env
# use the latest 3.13 release
pyenv global 3.13.8
pyenv virtualenv 3.13.8 borg-env
ln -s ~/.pyenv/versions/borg-env .
EOF
end
@ -190,8 +193,10 @@ def install_borg(fuse)
pip install -U wheel # upgrade wheel, might be too old
cd borg
pip install -r requirements.d/development.lock.txt
python setup.py clean
python setup.py clean2
python3 scripts/make.py clean
# install borgstore WITH all options, so it pulls in the needed
# requirements, so they will also get into the binaries built. #8574
pip install borgstore[sftp,s3]
pip install -e .[#{fuse}]
EOF
end
@ -201,10 +206,7 @@ def install_pyinstaller()
. ~/.bash_profile
cd /vagrant/borg
. borg-env/bin/activate
git clone https://github.com/thomaswaldmann/pyinstaller.git
cd pyinstaller
git checkout v4.7-maint
python setup.py install
pip install -r requirements.d/pyinstaller.txt
EOF
end
@ -227,8 +229,8 @@ def run_tests(boxname, skip_env)
. ../borg-env/bin/activate
if which pyenv 2> /dev/null; then
# for testing, use the earliest point releases of the supported python versions:
pyenv global 3.8.0 3.9.10 3.10.0
pyenv local 3.8.0 3.9.10 3.10.0
pyenv global 3.13.8
pyenv local 3.13.8
fi
# otherwise: just use the system python
# some OSes can only run specific test envs, e.g. because they miss FUSE support:
@ -269,147 +271,164 @@ Vagrant.configure(2) do |config|
v.cpus = $cpus
end
config.vm.define "focal64" do |b|
b.vm.box = "ubuntu/focal64"
config.vm.define "noble" do |b|
b.vm.box = "bento/ubuntu-24.04"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("focal64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("noble")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("focal64", ".*none.*")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("noble", ".*none.*")
end
config.vm.define "bullseye64" do |b|
config.vm.define "jammy" do |b|
b.vm.box = "ubuntu/jammy64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jammy")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jammy", ".*none.*")
end
config.vm.define "trixie" do |b|
b.vm.box = "debian/testing64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("trixie")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("trixie")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("trixie")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("trixie")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trixie", ".*none.*")
end
config.vm.define "bookworm32" do |b|
b.vm.box = "generic-x32/debian12"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bookworm32")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bookworm32")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bookworm32")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bookworm32")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bookworm32", ".*none.*")
end
config.vm.define "bookworm" do |b|
b.vm.box = "debian/bookworm64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bookworm")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bookworm")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bookworm")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bookworm")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bookworm", ".*none.*")
end
config.vm.define "bullseye" do |b|
b.vm.box = "debian/bullseye64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bullseye64")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bullseye64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bullseye64")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bullseye")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bullseye")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bullseye")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bullseye64")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bullseye64", ".*none.*")
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bullseye")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bullseye", ".*none.*")
end
config.vm.define "buster64" do |b|
b.vm.box = "debian/buster64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("buster64")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("buster64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("buster64")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("buster64")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("buster64", ".*none.*")
end
config.vm.define "stretch64" do |b|
b.vm.box = "debian/stretch64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("stretch64")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("stretch64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("stretch64")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("stretch64")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64", ".*(fuse3|none).*")
end
config.vm.define "freebsd64" do |b|
b.vm.box = "freebsd121-64"
config.vm.define "freebsd13" do |b|
b.vm.box = "generic/freebsd13"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.ssh.shell = "sh"
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages freebsd", :type => :shell, :inline => packages_freebsd
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd64")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd64")
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd13")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd13")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd13")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd64")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd64", ".*(fuse3|none).*")
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd13")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd13", ".*(pyfuse3|none).*")
end
config.vm.define "openbsd64" do |b|
b.vm.box = "generic/openbsd6"
config.vm.define "freebsd14" do |b|
b.vm.box = "generic/freebsd14"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.ssh.shell = "sh"
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages freebsd", :type => :shell, :inline => packages_freebsd
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd14")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd14")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd14")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd14")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd14", ".*(pyfuse3|none).*")
end
config.vm.define "openbsd7" do |b|
b.vm.box = "l3system/openbsd77-amd64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd7")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64", ".*fuse.*")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd7", ".*fuse.*")
end
config.vm.define "netbsd64" do |b|
config.vm.define "netbsd9" do |b|
b.vm.box = "generic/netbsd9"
b.vm.provider :virtualbox do |v|
v.memory = 4096 + $wmem # need big /tmp tmpfs in RAM!
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64", ".*fuse.*")
end
config.vm.define "darwin64" do |b|
b.vm.box = "macos-sierra"
b.vm.provider :virtualbox do |v|
v.memory = 4096 + $wmem
v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
v.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
# Adjust CPU settings according to
# https://github.com/geerlingguy/macos-virtualbox-vm
v.customize ['modifyvm', :id, '--cpuidset',
'00000001', '000306a9', '00020800', '80000201', '178bfbff']
# Disable USB variant requiring Virtualbox proprietary extension pack
v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64", ".*(fuse3|none).*")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd9")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd9", ".*fuse.*")
end
# rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
# permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
config.vm.define "openindiana64" do |b|
b.vm.box = "openindiana"
config.vm.define "openindiana" do |b|
b.vm.box = "openindiana/hipster"
b.vm.provider :virtualbox do |v|
v.memory = 2048 + $wmem
end
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
b.vm.provision "package update openindiana", :type => :shell, :inline => package_update_openindiana, :reboot => true
b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana")
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64", ".*fuse.*")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana", ".*fuse.*")
end
# TODO: create more VMs with python 3.8+ and openssl 1.1.
# See branch 1.1-maint for a better equipped Vagrantfile (but still on py35 and openssl 1.0).
end

View file

@ -1,81 +0,0 @@
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 # noqa: E402
from borg.logger import setup_logging # noqa: E402
# Ensure that the loggers exist for all tests
setup_logging()
from borg.testsuite import has_lchflags, has_llfuse, has_pyfuse3 # noqa: E402
from borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supported # noqa: E402
from borg.testsuite.platform import fakeroot_detected # noqa: E402
@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_') and key not in ('BORG_FUSE_IMPL', )]
for key in keys:
monkeypatch.delenv(key, raising=False)
def pytest_report_header(config, startdir):
tests = {
"BSD flags": has_lchflags,
"fuse2": has_llfuse,
"fuse3": has_pyfuse3,
"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)

View file

@ -1,5 +1,5 @@
Here we store 3rd party documentation, licenses, etc.
Here we store third-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
Please note that all files inside the "borg" package directory (except those
excluded in setup.py) will be installed, so do not keep docs or licenses
there.

View file

@ -1,122 +0,0 @@
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.

View file

@ -1,13 +0,0 @@
# 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

View file

@ -1,24 +0,0 @@
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.

View file

@ -1,30 +0,0 @@
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.

View file

@ -21,7 +21,7 @@ help:
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " htmlhelp to make HTML files and an HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"

View file

@ -1,6 +1,6 @@
<div class="sidebar-block">
<div class="sidebar-toc">
{# Restrict the sidebar toc depth to two levels while generating command usage pages.
{# Restrict the sidebar ToC depth to two levels while generating command usage pages.
This avoids superfluous entries for each "Description" and "Examples" heading. #}
{% if pagename.startswith("usage/") and pagename not in (
"usage/general", "usage/help", "usage/debug", "usage/notes",

173
docs/_templates/layout.html vendored Normal file
View file

@ -0,0 +1,173 @@
{%- extends "basic/layout.html" %}
{# Do this so that Bootstrap is included before the main CSS file. #}
{%- block htmltitle %}
{% set script_files = script_files + ["_static/myscript.js"] %}
<!-- Licensed under the Apache 2.0 License -->
<link rel="stylesheet" type="text/css" href="{{ pathto('_static/fonts/open-sans/stylesheet.css', 1) }}" />
<!-- Licensed under the SIL Open Font License -->
<link rel="stylesheet" type="text/css" href="{{ pathto('_static/fonts/source-serif-pro/source-serif-pro.css', 1) }}" />
<link rel="stylesheet" type="text/css" href="{{ pathto('_static/css/bootstrap.min.css', 1) }}" />
<link rel="stylesheet" type="text/css" href="{{ pathto('_static/css/bootstrap-theme.min.css', 1) }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ super() }}
{%- endblock %}
{%- block extrahead %}
{% if theme_touch_icon %}
<link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
{% endif %}
{{ super() }}
{% endblock %}
{# Displays the URL for the homepage if it's set, or the master_doc if it is not. #}
{% macro homepage() -%}
{%- if theme_homepage %}
{%- if hasdoc(theme_homepage) %}
{{ pathto(theme_homepage) }}
{%- else %}
{{ theme_homepage }}
{%- endif %}
{%- else %}
{{ pathto(master_doc) }}
{%- endif %}
{%- endmacro %}
{# Displays the URL for the tospage if it's set, or falls back to the homepage macro. #}
{% macro tospage() -%}
{%- if theme_tospage %}
{%- if hasdoc(theme_tospage) %}
{{ pathto(theme_tospage) }}
{%- else %}
{{ theme_tospage }}
{%- endif %}
{%- else %}
{{ homepage() }}
{%- endif %}
{%- endmacro %}
{# Displays the URL for the projectpage if it's set, or falls back to the homepage macro. #}
{% macro projectlink() -%}
{%- if theme_projectlink %}
{%- if hasdoc(theme_projectlink) %}
{{ pathto(theme_projectlink) }}
{%- else %}
{{ theme_projectlink }}
{%- endif %}
{%- else %}
{{ homepage() }}
{%- endif %}
{%- endmacro %}
{# Displays the next and previous links both before and after the content. #}
{% macro render_relations() -%}
{% if prev or next %}
<div class="footer-relations">
{% if prev %}
<div class="pull-left">
<a class="btn btn-default" href="{{ prev.link|e }}" title="{{ _('previous chapter')}} (use the left arrow)">{{ prev.title }}</a>
</div>
{% endif %}
{%- if next and next.title != '&lt;no title&gt;' %}
<div class="pull-right">
<a class="btn btn-default" href="{{ next.link|e }}" title="{{ _('next chapter')}} (use the right arrow)">{{ next.title }}</a>
</div>
{%- endif %}
</div>
<div class="clearer"></div>
{% endif %}
{%- endmacro %}
{%- macro guzzle_sidebar() %}
<div id="left-column">
<div class="sphinxsidebar">
{%- if sidebars != None %}
{#- New-style sidebar: explicitly include/exclude templates. #}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{% else %}
{% include "logo-text.html" %}
{% include "globaltoc.html" %}
{% include "searchbox.html" %}
{%- endif %}
</div>
</div>
{%- endmacro %}
{%- block content %}
{%- if pagename == 'index' and theme_index_template %}
{% include theme_index_template %}
{%- else %}
<div class="container-wrapper">
<div id="mobile-toggle">
<a href="#"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span></a>
</div>
{%- block sidebar1 %}{{ guzzle_sidebar() }}{% endblock %}
{%- block document_wrapper %}
{%- block document %}
<div id="right-column">
{% block breadcrumbs %}
<div role="navigation" aria-label="breadcrumbs navigation">
<ol class="breadcrumb">
<li><a href="{{ pathto(master_doc) }}">Docs</a></li>
{% for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
{% endfor %}
<li>{{ title }}</li>
</ol>
</div>
{% endblock %}
<div class="document clearer body" role="main">
{% block body %} {% endblock %}
</div>
{%- block bottom_rel_links %}
{{ render_relations() }}
{%- endblock %}
</div>
<div class="clearfix"></div>
{%- endblock %}
{%- endblock %}
{%- block comments -%}
{% if theme_disqus_comments_shortname %}
<div class="container comment-container">
{% include "comments.html" %}
</div>
{% endif %}
{%- endblock %}
</div>
{%- endif %}
{%- endblock %}
{%- block footer %}
<script type="text/javascript">
$("#mobile-toggle a").click(function () {
$("#left-column").toggle();
});
</script>
<script type="text/javascript" src="{{ pathto('_static/js/bootstrap.js', 1)}}"></script>
{%- block footer_wrapper %}
<div class="footer">
&copy; Copyright {{ copyright }}. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
{%- endblock %}
{%- block ga %}
{%- if theme_google_analytics_account %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ theme_google_analytics_account }}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{%- endif %}
{%- endblock %}
{%- endblock %}

117
docs/binaries/00_README.txt Normal file
View file

@ -0,0 +1,117 @@
Binary BorgBackup builds
========================
General notes
-------------
The binaries are supposed to work on the specified platform without installing anything else.
There are some limitations, though:
- for Linux, your system must have the same or newer glibc version as the one used for building
- for macOS, you need to have the same or newer macOS version as the one used for building
- for other OSes, there are likely similar limitations
If you don't find something working on your system, check the older borg releases.
*.asc are GnuPG signatures - only provided for locally built binaries.
*.exe (or no extension) is the single-file fat binary.
*.tgz is the single-directory fat binary (extract it once with tar -xzf).
Using the single-directory build is faster and does not require as much space
in the temporary directory as the self-extracting single-file build.
macOS: to avoid issues, download the file via the command line OR remove the
"quarantine" attribute after downloading:
$ xattr -dr com.apple.quarantine borg-macos1012.tgz
Download the correct files
--------------------------
Binaries built on GitHub servers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
borg-linux-glibc235-x86_64-gh Linux AMD/Intel (built on Ubuntu 22.04 LTS with glibc 2.35)
borg-linux-glibc235-arm64-gh Linux ARM (built on Ubuntu 22.04 LTS with glibc 2.35)
borg-macos-15-arm64-gh macOS Apple Silicon (built on macOS 15 w/o FUSE support)
borg-macos-15-x86_64-gh macOS Intel (built on macOS 15 w/o FUSE support)
borg-freebsd-14-x86_64-gh FreeBSD AMD/Intel (built on FreeBSD 14)
Binaries built locally
~~~~~~~~~~~~~~~~~~~~~~
borg-linux-glibc231-x86_64 Linux (built on Debian 11 "Bullseye" with glibc 2.31)
Note: if you don't find a specific binary here, check release 1.4.1 or 1.2.9.
Verifying your download
-----------------------
I provide GPG signatures for files which I have built locally on my machines.
To check the GPG signature, download both the file and the corresponding
signature (*.asc file) and then (on the shell) type, for example:
gpg --recv-keys 9F88FB52FAF7B393
gpg --verify borgbackup.tar.gz.asc borgbackup.tar.gz
The files are signed by:
Thomas Waldmann <tw@waldmann-edv.de>
GPG key fingerprint: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393
My fingerprint is also in the footer of all my BorgBackup mailing list posts.
Provenance attestations for GitHub-built binaries
-------------------------------------------------
For binaries built on GitHub (files with a "-gh" suffix in the name), we publish
an artifact provenance attestation that proves the binary was built by our
GitHub Actions workflow from a specific commit or tag. You can verify this using
the GitHub CLI (gh). Install it from https://cli.github.com/ and make sure you
use a recent version that supports "gh attestation".
Practical example (Linux, 2.0.0b20 tag):
curl -LO https://github.com/borgbackup/borg/releases/download/2.0.0b20/borg-linux-glibc235-x86_64-gh
gh attestation verify --repo borgbackup/borg --source-ref refs/tags/2.0.0b20 borg-linux-glibc235-x86_64-gh
If verification succeeds, gh prints a summary stating the subject (your file),
that it was attested by GitHub Actions, and the job/workflow reference.
Installing
----------
It is suggested that you rename or symlink the binary to just "borg".
If you need "borgfs", just also symlink it to the same binary; it will
detect internally under which name it was invoked.
On UNIX-like platforms, /usr/local/bin/ or ~/bin/ is a nice place for it,
but you can invoke it from anywhere by providing the full path to it.
Make sure the file is readable and executable (chmod +rx borg on UNIX-like
platforms).
Reporting issues
----------------
Please first check the FAQ and whether a GitHub issue already exists.
If you find a NEW issue, please open a ticket on our issue tracker:
https://github.com/borgbackup/borg/issues/
There, please give:
- the version number (it is displayed if you invoke borg -V)
- the sha256sum of the binary
- a good description of what the issue is
- a good description of how to reproduce your issue
- a traceback with system info (if you have one)
- your precise platform (CPU, 32/64-bit?), OS, distribution, release
- your Python and (g)libc versions

View file

@ -5,8 +5,8 @@
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)
.. 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

View file

@ -52,8 +52,7 @@ h1 {
}
.container.experimental,
#debugging-facilities,
#borg-recreate {
#debugging-facilities {
/* 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 */

File diff suppressed because it is too large Load diff

807
docs/changes_0.x.rst Normal file
View file

@ -0,0 +1,807 @@
.. _changelog_0x:
Change Log 0.x
==============
Version 0.30.0 (2016-01-23)
---------------------------
Compatibility notes:
- The new default logging level is WARNING. Previously, it was INFO, which was
more verbose. Use -v (or --info) to show once again log level INFO messages.
See the "general" section in the usage docs.
- For borg create, you need --list (in addition 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 <archive>
- 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 is now used (in addition 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 command-line interface changes; otherwise
you'll get an error message about an RPC protocol mismatch or a wrong command-line
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 should 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 back up 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 <topic> 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 not to 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, use --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 back up 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 back up 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 <repo>", "delete <repo>", "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 <repo> (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 not to 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

4879
docs/changes_1.x.rst Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
# documentation build configuration file, created by
# 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.
# This file is execfile()d with the current directory set to its containing directory.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
@ -12,166 +12,164 @@
# 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'))
import sys
import 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'
# 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']
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = 'Borg - Deduplicating Archiver'
copyright = u'2010-2014 Jonas Borgström, 2015-2022 The Borg Collective (see AUTHORS file)'
project = "Borg - Deduplicating Archiver"
copyright = "2010-2014 Jonas Borgström, 2015-2025 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 '-'
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']
suppress_warnings = ["image.nonlocal_uri"]
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%Y-%m-%d'
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']
exclude_patterns = ["_build"]
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# default_role = None
# The Borg docs contain no or very little Python docs.
# Thus, the primary domain is rst.
primary_domain = 'rst'
# Thus, the primary domain is RST.
primary_domain = "rst"
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# 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
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# 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.
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of built-in themes.
import guzzle_sphinx_theme
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
html_theme = "guzzle_sphinx_theme"
def set_rst_settings(app):
app.env.settings.update({
'field_name_limit': 0,
'option_limit': 0,
})
app.env.settings.update({"field_name_limit": 0, "option_limit": 0})
def setup(app):
app.add_css_file('css/borg.css')
app.connect('builder-inited', set_rst_settings)
app.setup_extension("sphinxcontrib.jquery")
app.add_css_file("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,
}
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']
# html_theme_path = ['_themes']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# 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'
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'
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_static_path = ["borg_theme"]
html_extra_path = ['../src/borg/paperkey.html']
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'
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
smartquotes_action = "qe" # no D in there means "do not transform -- and ---"
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'searchbox.html', 'globaltoc.html'],
}
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 = {}
# html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# 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
# html_split_index = False
# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False
@ -185,57 +183,45 @@ html_show_copyright = False
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'borgdoc'
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'),
]
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_logo = "_static/logo.pdf"
latex_elements = {
'papersize': 'a4paper',
'pointsize': '10pt',
'figure_align': 'H',
}
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
# latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
latex_show_urls = 'footnote'
latex_show_urls = "footnote"
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# latex_preamble = ''
# Documents to append as an appendix to all manuals.
latex_appendices = [
'support',
'resources',
'changes',
'authors',
]
latex_appendices = ["support", "resources", "changes", "authors"]
# If false, no module index is generated.
#latex_domain_indices = True
# latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
@ -243,21 +229,23 @@ latex_appendices = [
# 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),
(
"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',
"sphinx.ext.extlinks",
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinxcontrib.jquery", # jquery is not included anymore by default
"guzzle_sphinx_theme", # register the theme as an extension to generate a sitemap.xml
]
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),
}
extlinks = {"issue": ("https://github.com/borgbackup/borg/issues/%s", "#%s")}

View file

@ -14,3 +14,4 @@ This chapter details deployment strategies for the following scenarios.
deployment/automated-local
deployment/image-backup
deployment/pull-backup
deployment/non-root-user

View file

@ -14,13 +14,13 @@ systemd and udev.
Overview
--------
An udev rule is created to trigger on the addition of block devices. The rule contains a tag
that triggers systemd to start a oneshot service. The oneshot service executes a script in
A udev rule is created to trigger on the addition of block devices. The rule contains a tag
that triggers systemd to start a one-shot service. The one-shot service executes a script in
the standard systemd service environment, which automatically captures stdout/stderr and
logs it to the journal.
The script mounts the added block device, if it is a registered backup drive, and creates
backups on it. When done, it optionally unmounts the file system and spins the drive down,
The script mounts the added block device if it is a registered backup drive and creates
backups on it. When done, it optionally unmounts the filesystem and spins the drive down,
so that it may be physically disconnected.
Configuring the system
@ -29,26 +29,13 @@ Configuring the system
First, create the ``/etc/backups`` directory (as root).
All configuration goes into this directory.
Then, create ``/etc/backups/40-backup.rules`` with the following content (all on one line)::
Find out the ID of the partition table of your backup disk (here assumed to be /dev/sdz)::
ACTION=="add", SUBSYSTEM=="bdi", DEVPATH=="/devices/virtual/bdi/*",
TAG+="systemd", ENV{SYSTEMD_WANTS}="automatic-backup.service"
lsblk --fs -o +PTUUID /dev/sdz
.. topic:: Finding a more precise udev rule
Then, create ``/etc/backups/80-backup.rules`` with the following content (all on one line)::
If you always connect the drive(s) to the same physical hardware path, e.g. the same
eSATA port, then you can make a more precise udev rule.
Execute ``udevadm monitor`` and connect a drive to the port you intend to use.
You should see a flurry of events, find those regarding the `block` subsystem.
Pick the event whose device path ends in something similar to a device file name,
typically`sdX/sdXY`. Use the event's device path and replace `sdX/sdXY` after the
`/block/` part in the path with a star (\*). For example:
`DEVPATH=="/devices/pci0000:00/0000:00:11.0/ata3/host2/target2:0:0/2:0:0:0/block/*"`.
Reboot a few times to ensure that the hardware path does not change: on some motherboards
components of it can be random. In these cases you cannot use a more accurate rule,
or need to insert additional stars for matching the path.
ACTION=="add", SUBSYSTEM=="block", ENV{ID_PART_TABLE_UUID}=="<the PTUUID you just noted>", TAG+="systemd", ENV{SYSTEMD_WANTS}+="automatic-backup.service"
The "systemd" tag in conjunction with the SYSTEMD_WANTS environment variable has systemd
launch the "automatic-backup" service, which we will create next, as the
@ -60,8 +47,8 @@ launch the "automatic-backup" service, which we will create next, as the
Type=oneshot
ExecStart=/etc/backups/run.sh
Now, create the main backup script, ``/etc/backups/run.sh``. Below is a template,
modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
Now, create the main backup script, ``/etc/backups/run.sh``. Below is a template;
modify it to suit your needs (e.g., more backup sets, dumping databases, etc.).
.. code-block:: bash
@ -107,10 +94,10 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
echo "Disk $uuid is a backup disk"
partition_path=/dev/disk/by-uuid/$uuid
# Mount file system if not already done. This assumes that if something is already
# mounted at $MOUNTPOINT, it is the backup drive. It won't find the drive if
# Mount filesystem if not already done. This assumes that if something is already
# mounted at $MOUNTPOINT, it is the backup drive. It will not find the drive if
# it was mounted somewhere else.
(mount | grep $MOUNTPOINT) || mount $partition_path $MOUNTPOINT
findmnt $MOUNTPOINT >/dev/null || mount $partition_path $MOUNTPOINT
drive=$(lsblk --inverse --noheadings --list --paths --output name $partition_path | head --lines 1)
echo "Drive path: $drive"
@ -119,13 +106,13 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
#
# Options for borg create
BORG_OPTS="--stats --one-file-system --compression lz4 --checkpoint-interval 86400"
BORG_OPTS="--stats --one-file-system --compression lz4"
# Set BORG_PASSPHRASE or BORG_PASSCOMMAND somewhere around here, using export,
# if encryption is used.
# No one can answer if Borg asks these questions, it is better to just fail quickly
# instead of hanging.
# Because no one can answer these questions non-interactively, it is better to
# fail quickly instead of hanging.
export BORG_RELOCATED_REPO_ACCESS_IS_OK=no
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no
@ -136,16 +123,16 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
# This is just an example, change it however you see fit
borg create $BORG_OPTS \
--exclude /root/.cache \
--exclude /var/lib/docker/devicemapper \
--exclude root/.cache \
--exclude var/lib/docker/devicemapper \
$TARGET::$DATE-$$-system \
/ /boot
# /home is often a separate partition / file system.
# Even if it isn't (add --exclude /home above), it probably makes sense
# /home is often a separate partition/filesystem.
# Even if it is not (add --exclude /home above), it probably makes sense
# to have /home in a separate archive.
borg create $BORG_OPTS \
--exclude 'sh:/home/*/.cache' \
--exclude 'sh:home/*/.cache' \
$TARGET::$DATE-$$-home \
/home/
@ -164,21 +151,20 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
fi
Create the ``/etc/backups/autoeject`` file to have the script automatically eject the drive
after creating the backup. Rename the file to something else (e.g. ``/etc/backup/autoeject-no``)
when you want to do something with the drive after creating backups (e.g running check).
after creating the backup. Rename the file to something else (e.g., ``/etc/backups/autoeject-no``)
when you want to do something with the drive after creating backups (e.g., running checks).
Create the ``/etc/backups/backup-suspend`` file if the machine should suspend after completing
the backup. Don't forget to physically disconnect the device before resuming,
the backup. Don't forget to disconnect the device physically before resuming,
otherwise you'll enter a cycle. You can also add an option to power down instead.
Create an empty ``/etc/backups/backup.disks`` file, you'll register your backup drives
there.
Create an empty ``/etc/backups/backup.disks`` file, in which you will register your backup drives.
The last part is to actually enable the udev rules and services:
Finally, enable the udev rules and services:
.. code-block:: bash
ln -s /etc/backups/40-backup.rules /etc/udev/rules.d/40-backup.rules
ln -s /etc/backups/80-backup.rules /etc/udev/rules.d/80-backup.rules
ln -s /etc/backups/automatic-backup.service /etc/systemd/system/automatic-backup.service
systemctl daemon-reload
udevadm control --reload
@ -187,13 +173,13 @@ Adding backup hard drives
-------------------------
Connect your backup hard drive. Format it, if not done already.
Find the UUID of the file system that backups should be stored on::
Find the UUID of the filesystem on which backups should be stored::
lsblk -o+uuid,label
Note the UUID into the ``/etc/backup/backup.disks`` file.
Record the UUID in the ``/etc/backups/backup.disks`` file.
Mount the drive to /mnt/backup.
Mount the drive at /mnt/backup.
Initialize a Borg repository at the location indicated by ``TARGET``::
@ -211,14 +197,14 @@ See backup logs using journalctl::
Security considerations
-----------------------
The script as shown above will mount any file system with an UUID listed in
``/etc/backup/backup.disks``. The UUID check is a safety / annoyance-reduction
The script as shown above will mount any filesystem with a UUID listed in
``/etc/backups/backup.disks``. The UUID check is a safety/annoyance-reduction
mechanism to keep the script from blowing up whenever a random USB thumb drive is connected.
It is not meant as a security mechanism. Mounting file systems and reading repository
data exposes additional attack surfaces (kernel file system drivers,
possibly user space services and Borg itself). On the other hand, someone
It is not meant as a security mechanism. Mounting filesystems and reading repository
data exposes additional attack surfaces (kernel filesystem drivers,
possibly userspace services, and Borg itself). On the other hand, someone
standing right next to your computer can attempt a lot of attacks, most of which
are easier to do than e.g. exploiting file systems (installing a physical key logger,
are easier to do than, e.g., exploiting filesystems (installing a physical keylogger,
DMA attacks, stealing the machine, ...).
Borg ensures that backups are not created on random drives that "just happen"

View file

@ -1,47 +1,48 @@
.. include:: ../global.rst.inc
.. highlight:: none
.. _central-backup-server:
Central repository server with Ansible or Salt
==============================================
This section will give an example how to setup a borg repository server for multiple
This section gives an example of how to set up a Borg repository server for multiple
clients.
Machines
--------
There are multiple machines used in this section and will further be named by their
respective fully qualified domain name (fqdn).
This section uses multiple machines, referred to by their
respective fully qualified domain names (FQDNs).
* The backup server: `backup01.srv.local`
* The clients:
- John Doe's desktop: `johndoe.clnt.local`
- Webserver 01: `web01.srv.local`
- Web server 01: `web01.srv.local`
- Application server 01: `app01.srv.local`
User and group
--------------
The repository server needs to have only one UNIX user for all the clients.
The repository server should have a single UNIX user for all the clients.
Recommended user and group with additional settings:
* User: `backup`
* Group: `backup`
* Shell: `/bin/bash` (or other capable to run the `borg serve` command)
* Shell: `/bin/bash` (or another shell capable of running the `borg serve` command)
* Home: `/home/backup`
Most clients shall initiate a backup from the root user to catch all
users, groups and permissions (e.g. when backing up `/home`).
Most clients should initiate a backup as the root user to capture all
users, groups, and permissions (e.g., when backing up `/home`).
Folders
-------
The following folder tree layout is suggested on the repository server:
The following directory layout is suggested on the repository server:
* User home directory, /home/backup
* Repositories path (storage pool): /home/backup/repos
* Clients restricted paths (`/home/backup/repos/<client fqdn>`):
* Clients restricted paths (`/home/backup/repos/<client fqdn>`):
- johndoe.clnt.local: `/home/backup/repos/johndoe.clnt.local`
- web01.srv.local: `/home/backup/repos/web01.srv.local`
@ -59,10 +60,10 @@ but no other directories. You can allow a client to access several separate dire
which could make sense if multiple machines belong to one person which should then have access to all the
backups of their machines.
There is only one ssh key per client allowed. Keys are added for ``johndoe.clnt.local``, ``web01.srv.local`` and
``app01.srv.local``. But they will access the backup under only one UNIX user account as:
Only one SSH key per client is allowed. Keys are added for ``johndoe.clnt.local``, ``web01.srv.local`` and
``app01.srv.local``. They will access the backup under a single UNIX user account as
``backup@backup01.srv.local``. Every key in ``$HOME/.ssh/authorized_keys`` has a
forced command and restrictions applied as shown below:
forced command and restrictions applied, as shown below:
::
@ -72,19 +73,19 @@ forced command and restrictions applied as shown below:
.. note:: The text shown above needs to be written on a single line!
The options which are added to the key will perform the following:
The options added to the key perform the following:
1. Change working directory
2. Run ``borg serve`` restricted to the client base path
3. Restrict ssh and do not allow stuff which imposes a security risk
Due to the ``cd`` command we use, the server automatically changes the current
working directory. Then client doesn't need to have knowledge of the absolute
Because of the ``cd`` command, the server automatically changes the current
working directory. The client then does not need to know the absolute
or relative remote repository path and can directly access the repositories at
``<user>@<host>:<repo>``.
``ssh://<user>@<host>/./<repo>``.
.. note:: The setup above ignores all client given commandline parameters
which are normally appended to the `borg serve` command.
.. note:: The setup above ignores all client-given command line parameters
that are normally appended to the `borg serve` command.
Client
------
@ -93,21 +94,21 @@ The client needs to initialize the `pictures` repository like this:
::
borg init backup@backup01.srv.local:pictures
borg init ssh://backup@backup01.srv.local/./pictures
Or with the full path (should actually never be used, as only for demonstrational purposes).
The server should automatically change the current working directory to the `<client fqdn>` folder.
Or with the full path (this should not be used in practice; it is only for demonstration purposes).
The server automatically changes the current working directory to the `<client fqdn>` directory.
::
borg init backup@backup01.srv.local:/home/backup/repos/johndoe.clnt.local/pictures
borg init ssh://backup@backup01.srv.local/home/backup/repos/johndoe.clnt.local/pictures
When `johndoe.clnt.local` tries to access a not restricted path the following error is raised.
John Doe tries to backup into the Web 01 path:
When `johndoe.clnt.local` tries to access a path outside its restriction, the following error is raised.
John Doe tries to back up into the web01 path:
::
borg init backup@backup01.srv.local:/home/backup/repos/web01.srv.local/pictures
borg init ssh://backup@backup01.srv.local/home/backup/repos/web01.srv.local/pictures
::
@ -202,7 +203,7 @@ Salt running on a Debian system.
Enhancements
------------
As this section only describes a simple and effective setup it could be further
As this section only describes a simple and effective setup, it could be further
enhanced when supporting (a limited set) of client supplied commands. A wrapper
for starting `borg serve` could be written. Or borg itself could be enhanced to
autodetect it runs under SSH by checking the `SSH_ORIGINAL_COMMAND` environment

View file

@ -5,26 +5,25 @@
Hosting repositories
====================
This sections shows how to securely provide repository storage for users.
Optionally, each user can have a storage quota.
This section shows how to provide repository storage securely for users.
Repositories are accessed through SSH. Each user of the service should
have her own login which is only able to access the user's files.
Technically it would be possible to have multiple users share one login,
have their own login, which is only able to access that user's files.
Technically, it is possible to have multiple users share one login;
however, separating them is better. Separate logins increase isolation
and are thus an additional layer of security and safety for both the
and provide an additional layer of security and safety for both the
provider and the users.
For example, if a user manages to breach ``borg serve`` then she can
only damage her own data (assuming that the system does not have further
For example, if a user manages to breach ``borg serve``, they can
only damage their own data (assuming that the system does not have further
vulnerabilities).
Use the standard directory structure of the operating system. Each user
is assigned a home directory and repositories of the user reside in her
is assigned a home directory, and that user's repositories reside in their
home directory.
The following ``~user/.ssh/authorized_keys`` file is the most important
piece for a correct deployment. It allows the user to login via
piece for a correct deployment. It allows the user to log in via
their public key (which must be provided by the user), and restricts
SSH access to safe operations only.
@ -37,18 +36,18 @@ SSH access to safe operations only.
.. warning::
If this file should be automatically updated (e.g. by a web console),
pay **utmost attention** to sanitizing user input. Strip all whitespace
around the user-supplied key, ensure that it **only** contains ASCII
with no control characters and that it consists of three parts separated
by a single space. Ensure that no newlines are contained within the key.
If this file should be automatically updated (e.g. by a web console),
pay **utmost attention** to sanitizing user input. Strip all whitespace
around the user-supplied key, ensure that it **only** contains ASCII
with no control characters and that it consists of three parts separated
by a single space. Ensure that no newlines are contained within the key.
The ``restrict`` keyword enables all restrictions, i.e. disables port, agent
and X11 forwarding, as well as disabling PTY allocation and execution of ~/.ssh/rc.
If any future restriction capabilities are added to authorized_keys
files they will be included in this set.
The ``command`` keyword forces execution of the specified command line
The ``command`` keyword forces execution of the specified command
upon login. This must be ``borg serve``. The ``--restrict-to-repository``
option permits access to exactly **one** repository. It can be given
multiple times to permit access to more than one repository.
@ -56,30 +55,6 @@ multiple times to permit access to more than one repository.
The repository may not exist yet; it can be initialized by the user,
which allows for encryption.
**Storage quotas** can be enabled by adding the ``--storage-quota`` option
to the ``borg serve`` command line::
restrict,command="borg serve --storage-quota 20G ..." ...
The storage quotas of repositories are completely independent. If a
client is able to access multiple repositories, each repository
can be filled to the specified quota.
If storage quotas are used, ensure that all deployed Borg releases
support storage quotas.
Refer to :ref:`internals_storage_quota` for more details on storage quotas.
**Specificities: Append-only repositories**
Running ``borg init`` via a ``borg serve --append-only`` server will **not**
create a repository that is configured to be append-only by its repository
config.
But, ``--append-only`` arguments in ``authorized_keys`` will override the
repository config, therefore append-only mode can be enabled on a key by key
basis.
Refer to the `sshd(8) <https://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man8/sshd.8>`_
man page for more details on SSH options.
See also :ref:`borg_serve`

View file

@ -6,13 +6,48 @@ Backing up entire disk images
Backing up disk images can still be efficient with Borg because its `deduplication`_
technique makes sure only the modified parts of the file are stored. Borg also has
optional simple sparse file support for extract.
optional simple sparse file support for extraction.
It is of utmost importance to pin down the disk you want to back up.
Use the disk's SERIAL for that.
Use:
.. code-block:: bash
# You can find the short disk serial by:
# udevadm info --query=property --name=nvme1n1 | grep ID_SERIAL_SHORT | cut -d '=' -f 2
export BORG_REPO=/path/to/repo
DISK_SERIAL="7VS0224F"
DISK_ID=$(readlink -f /dev/disk/by-id/*"${DISK_SERIAL}") # Returns /dev/nvme1n1
mapfile -t PARTITIONS < <(lsblk -o NAME,TYPE -p -n -l "$DISK_ID" | awk '$2 == "part" {print $1}')
echo "Partitions of $DISK_ID:"
echo "${PARTITIONS[@]}"
echo "Disk Identifier: $DISK_ID"
# Use the following line to perform a Borg backup for the full disk:
# borg create --read-special disk-backup "$DISK_ID"
# Use the following to perform a Borg backup for all partitions of the disk
# borg create --read-special partitions-backup "${PARTITIONS[@]}"
# Example output:
# Partitions of /dev/nvme1n1:
# /dev/nvme1n1p1
# /dev/nvme1n1p2
# /dev/nvme1n1p3
# Disk Identifier: /dev/nvme1n1
# borg create --read-special disk-backup /dev/nvme1n1
# borg create --read-special partitions-backup /dev/nvme1n1p1 /dev/nvme1n1p2 /dev/nvme1n1p3
Decreasing the size of image backups
------------------------------------
Disk images are as large as the full disk when uncompressed and might not get much
smaller post-deduplication after heavy use because virtually all file systems don't
smaller post-deduplication after heavy use because virtually all filesystems do not
actually delete file data on disk but instead delete the filesystem entries referencing
the data. Therefore, if a disk nears capacity and files are deleted again, the change
will barely decrease the space it takes up when compressed and deduplicated. Depending
@ -28,28 +63,28 @@ deduplicating. For backup, save the disk header and the contents of each partiti
HEADER_SIZE=$(sfdisk -lo Start $DISK | grep -A1 -P 'Start$' | tail -n1 | xargs echo)
PARTITIONS=$(sfdisk -lo Device,Type $DISK | sed -e '1,/Device\s*Type/d')
dd if=$DISK count=$HEADER_SIZE | borg create repo::hostname-partinfo -
dd if=$DISK count=$HEADER_SIZE | borg create --repo repo hostname-partinfo -
echo "$PARTITIONS" | grep NTFS | cut -d' ' -f1 | while read x; do
PARTNUM=$(echo $x | grep -Eo "[0-9]+$")
ntfsclone -so - $x | borg create repo::hostname-part$PARTNUM -
ntfsclone -so - $x | borg create --repo repo hostname-part$PARTNUM -
done
# to backup non-NTFS partitions as well:
# to back up non-NTFS partitions as well:
echo "$PARTITIONS" | grep -v NTFS | cut -d' ' -f1 | while read x; do
PARTNUM=$(echo $x | grep -Eo "[0-9]+$")
borg create --read-special repo::hostname-part$PARTNUM $x
borg create --read-special --repo repo hostname-part$PARTNUM $x
done
Restoration is a similar process::
borg extract --stdout repo::hostname-partinfo | dd of=$DISK && partprobe
borg extract --stdout --repo repo hostname-partinfo | dd of=$DISK && partprobe
PARTITIONS=$(sfdisk -lo Device,Type $DISK | sed -e '1,/Device\s*Type/d')
borg list --format {archive}{NL} repo | grep 'part[0-9]*$' | while read x; do
PARTNUM=$(echo $x | grep -Eo "[0-9]+$")
PARTITION=$(echo "$PARTITIONS" | grep -E "$DISKp?$PARTNUM" | head -n1)
if echo "$PARTITION" | cut -d' ' -f2- | grep -q NTFS; then
borg extract --stdout repo::$x | ntfsclone -rO $(echo "$PARTITION" | cut -d' ' -f1) -
borg extract --stdout --repo repo $x | ntfsclone -rO $(echo "$PARTITION" | cut -d' ' -f1) -
else
borg extract --stdout repo::$x | dd of=$(echo "$PARTITION" | cut -d' ' -f1)
borg extract --stdout --repo repo $x | dd of=$(echo "$PARTITION" | cut -d' ' -f1)
fi
done
@ -70,18 +105,18 @@ except it works in place, zeroing the original partition. This makes the backup
a bit simpler::
sfdisk -lo Device,Type $DISK | sed -e '1,/Device\s*Type/d' | grep Linux | cut -d' ' -f1 | xargs -n1 zerofree
borg create --read-special repo::hostname-disk $DISK
borg create --read-special --repo repo hostname-disk $DISK
Because the partitions were zeroed in place, restoration is only one command::
borg extract --stdout repo::hostname-disk | dd of=$DISK
borg extract --stdout --repo repo hostname-disk | dd of=$DISK
.. note:: The "traditional" way to zero out space on a partition, especially one already
mounted, is to simply ``dd`` from ``/dev/zero`` to a temporary file and delete
mounted, is simply to ``dd`` from ``/dev/zero`` to a temporary file and delete
it. This is ill-advised for the reasons mentioned in the ``zerofree`` man page:
- it is slow
- it makes the disk image (temporarily) grow to its maximal extent
- it is slow.
- it makes the disk image (temporarily) grow to its maximal extent.
- it (temporarily) uses all free space on the disk, so other concurrent write actions may fail.
Virtual machines
@ -94,7 +129,7 @@ regular file to Borg with the same issues as regular files when it comes to conc
reading and writing from the same file.
For backing up live VMs use filesystem snapshots on the VM host, which establishes
crash-consistency for the VM images. This means that with most file systems (that
crash-consistency for the VM images. This means that with most filesystems (that
are journaling) the FS will always be fine in the backup (but may need a journal
replay to become accessible).
@ -110,10 +145,10 @@ to reach application-consistency; it's a broad and complex issue that cannot be
in entirety here.
Hypervisor snapshots capturing most of the VM's state can also be used for backups and
can be a better alternative to pure file system based snapshots of the VM's disk, since
can be a better alternative to pure filesystem-based snapshots of the VM's disk, since
no state is lost. Depending on the application this can be the easiest and most reliable
way to create application-consistent backups.
Borg doesn't intend to address these issues due to their huge complexity and
Borg does not intend to address these issues due to their huge complexity and
platform/software dependency. Combining Borg with the mechanisms provided by the platform
(snapshots, hypervisor features) will be the best approach to start tackling them.
(snapshots, hypervisor features) will be the best approach to start tackling them.

View file

@ -0,0 +1,66 @@
.. include:: ../global.rst.inc
.. highlight:: none
.. _non_root_user:
================================
Backing up using a non-root user
================================
This section describes how to run Borg as a non-root user and still be able to
back up every file on the system.
Normally, Borg is run as the root user to bypass all filesystem permissions and
be able to read all files. However, in theory this also allows Borg to modify or
delete files on your system (for example, in case of a bug).
To eliminate this possibility, we can run Borg as a non-root user and give it read-only
permissions to all files on the system.
Using Linux capabilities inside a systemd service
=================================================
One way to do so is to use Linux `capabilities
<https://man7.org/linux/man-pages/man7/capabilities.7.html>`_ within a systemd
service.
Linux capabilities allow us to grant parts of the root users privileges to
a non-root user. This works on a per-thread level and does not grant permissions
to the non-root user as a whole.
For this, we need to run the backup script from a systemd service and use the `AmbientCapabilities
<https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#AmbientCapabilities=>`_
option added in systemd 229.
A very basic unit file would look like this:
::
[Unit]
Description=Borg Backup
[Service]
Type=oneshot
User=borg
ExecStart=/usr/local/sbin/backup.sh
AmbientCapabilities=CAP_DAC_READ_SEARCH
The ``CAP_DAC_READ_SEARCH`` capability gives Borg read-only access to all files and directories on the system.
This service can then be started manually using ``systemctl start``, a systemd timer or other methods.
Restore considerations
======================
Use the root user when restoring files. If you use the non-root user, ``borg extract`` will
change ownership of all restored files to the non-root user. Using ``borg mount`` will not allow the
non-root user to access files it would not be able to access on the system itself.
Other than that, you can use the same restore process you would use when running the backup as root.
.. warning::
When using a local repository and running Borg commands as root, make sure to use only commands that do not
modify the repository itself, such as extract or mount. Modifying the repository as root will break it for the
non-root user, since some files inside the repository will then be owned by root.

View file

@ -6,51 +6,51 @@
Backing up in pull mode
=======================
Typically the borg client connects to a backup server using SSH as a transport
Typically the Borg client connects to a backup server using SSH as a transport
when initiating a backup. This is referred to as push mode.
If you however require the backup server to initiate the connection or prefer
However, if you require the backup server to initiate the connection, or prefer
it to initiate the backup run, one of the following workarounds is required to
allow such a pull mode setup.
allow such a pull-mode setup.
A common use case for pull mode is to backup a remote server to a local personal
A common use case for pull mode is to back up a remote server to a local personal
computer.
SSHFS
=====
Assuming you have a pull backup system set up with borg, where a backup server
pulls the data from the target via SSHFS. In this mode, the backup client's file
system is mounted remotely on the backup server. Pull mode is even possible if
Assume you have a pull backup system set up with Borg, where a backup server
pulls data from the target via SSHFS. In this mode, the backup client's filesystem
is mounted remotely on the backup server. Pull mode is even possible if
the SSH connection must be established by the client via a remote tunnel. Other
network file systems like NFS or SMB could be used as well, but SSHFS is very
simple to set up and probably the most secure one.
There are some restrictions caused by SSHFS. For example, unless you define UID
and GID mappings when mounting via ``sshfs``, owners and groups of the mounted
file system will probably change, and you may not have access to those files if
BorgBackup is not run with root privileges.
filesystem will probably change, and you may not have access to those files if
Borg is not run with root privileges.
SSHFS is a FUSE file system and uses the SFTP protocol, so there may be also
other unsupported features that the actual implementations of sshfs, libfuse and
sftp on the backup server do not support, like file name encodings, ACLs, xattrs
or flags. So there is no guarantee that you are able to restore a system
SSHFS is a FUSE filesystem and uses the SFTP protocol, so there may also be
unsupported features that the actual implementations of SSHFS, libfuse, and
SFTP on the backup server do not support, like filename encodings, ACLs, xattrs,
or flags. Therefore, there is no guarantee that you can restore a system
completely in every aspect from such a backup.
.. warning::
To mount the client's root file system you will need root access to the
client. This contradicts to the usual threat model of BorgBackup, where
clients don't need to trust the backup server (data is encrypted). In pull
To mount the client's root filesystem you will need root access to the
client. This contradicts the usual threat model of Borg, where
clients do not need to trust the backup server (data is encrypted). In pull
mode the server (when logged in as root) could cause unlimited damage to the
client. Therefore, pull mode should be used only from servers you do fully
client. Therefore, pull mode should be used only with servers you fully
trust!
.. warning::
Additionally, while being chrooted into the client's root file system,
code from the client will be executed. Thus, you should only do that when
fully trusting the client.
Additionally, while chrooted into the client's root filesystem,
code from the client will be executed. Therefore, you should do this only when
you fully trust the client.
.. warning::
@ -58,7 +58,7 @@ completely in every aspect from such a backup.
mappings, assuming they only come from files (/etc/passwd and group).
This assumption might be wrong, e.g. if users/groups also come from
ldap or other providers.
Thus, it might be better to use ``--numeric-owner`` and not archive any
Thus, it might be better to use ``--numeric-ids`` and not archive any
user or group names (but just the numeric IDs) and not use chroot.
Creating a backup
@ -98,9 +98,9 @@ create the backup, retaining the original paths, excluding the repository:
::
borg create --exclude /borgrepo --files-cache ctime,size /borgrepo::archive /
borg create --exclude borgrepo --files-cache ctime,size --repo /borgrepo archive /
For the sake of simplicity only ``/borgrepo`` is excluded here. You may want to
For the sake of simplicity only ``borgrepo`` is excluded here. You may want to
set up an exclude file with additional files and folders to be excluded. Also
note that we have to modify Borg's file change detection behaviour SSHFS
cannot guarantee stable inode numbers, so we have to supply the
@ -159,9 +159,9 @@ Now we can run
::
borg extract /borgrepo::archive PATH
borg extract --repo /borgrepo archive PATH
to partially restore whatever we like. Finally, do the clean-up:
to restore whatever we like partially. Finally, do the clean-up:
::
@ -181,13 +181,13 @@ When doing a full restore, we restore all files (including the ones containing
the ID-to-name mapping, ``/etc/passwd`` and ``/etc/group``). Everything will be
consistent automatically if we restore the numeric IDs stored in the archive. So
there is no need for a chroot environment; we just mount the client file system
and extract a backup, utilizing the ``--numeric-owner`` option:
and extract a backup, utilizing the ``--numeric-ids`` option:
::
sshfs root@host:/ /mnt/sshfs
cd /mnt/sshfs
borg extract --numeric-owner /path/to/repo::archive
borg extract --numeric-ids --repo /path/to/repo archive
cd ~
umount /mnt/sshfs
@ -199,7 +199,7 @@ directly extract it without the need of mounting with SSHFS:
::
borg export-tar /path/to/repo::archive - | ssh root@host 'tar -C / -x'
borg export-tar --repo /path/to/repo archive - | ssh root@host 'tar -C / -x'
Note that in this scenario the tar format is the limiting factor it cannot
restore all the advanced features that BorgBackup supports. See
@ -209,8 +209,8 @@ socat
=====
In this setup a SSH connection from the backup server to the client is
established that uses SSH reverse port forwarding to transparently
tunnel data between UNIX domain sockets on the client and server and the socat
established that uses SSH reverse port forwarding to tunnel data
transparently between UNIX domain sockets on the client and server and the socat
tool to connect these with the borg client and server processes, respectively.
The program socat has to be available on the backup server and on the client
@ -247,7 +247,7 @@ to *borg-client* has to have read and write permissions on ``/run/borg``::
On *borg-server*, we have to start the command ``borg serve`` and make its
standard input and output available to a unix socket::
borg-server:~$ socat UNIX-LISTEN:/run/borg/reponame.sock,fork EXEC:"borg serve --append-only --restrict-to-path /path/to/repo"
borg-server:~$ socat UNIX-LISTEN:/run/borg/reponame.sock,fork EXEC:"borg serve --restrict-to-path /path/to/repo"
Socat will wait until a connection is opened. Then socat will execute the
command given, redirecting Standard Input and Output to the unix socket. The
@ -277,7 +277,7 @@ forwarding can do this for us::
Warning: remote port forwarding failed for listen path /run/borg/reponame.sock
When you are done, you have to manually remove the socket file, otherwise
When you are done, you have to remove the socket file manually, otherwise
you may see an error like this when trying to execute borg commands::
Remote: YYYY/MM/DD HH:MM:SS socat[XXX] E connect(5, AF=1 "/run/borg/reponame.sock", 13): Connection refused
@ -301,7 +301,7 @@ ignore all arguments intended for the SSH command.
All Borg commands can now be executed on *borg-client*. For example to create a
backup execute the ``borg create`` command::
borg-client:~$ borg create ssh://borg-server/path/to/repo::archive /path_to_backup
borg-client:~$ borg create --repo ssh://borg-server/path/to/repo archive /path_to_backup
When automating backup creation, the
interactive ssh session may seem inappropriate. An alternative way of creating
@ -312,7 +312,7 @@ a backup may be the following command::
borgc@borg-client \
borg create \
--rsh "sh -c 'exec socat STDIO UNIX-CONNECT:/run/borg/reponame.sock'" \
ssh://borg-server/path/to/repo::archive /path_to_backup \
--repo ssh://borg-server/path/to/repo archive /path_to_backup \
';' rm /run/borg/reponame.sock
This command also automatically removes the socket file after the ``borg
@ -350,7 +350,7 @@ dedicated ssh key:
borgs@borg-server$ install -m 700 -d ~/.ssh/
borgs@borg-server$ ssh-keygen -N '' -t rsa -f ~/.ssh/borg-client_key
borgs@borg-server$ { echo -n 'command="borg serve --append-only --restrict-to-repo ~/repo",restrict '; cat ~/.ssh/borg-client_key.pub; } >> ~/.ssh/authorized_keys
borgs@borg-server$ { echo -n 'command="borg serve --restrict-to-repo ~/repo",restrict '; cat ~/.ssh/borg-client_key.pub; } >> ~/.ssh/authorized_keys
borgs@borg-server$ chmod 600 ~/.ssh/authorized_keys
``install -m 700 -d ~/.ssh/``
@ -365,12 +365,10 @@ dedicated ssh key:
Another more complex approach is using a unique ssh key for each pull operation.
This is more secure as it guarantees that the key will not be used for other purposes.
``{ echo -n 'command="borg serve --append-only --restrict-to-repo ~/repo",restrict '; cat ~/.ssh/borg-client_key.pub; } >> ~/.ssh/authorized_keys``
``{ echo -n 'command="borg serve --restrict-to-repo ~/repo",restrict '; cat ~/.ssh/borg-client_key.pub; } >> ~/.ssh/authorized_keys``
Add borg-client's ssh public key to ~/.ssh/authorized_keys with forced command and restricted mode.
The borg client is restricted to use one repo at the specified path and to append-only operation.
Commands like *delete*, *prune* and *compact* have to be executed another way, for example directly on *borg-server*
side or from a privileged, less restricted client (using another authorized_keys entry).
The borg client is restricted to use one repo at the specified path.
``chmod 600 ~/.ssh/authorized_keys``
@ -417,8 +415,88 @@ Parentheses are not needed when using a dedicated bash process.
*ssh://borgs@borg-server/~/repo* refers to the repository *repo* within borgs's home directory on *borg-server*.
*StrictHostKeyChecking=no* is used to automatically add host keys to *~/.ssh/known_hosts* without user intervention.
*StrictHostKeyChecking=no* is used to add host keys automatically to *~/.ssh/known_hosts* without user intervention.
``kill "${SSH_AGENT_PID}"``
Kill ssh-agent with loaded keys when it is not needed anymore.
Remote forwarding
=================
The standard ssh client allows to create tunnels to forward local ports to a remote server (local forwarding) and also
to allow remote ports to be forwarded to local ports (remote forwarding).
This remote forwarding can be used to allow remote backup clients to access the backup server even if the backup server
cannot be reached by the backup client.
This can even be used in cases where neither the backup server can reach the backup client and the backup client cannot
reach the backup server, but some intermediate host can access both.
A schematic approach is as follows
::
Backup Server (backup@mybackup) Intermediate Machine (john@myinter) Backup Client (bob@myclient)
1. Establish SSH remote forwarding -----------> SSH listen on local port
2. Starting ``borg create`` establishes
3. SSH forwards to intermediate machine <------- SSH connection to the local port
4. Receives backup connection <------- and further on to backup server
via SSH
So for the backup client the backup is done via SSH to a local port and for the backup server there is a normal backup
performed via ssh.
In order to achieve this, the following commands can be used to create the remote port forwarding:
1. On machine ``myinter``
``ssh bob@myclient -v -C -R 8022:mybackup:22 -N``
This will listen for ssh-connections on port ``8022`` on ``myclient`` and forward connections to port 22 on ``mybackup``.
You can also remove the need for machine ``myinter`` and create the port forwarding on the backup server directly by
using ``localhost`` instead of ``mybackup``
2. On machine ``myclient``
``borg create -v --progress --stats ssh://backup@localhost:8022/home/backup/repos/myclient /``
Make sure to use port ``8022`` and ``localhost`` for the repository as this instructs borg on ``myclient`` to use the
remote forwarded ssh connection.
SSH Keys
--------
If you want to automate backups when using this method, the ssh ``known_hosts`` and ``authorized_keys`` need to be set up
to allow connections.
Security Considerations
-----------------------
Opening up SSH access this way can pose a security risk as it effectively opens remote access to your
backup server on the client even if it is located outside of your company network.
To reduce the chances of compromise, you should configure a forced command in ``authorized_keys`` to prevent
anyone from performing any other action on the backup server.
This can be done e.g. by adding the following in ``$HOME/.ssh/authorized_keys`` on ``mybackup`` with proper
path and client-fqdn:
::
command="cd /home/backup/repos/<client fqdn>;borg serve --restrict-to-path /home/backup/repos/<client fqdn>"
All the additional security considerations for borg should be applied, see :ref:`central-backup-server` for some additional
hints.
More information
----------------
See `remote forwarding`_ and the `ssh man page`_ for more information about remote forwarding.
.. _remote forwarding: https://linuxize.com/post/how-to-setup-ssh-tunneling/
.. _ssh man page: https://manpages.debian.org/testing/manpages-de/ssh.1.de.html

View file

@ -8,7 +8,7 @@ Development
This chapter will get you started with Borg development.
Borg is written in Python (with a little bit of Cython and C for
the performance critical parts).
the performance-critical parts).
Contributions
-------------
@ -19,7 +19,7 @@ Some guidance for contributors:
- Discuss changes on the GitHub issue tracker, on IRC or on the mailing list.
- Make your PRs on the ``master`` branch (see `Branching Model`_ for details).
- Make your PRs on the ``master`` branch (see `Branching Model`_ for details and exceptions).
- Do clean changesets:
@ -52,14 +52,14 @@ Borg development happens on the ``master`` branch and uses GitHub pull
requests (if you don't have GitHub or don't want to use it you can
send smaller patches via the borgbackup mailing list to the maintainers).
Stable releases are maintained on maintenance branches named ``x.y-maint``, eg.
the maintenance branch of the 1.0.x series is ``1.0-maint``.
Stable releases are maintained on maintenance branches named ``x.y-maint``, e.g.,
the maintenance branch of the 1.4.x series is ``1.4-maint``.
Most PRs should be filed against the ``master`` branch. Only if an
issue affects **only** a particular maintenance branch a PR should be
filed against it directly.
While discussing / reviewing a PR it will be decided whether the
While discussing/reviewing a PR it will be decided whether the
change should be applied to maintenance branches. Each maintenance
branch has a corresponding *backport/x.y-maint* label, which will then
be applied.
@ -105,11 +105,110 @@ were collected:
Previously (until release 1.0.10) Borg used a `"merge upwards"
<https://git-scm.com/docs/gitworkflows#_merging_upwards>`_ model where
most minor changes and fixes where committed to a maintenance branch
(eg. 1.0-maint), and the maintenance branch(es) were regularly merged
most minor changes and fixes were committed to a maintenance branch
(e.g. 1.0-maint), and the maintenance branch(es) were regularly merged
back into the main development branch. This became more and more
troublesome due to merges growing more conflict-heavy and error-prone.
How to submit a pull request
----------------------------
In order to contribute to Borg, you will need to fork the ``borgbackup/borg``
main repository to your own Github repository. Then clone your Github repository
to your local machine. The instructions for forking and cloning a repository
can be found there:
`<https://docs.github.com/en/get-started/quickstart/fork-a-repo>`_ .
Make sure you also fetched the git tags, because without them, ``setuptools-scm``
will run into issues determining the correct borg version. Check if ``git tag``
shows a lot of release tags (version numbers).
If it does not, use ``git fetch --tags`` to fetch them.
To work on your contribution, you first need to decide which branch your pull
request should be against. Often, this might be master branch (esp. for big /
risky contributions), but it could be also a maintenance branch like e.g.
1.4-maint (esp. for small fixes that should go into next maintenance release,
e.g. 1.4.x).
Start by checking out the appropriate branch:
::
git checkout master
It is best practice for a developer to keep local ``master`` branch as an
up-to-date copy of the upstream ``master`` branch and always do own work in a
separate feature or bugfix branch.
This is useful to be able to rebase own branches onto the upstream branches
they were branched from, if necessary.
This also applies to other upstream branches (like e.g. ``1.4-maint``), not
only to ``master``.
Thus, create a new branch now:
::
git checkout -b MYCONTRIB-master # choose an appropriate own branch name
Now, work on your contribution in that branch. Use these git commands:
::
git status # is there anything that needs to be added?
git add ... # if so, add it
git commit # finally, commit it. use a descriptive comment.
Then push the changes to your Github repository:
::
git push --set-upstream origin MYCONTRIB-master
Finally, make a pull request on ``borgbackup/borg`` Github repository against
the appropriate branch (e.g. ``master``) so that your changes can be reviewed.
What to do if work was accidentally started in wrong branch
-----------------------------------------------------------
If you accidentally worked in ``master`` branch, check out the ``master``
branch and make sure there are no uncommitted changes. Then, create a feature
branch from that, so that your contribution is in a feature branch.
::
git checkout master
git checkout -b MYCONTRIB-master
Next, check out the ``master`` branch again. Find the commit hash of the last
commit that was made before you started working on your contribution and perform
a hard reset.
::
git checkout master
git log
git reset --hard THATHASH
Then, update the local ``master`` branch with changes made in the upstream
repository.
::
git pull borg master
Rebase feature branch onto updated master branch
------------------------------------------------
After updating the local ``master`` branch from upstream, the feature branch
can be checked out and rebased onto (the now up-to-date) ``master`` branch.
::
git checkout MYCONTRIB-master
git rebase -i master
Next, check if there are any commits that exist in the feature branch
but not in the ``master`` branch and vice versa. If there are no
conflicts or after resolving them, push your changes to your Github repository.
::
git log
git diff master
git push -f
Code and issues
---------------
@ -119,24 +218,35 @@ Code is stored on GitHub, in the `Borgbackup organization
<https://github.com/borgbackup/borg/pulls>`_ should be sent there as
well. See also the :ref:`support` section for more details.
Style guide
-----------
Style guide / Automated Code Formatting
---------------------------------------
We generally follow `pep8
<https://www.python.org/dev/peps/pep-0008/>`_, with 120 columns
instead of 79. We do *not* use form-feed (``^L``) characters to
separate sections either. Compliance is tested automatically when
you run the tests.
We use `black`_ for automatically formatting the code.
If you work on the code, it is recommended that you run black **before each commit**
(so that new code is always using the desired formatting and no additional commits
are required to fix the formatting).
::
pip install -r requirements.d/codestyle.txt # everybody use same black version
black --check . # only check, don't change
black . # reformat the code
The CI workflows will check the code formatting and will fail if it is not formatted correctly.
When (mass-)reformatting existing code, we need to avoid ruining `git blame`, so please
follow their `guide about avoiding ruining git blame`_:
.. _black: https://black.readthedocs.io/
.. _guide about avoiding ruining git blame: https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html#avoiding-ruining-git-blame
Continuous Integration
----------------------
All pull requests go through `GitHub Actions`_, which runs the tests on Linux
and Mac OS X as well as the flake8 style checker. Windows builds run on AppVeyor_,
while additional Unix-like platforms are tested on Golem_.
All pull requests go through `GitHub Actions`_, which runs the tests on misc.
Python versions and on misc. platforms as well as some additional checks.
.. _AppVeyor: https://ci.appveyor.com/project/borgbackup/borg/
.. _Golem: https://golem.enkore.de/view/Borg/
.. _GitHub Actions: https://github.com/borgbackup/borg/actions
Output and Logging
@ -164,6 +274,12 @@ virtual env and run::
pip install -r requirements.d/development.txt
This project utilizes pre-commit to format and lint code before it is committed.
Although pre-commit is installed when running the command above, the pre-commit hooks
will have to be installed separately. Run this command to install the pre-commit hooks::
pre-commit install
Running the tests
-----------------
@ -171,7 +287,7 @@ The tests are in the borg/testsuite package.
To run all the tests, you need to have fakeroot installed. If you do not have
fakeroot, you still will be able to run most tests, just leave away the
`fakeroot -u` from the given command lines.
``fakeroot -u`` from the given command lines.
To run the test suite use the following command::
@ -182,7 +298,7 @@ Some more advanced examples::
# verify a changed tox.ini (run this after any change to tox.ini):
fakeroot -u tox --recreate
fakeroot -u tox -e py38 # run all tests, but only on python 3.8
fakeroot -u tox -e py313 # run all tests, but only on python 3.13
fakeroot -u tox borg.testsuite.locking # only run 1 test module
@ -194,26 +310,24 @@ Important notes:
- When using ``--`` to give options to py.test, you MUST also give ``borg.testsuite[.module]``.
Running the tests (using the pypi package)
------------------------------------------
Running more checks using coala
-------------------------------
First install coala and some checkers ("bears"):
Since borg 1.4, it is also possible to run the tests without a development
environment, using the borgbackup dist package (downloaded from pypi.org or
github releases page):
::
pip install -r requirements.d/coala.txt
# optional: create and use a virtual env:
python3 -m venv env
. env/bin/activate
You can now run coala from the toplevel directory; it will read its settings
from ``.coafile`` there:
::
coala
Some bears have additional requirements and they usually tell you about
them in case they are missing.
# install packages
pip install borgbackup
pip install pytest pytest-benchmark
# run the tests
pytest -v -rs --benchmark-skip --pyargs borg.testsuite
Adding a compression algorithm
------------------------------
@ -236,8 +350,8 @@ for easier use by packagers downstream.
When a command is added, a command line flag changed, added or removed,
the usage docs need to be rebuilt as well::
python setup.py build_usage
python setup.py build_man
python scripts/make.py build_usage
python scripts/make.py build_man
However, we prefer to do this as part of our :ref:`releasing`
preparations, so it is generally not necessary to update these when
@ -291,6 +405,49 @@ Usage::
# To copy files from the VM (in this case, the generated binary):
vagrant scp OS:/vagrant/borg/borg.exe .
Using Podman
------------
macOS-based developers (and others who prefer containers) can run the Linux test suite locally using Podman.
Prerequisites:
- Install Podman (e.g., ``brew install podman``).
- Initialize the Podman machine, only once: ``podman machine init``.
- Start the Podman machine, before using it: ``podman machine start``.
Usage::
# Open an interactive shell in the container (default if no command given):
./scripts/linux-run
# Run the default tox environment:
./scripts/linux-run tox
# Run a specific tox environment:
./scripts/linux-run tox -e py311-pyfuse3
# Pass arguments to pytest (e.g., run specific tests):
./scripts/linux-run tox -e py313-pyfuse3 -- -k mount
# Switch base image (temporarily):
./scripts/linux-run --image python:3.11-bookworm tox
Resource Usage
~~~~~~~~~~~~~~
The default Podman VM uses 2GB RAM and half your CPUs.
For heavy tests (parallel execution), this might be tight.
- **Check usage:** Run ``podman stats`` in another terminal while tests are running.
- **Increase resources:**
::
podman machine stop
podman machine set --cpus 6 --memory 4096
podman machine start
Creating standalone binaries
----------------------------
@ -310,7 +467,6 @@ If you encounter issues, see also our `Vagrantfile` for details.
work on same OS, same architecture (x86 32bit, amd64 64bit)
without external dependencies.
.. _releasing:
Creating a new release
@ -326,12 +482,18 @@ Checklist:
- Update ``CHANGES.rst``, based on ``git log $PREVIOUS_RELEASE..``.
- Check version number of upcoming release in ``CHANGES.rst``.
- Render ``CHANGES.rst`` via ``make html`` and check for markup errors.
- Verify that ``MANIFEST.in`` and ``setup.py`` are complete.
- ``python setup.py build_usage ; python setup.py build_man`` and commit.
- Verify that ``MANIFEST.in``, ``pyproject.toml`` and ``setup.py`` are complete.
- Run these commands, check git status for files that might need to be added, and commit::
python scripts/make.py build_usage
python scripts/make.py build_man
- Tag the release::
git tag -s -m "tagged/signed release X.Y.Z" X.Y.Z
- Push the release PR branch to GitHub, make a pull request.
- Also push the release tag.
- Create a clean repo and use it for the following steps::
git clone borg borg-clean
@ -340,8 +502,9 @@ Checklist:
It will also reveal uncommitted required files.
Moreover, it makes sure the vagrant machines only get committed files and
do a fresh start based on that.
- Run tox and/or binary builds on all supported platforms via vagrant,
check for test failures.
- Optional: run tox and/or binary builds on all supported platforms via vagrant,
check for test failures. This is now optional as we do platform testing and
binary building on GitHub.
- Create sdist, sign it, upload release to (test) PyPi:
::
@ -349,26 +512,32 @@ Checklist:
scripts/sdist-sign X.Y.Z
scripts/upload-pypi X.Y.Z test
scripts/upload-pypi X.Y.Z
- Put binaries into dist/borg-OSNAME and sign them:
::
Note: the signature is not uploaded to PyPi any more, but we upload it to
github releases.
- When GitHub CI looks good on the release PR, merge it and then check "Actions":
GitHub will create binary assets after the release PR is merged within the
CI testing of the merge. Check the "Upload binaries" step on Ubuntu (AMD/Intel
and ARM64) and macOS (Intel and ARM64), fetch the ZIPs with the binaries.
- Unpack the ZIPs and test the binaries, upload the binaries to the GitHub
release page (borg-OS-SPEC-ARCH-gh and borg-OS-SPEC-ARCH-gh.tgz).
scripts/sign-binaries 201912312359
- Close the release milestone on GitHub.
- `Update borgbackup.org
<https://github.com/borgbackup/borgbackup.github.io/pull/53/files>`_ with the
new version number and release date.
- Announce on:
- Mailing list.
- Twitter.
- IRC channel (change ``/topic``).
- Mailing list.
- Mastodon / BlueSky / X (aka Twitter).
- IRC channel (change ``/topic``).
- Create a GitHub release, include:
* Standalone binaries (see above for how to create them).
- pypi dist package and signature
- Standalone binaries (see above for how to create them).
+ For OS X, document the OS X Fuse version in the README of the binaries.
OS X FUSE uses a kernel extension that needs to be compatible with the
code contained in the binary.
* A link to ``CHANGES.rst``.
- For macOS binaries **with** FUSE support, document the macFUSE version
in the README of the binaries. macFUSE uses a kernel extension that needs
to be compatible with the code contained in the binary.
- A link to ``CHANGES.rst``.

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
.. highlight:: bash
.. |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|
.. |package_url| replace:: https://pypi.org/project/borgbackup/#files
.. |git_url| replace:: https://github.com/borgbackup/borg.git
.. _github: https://github.com/borgbackup/borg
.. _issue tracker: https://github.com/borgbackup/borg/issues
@ -10,20 +10,21 @@
.. _HMAC-SHA256: https://en.wikipedia.org/wiki/HMAC
.. _SHA256: https://en.wikipedia.org/wiki/SHA-256
.. _PBKDF2: https://en.wikipedia.org/wiki/PBKDF2
.. _argon2: https://en.wikipedia.org/wiki/Argon2
.. _ACL: https://en.wikipedia.org/wiki/Access_control_list
.. _libacl: https://savannah.nongnu.org/projects/acl/
.. _libattr: https://savannah.nongnu.org/projects/attr/
.. _libxxhash: https://github.com/Cyan4973/xxHash
.. _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/
.. _pyfuse3: https://pypi.python.org/pypi/pyfuse3/
.. _`msgpack-python`: https://pypi.org/project/msgpack-python/
.. _llfuse: https://pypi.org/project/llfuse/
.. _mfusepy: https://pypi.org/project/mfusepy/
.. _pyfuse3: https://pypi.org/project/pyfuse3/
.. _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>
.. _Cython: https://cython.org/
.. _virtualenv: https://pypi.org/project/virtualenv/

View file

@ -6,7 +6,7 @@ Borg Documentation
.. include:: ../README.rst
.. when you add an element here, do not forget to add it to book.rst
.. When you add an element here, do not forget to add it to book.rst.
.. toctree::
:maxdepth: 2
@ -18,6 +18,8 @@ Borg Documentation
faq
support
changes
changes_1.x
changes_0.x
internals
development
authors

View file

@ -13,6 +13,7 @@ There are different ways to install Borg:
that comes bundled with all dependencies.
- :ref:`source-install`, either:
- :ref:`windows-binary` - builds a binary file for Windows using MSYS2.
- :ref:`pip-installation` - installing a source package with pip needs
more installation steps and requires all dependencies with
development headers and a compiler.
@ -42,7 +43,7 @@ package which can be installed with the package manager.
Distribution Source Command
============ ============================================= =======
Alpine Linux `Alpine repository`_ ``apk add borgbackup``
Arch Linux `[community]`_ ``pacman -S borg``
Arch Linux `[extra]`_ ``pacman -S borg``
Debian `Debian packages`_ ``apt install borgbackup``
Gentoo `ebuild`_ ``emerge borgbackup``
GNU Guix `GNU Guix`_ ``guix package --install borg``
@ -63,14 +64,14 @@ Ubuntu `Ubuntu packages`_, `Ubuntu PPA`_ ``apt install borgbac
============ ============================================= =======
.. _Alpine repository: https://pkgs.alpinelinux.org/packages?name=borgbackup
.. _[community]: https://www.archlinux.org/packages/?name=borg
.. _[extra]: https://www.archlinux.org/packages/?name=borg
.. _Debian packages: https://packages.debian.org/search?keywords=borgbackup&searchon=names&exact=1&suite=all&section=all
.. _Fedora official repository: https://apps.fedoraproject.org/packages/borgbackup
.. _Fedora official repository: https://packages.fedoraproject.org/pkgs/borgbackup/borgbackup/
.. _FreeBSD ports: https://www.freshports.org/archivers/py-borgbackup/
.. _ebuild: https://packages.gentoo.org/packages/app-backup/borgbackup
.. _GNU Guix: https://www.gnu.org/software/guix/package-list.html#borg
.. _pkgsrc: http://pkgsrc.se/sysutils/py-borgbackup
.. _cauldron: http://madb.mageia.org/package/show/application/0/release/cauldron/name/borgbackup
.. _pkgsrc: https://pkgsrc.se/sysutils/py-borgbackup
.. _cauldron: https://madb.mageia.org/package/show/application/0/release/cauldron/name/borgbackup
.. _.nix file: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/backup/borgbackup/default.nix
.. _OpenBSD ports: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/sysutils/borgbackup/
.. _OpenIndiana hipster repository: https://pkg.openindiana.org/hipster/en/search.shtml?token=borg&action=Search
@ -78,12 +79,12 @@ Ubuntu `Ubuntu packages`_, `Ubuntu PPA`_ ``apt install borgbac
.. _Homebrew: https://formulae.brew.sh/formula/borgbackup
.. _private Tap: https://github.com/borgbackup/homebrew-tap
.. _Raspbian testing: https://archive.raspbian.org/raspbian/pool/main/b/borgbackup/
.. _Ubuntu packages: https://packages.ubuntu.com/xenial/borgbackup
.. _Ubuntu packages: https://launchpad.net/ubuntu/+source/borgbackup
.. _Ubuntu PPA: https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/borgbackup
Please ask package maintainers to build a package or, if you can package /
Please ask package maintainers to build a package or, if you can package/
submit it yourself, please help us with that! See :issue:`105` on
github to followup on packaging efforts.
GitHub to follow up on packaging efforts.
**Current status of package in the repositories**
@ -105,12 +106,12 @@ Standalone Binary
.. note:: Releases are signed with an OpenPGP key, see
:ref:`security-contact` for more instructions.
Borg x86/x64 amd/intel compatible binaries (generated with `pyinstaller`_)
Borg x86/x64 AMD/Intel compatible binaries (generated with `pyinstaller`_)
are available on the releases_ page for the following platforms:
* **Linux**: glibc >= 2.28 (ok for most supported Linux releases).
Older glibc releases are untested and may not work.
* **MacOS**: 10.12 or newer (To avoid signing issues download the file via
* **macOS**: 10.12 or newer (To avoid signing issues, download the file via
command line **or** remove the ``quarantine`` attribute after downloading:
``$ xattr -dr com.apple.quarantine borg-macosx64.tgz``)
* **FreeBSD**: 12.1 (unknown whether it works for older releases)
@ -134,10 +135,10 @@ fail if /tmp has not enough free space or is mounted with the ``noexec``
option. You can change the temporary directory by setting the ``TEMP``
environment variable before running Borg.
If a new version is released, you will have to manually download it and replace
If a new version is released, you will have to download it manually and replace
the old version using the same steps as shown above.
.. _pyinstaller: http://www.pyinstaller.org
.. _pyinstaller: https://www.pyinstaller.org
.. _releases: https://github.com/borgbackup/borg/releases
.. _source-install:
@ -157,30 +158,32 @@ Dependencies
~~~~~~~~~~~~
To install Borg from a source package (including pip), you have to install the
following dependencies first:
following dependencies first. For the libraries you will also need their
development header files (sometimes in a separate `-dev` or `-devel` package).
* `Python 3`_ >= 3.8.0, plus development headers.
* OpenSSL_ >= 1.0.0, plus development headers.
* libacl_ (which depends on libattr_), both plus development headers.
* We have bundled code of the following packages, but borg by default (see
setup.py if you want to change that) prefers a shared library if it can
be found on the system (lib + dev headers) at build time:
- liblz4_ >= 1.7.0 (r129)
- libzstd_ >= 1.3.0
- libxxhash >= 0.8.1 (0.8.0 might work also)
* pkg-config (cli tool) and pkgconfig python package (borg uses these to
discover header and library location - if it can't import pkgconfig and
is not pointed to header/library locations via env vars [see setup.py],
it will fall back to using the bundled code, see above).
**These must be present before invoking setup.py!**
* some other Python dependencies, pip will automatically install them for you.
* optionally, if you wish to mount an archive as a FUSE filesystem, you need
* `Python 3`_ >= 3.10.0
* OpenSSL_ >= 1.1.1 (LibreSSL will not work)
* libacl_ (which depends on libattr_)
* libxxhash_ >= 0.8.1
* liblz4_ >= 1.7.0 (r129)
* libzstd_ >= 1.3.0
* libffi (required for argon2-cffi-bindings)
* pkg-config (cli tool) - Borg uses this to discover header and library
locations automatically. Alternatively, you can also point to them via some
environment variables, see setup.py.
* Some other Python dependencies, pip will automatically install them for you.
* Optionally, if you wish to mount an archive as a FUSE filesystem, you need
a FUSE implementation for Python:
- Either pyfuse3_ (preferably, newer and maintained) or llfuse_ (older,
unmaintained now). See also the BORG_FUSE_IMPL env variable.
- See setup.py about the version requirements.
- mfusepy_ >= 3.1.0 (for fuse 2 and fuse 3, use `pip install borgbackup[mfusepy]`), or
- pyfuse3_ >= 3.1.1 (for fuse 3, use `pip install borgbackup[pyfuse3]`), or
- llfuse_ >= 1.3.8 (for fuse 2, use `pip install borgbackup[llfuse]`).
- Additionally, your OS will need to have FUSE support installed
(e.g. a package `fuse` for fuse 2 or a package `fuse3` for fuse 3 support).
* Optionally, if you wish to use S3/B2 Backend:
- borgstore[s3] ~= 0.3.0 (use `pip install borgbackup[s3]`)
* Optionally, if you wish to use SFTP Backend:
- borgstore[sftp] ~= 0.3.0 (use `pip install borgbackup[sftp]`)
If you have troubles finding the right package names, have a look at the
distribution specific sections below or the Vagrantfile in the git repository,
@ -188,24 +191,35 @@ which contains installation scripts for a number of operating systems.
In the following, the steps needed to install the dependencies are listed for a
selection of platforms. If your distribution is not covered by these
instructions, try to use your package manager to install the dependencies. On
FreeBSD, you may need to get a recent enough OpenSSL version from FreeBSD
ports.
instructions, try to use your package manager to install the dependencies.
After you have installed the dependencies, you can proceed with steps outlined
under :ref:`pip-installation`.
Arch Linux
++++++++++
Install the runtime and build dependencies::
pacman -S python python-pip python-virtualenv openssl acl xxhash lz4 zstd base-devel
pacman -S fuse2 # needed for llfuse
pacman -S fuse3 # needed for pyfuse3
Note that Arch Linux specifically doesn't support
`partial upgrades <https://wiki.archlinux.org/title/Partial_upgrade>`__,
so in case some packages cannot be retrieved from the repo, run with ``pacman -Syu``.
Debian / Ubuntu
+++++++++++++++
Install the dependencies with development headers::
sudo apt-get install python3 python3-dev python3-pip python3-virtualenv \
libacl1-dev libacl1 \
libacl1-dev \
libssl-dev \
liblz4-dev libzstd-dev libxxhash-dev \
build-essential \
pkg-config python3-pkgconfig
libffi-dev \
build-essential pkg-config
sudo apt-get install libfuse-dev fuse # needed for llfuse
sudo apt-get install libfuse3-dev fuse3 # needed for pyfuse3
@ -219,10 +233,11 @@ Fedora
Install the dependencies with development headers::
sudo dnf install python3 python3-devel python3-pip python3-virtualenv \
libacl-devel libacl \
libacl-devel \
openssl-devel \
lz4-devel libzstd-devel xxhash-devel \
pkgconf python3-pkgconfig
libffi-devel \
pkgconf
sudo dnf install gcc gcc-c++ redhat-rpm-config
sudo dnf install fuse-devel fuse # needed for llfuse
sudo dnf install fuse3-devel fuse3 # needed for pyfuse3
@ -237,8 +252,8 @@ Install the dependencies automatically using zypper::
Alternatively, you can enumerate all build dependencies in the command line::
sudo zypper install python3 python3-devel \
libacl-devel openssl-devel \
libxxhash-devel \
libacl-devel openssl-devel xxhash-devel libzstd-devel liblz4-devel \
libffi-devel \
python3-Cython python3-Sphinx python3-msgpack-python python3-pkgconfig pkgconf \
python3-pytest python3-setuptools python3-setuptools_scm \
python3-sphinx_rtd_theme gcc gcc-c++
@ -247,16 +262,10 @@ Alternatively, you can enumerate all build dependencies in the command line::
macOS
+++++
When installing via Homebrew_, dependencies are installed automatically. To install
dependencies manually::
When installing borgbackup via Homebrew_, the basic dependencies are installed automatically.
brew install python3 openssl zstd lz4 xxhash
brew install pkg-config
pip3 install virtualenv pkgconfig
For FUSE support to mount the backup archives, you need at least version 3.0 of
macFUSE, which is available via `github
<https://github.com/osxfuse/osxfuse/releases/latest>`__, or Homebrew::
For FUSE support to mount the backup archives, you need macFUSE, which is available
via `github <https://github.com/osxfuse/osxfuse/releases/latest>`__, or Homebrew::
brew install --cask macfuse
@ -266,7 +275,14 @@ the installed ``openssl`` formula, point pkg-config to the correct path::
PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" pip install borgbackup[llfuse]
For OS X Catalina and later, be aware that you must authorize full disk access.
When working from a borg git repo workdir, you can install dependencies using the
Brewfile::
brew install python@3.11 # can be any supported python3 version
brew bundle install # install requirements from borg repo's ./Brewfile
pip3 install virtualenv
Be aware that for all recent macOS releases you must authorize full disk access.
It is no longer sufficient to run borg backups as root. If you have not yet
granted full disk access, and you run Borg backup from cron, you will see
messages such as::
@ -297,6 +313,20 @@ and commands to make FUSE work for using the mount command.
kldload fuse
sysctl vfs.usermount=1
.. _windows_deps:
Windows
+++++++
.. note::
Running under Windows is experimental.
.. warning::
This script needs to be run in the UCRT64 environment in MSYS2.
Install the dependencies with the provided script::
./scripts/msys2-install-deps
Windows 10's Linux Subsystem
++++++++++++++++++++++++++++
@ -315,11 +345,34 @@ Cygwin
Use the Cygwin installer to install the dependencies::
python38 python38-devel python38-pkgconfig
python38-setuptools python38-pip python38-wheel python38-virtualenv
python39 python39-devel
python39-setuptools python39-pip python39-wheel python39-virtualenv
libssl-devel libxxhash-devel liblz4-devel libzstd-devel
binutils gcc-g++ git make openssh
Make sure to use a virtual environment to avoid confusions with any Python installed on Windows.
.. _windows-binary:
Building a binary on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. note::
This is experimental.
.. warning::
This needs to be run in the UCRT64 environment in MSYS2.
Ensure to install the dependencies as described within :ref:`Dependencies: Windows <windows_deps>`.
::
# Needed for setuptools < 70.2.0 to work - https://www.msys2.org/docs/python/#known-issues
# export SETUPTOOLS_USE_DISTUTILS=stdlib
pip install -e .
pyinstaller -y scripts/borg.exe.spec
A standalone executable will be created in ``dist/borg.exe``.
.. _pip-installation:
@ -330,11 +383,13 @@ Virtualenv_ can be used to build and install Borg without affecting
the system Python or requiring root access. Using a virtual environment is
optional, but recommended except for the most simple use cases.
Ensure to install the dependencies as described within :ref:`source-install`.
.. note::
If you install into a virtual environment, you need to **activate** it
first (``source borg-env/bin/activate``), before running ``borg``.
Alternatively, symlink ``borg-env/bin/borg`` into some directory that is in
your ``PATH`` so you can just run ``borg``.
your ``PATH`` so you can run ``borg``.
This will use ``pip`` to install the latest release from PyPi::
@ -344,9 +399,6 @@ This will use ``pip`` to install the latest release from PyPi::
# might be required if your tools are outdated
pip install -U pip setuptools wheel
# pkgconfig MUST be available before borg is installed!
pip install pkgconfig
# install Borg + Python dependencies into virtualenv
pip install borgbackup
# or alternatively (if you want FUSE support):
@ -358,6 +410,19 @@ activating your virtual environment::
pip install -U borgbackup # or ... borgbackup[llfuse/pyfuse3]
When doing manual pip installation, man pages are not automatically
installed. You can run these commands to install the man pages
locally::
# get borg from github
git clone https://github.com/borgbackup/borg.git borg
# Install the files with proper permissions
install -D -m 0644 borg/docs/man/borg*.1* $HOME/.local/share/man/man1/borg.1
# Update the man page cache
mandb
.. _git-installation:
Using git
@ -366,20 +431,30 @@ Using git
This uses latest, unreleased development code from git.
While we try not to break master, there are no guarantees on anything.
Ensure to install the dependencies as described within :ref:`source-install`.
Version metadata is obtained dynamically at install time using ``setuptools-scm``.
Please ensure that your git repo either has correct tags, or provide the version
manually using the ``SETUPTOOLS_SCM_PRETEND_VERSION`` environment variable.
::
# get borg from github
git clone https://github.com/borgbackup/borg.git
# create a virtual environment
virtualenv --python=${which python3} borg-env
virtualenv --python=$(which python3) borg-env
source borg-env/bin/activate # always before using!
# install borg + dependencies into virtualenv
# install borg dependencies into virtualenv
cd borg
pip install -r requirements.d/development.txt
pip install -r requirements.d/docs.txt # optional, to build the docs
# set a borg version if setuptools-scm fails to do so automatically
export SETUPTOOLS_SCM_PRETEND_VERSION=
# install borg into virtualenv
pip install -e . # in-place editable mode
or
pip install -e .[pyfuse3] # in-place editable mode, use pyfuse3
@ -397,11 +472,11 @@ If you need to use a different version of Python you can install this using ``py
...
# create a virtual environment
pyenv install 3.8.0 # minimum, preferably use something more recent!
pyenv global 3.8.0
pyenv local 3.8.0
pyenv install 3.10.0 # minimum, preferably use something more recent!
pyenv global 3.10.0
pyenv local 3.10.0
virtualenv --python=${pyenv which python} borg-env
source borg-env/bin/activate # always before using!
...
.. note:: As a developer or power user, you always want to use a virtual environment.
.. note:: As a developer or power user, you should always use a virtual environment.

View file

@ -4,7 +4,7 @@
Internals
=========
The internals chapter describes and analyses most of the inner workings
The internals chapter describes and analyzes most of the inner workings
of Borg.
Borg uses a low-level, key-value store, the :ref:`repository`, and
@ -19,18 +19,18 @@ specified when the backup was performed.
Deduplication is performed globally across all data in the repository
(multiple backups and even multiple hosts), both on data and file
metadata, using :ref:`chunks` created by the chunker using the
Buzhash_ algorithm ("buzhash" chunker) or a simpler fixed blocksize
algorithm ("fixed" chunker).
Buzhash_ algorithm ("buzhash" and "buzhash64" chunker) or a simpler
fixed block size algorithm ("fixed" chunker).
To actually perform the repository-wide deduplication, a hash of each
To perform the repository-wide deduplication, a hash of each
chunk is checked against the :ref:`chunks cache <cache>`, which is a
hash-table of all chunks that already exist.
hash table of all chunks that already exist.
.. figure:: internals/structure.png
:figwidth: 100%
:width: 100%
Layers in Borg. On the very top commands are implemented, using
Layers in Borg. At the very top, commands are implemented, using
a data access layer provided by the Archive and Item classes.
The "key" object provides both compression and authenticated
encryption used by the data access layer. The "key" object represents

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 KiB

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

View file

@ -10,17 +10,14 @@ Borg does not have a public API on the Python level. That does not keep you from
but does mean that there are no release-to-release guarantees on what you might find in that package, not
even for point releases (1.1.x), and there is no documentation beyond the code and the internals documents.
Borg does on the other hand provide an API on a command-line level. In other words, a frontend should to
(for example) create a backup archive just invoke :ref:`borg_create`, give commandline parameters/options
as needed and parse JSON output from borg.
Borg does on the other hand provide an API on a command-line level. In other words, a frontend should
(for example) create a backup archive by invoking :ref:`borg_create`, provide command-line parameters/options
as needed, and parse JSON output from Borg.
Important: JSON output is expected to be UTF-8, but currently borg depends on the locale being configured
for that (must be a UTF-8 locale and *not* "C" or "ascii"), so that Python will choose to encode to UTF-8.
The same applies to any inputs read by borg, they are expected to be UTF-8 encoded also.
We consider this a bug (see :issue:`2273`) and might fix it later, so borg will use UTF-8 independent of
the locale.
On POSIX systems, you can usually set environment vars to choose a UTF-8 locale:
::
@ -29,6 +26,53 @@ On POSIX systems, you can usually set environment vars to choose a UTF-8 locale:
export LC_CTYPE=en_US.UTF-8
Another way to get Python's stdin/stdout/stderr streams to use UTF-8 encoding (without having
a UTF-8 locale / LANG / LC_CTYPE) is:
::
export PYTHONIOENCODING=utf-8
See :issue:`2273` for more details.
Dealing with non-unicode byte sequences and JSON limitations
------------------------------------------------------------
Paths on POSIX systems can have arbitrary bytes in them (except 0x00 which is used as string terminator in C).
Nowadays, UTF-8 encoded paths (which decode to valid unicode) are the usual thing, but a lot of systems
still have paths from the past, when other, non-unicode codings were used. Especially old Samba shares often
have wild mixtures of misc. encodings, sometimes even very broken stuff.
borg deals with such non-unicode paths ("with funny/broken characters") by decoding such byte sequences using
UTF-8 coding and "surrogateescape" error handling mode, which maps invalid bytes to special unicode code points
(surrogate escapes). When encoding such a unicode string back to a byte sequence, the original byte sequence
will be reproduced exactly.
JSON should only contain valid unicode text without any surrogate escapes, so we can't just directly have a
surrogate-escaped path in JSON ("path" is only one example, this also affects other text-like content).
Borg deals with this situation like this (since borg 2.0):
For a valid unicode path (no surrogate escapes), the JSON will only have "path": path.
For a non-unicode path (with surrogate escapes), the JSON will have 2 entries:
- "path": path_approximation (pure valid unicode, all invalid bytes will show up as "?")
- "path_b64": path_bytes_base64_encoded (if you decode the base64, you get the original path byte string)
JSON users need to pick whatever suits their needs best. The suggested procedure (shown for "path") is:
- check if there is a "path_b64" key.
- if it is there, you will know that the original bytes path did not cleanly UTF-8-decode into unicode (has
some invalid bytes) and that the string given by the "path" key is only an approximation, but not the precise
path. if you need precision, you must base64-decode the value of "path_b64" and deal with the arbitrary byte
string you'll get. if an approximation is fine, use the value of the "path" key.
- if it is not there, the value of the "path" key is all you need (the original bytes path is its UTF-8 encoding).
Logging
-------
@ -40,8 +84,6 @@ where each line is a JSON object. The *type* key of the object determines its ot
parsing error will be printed in plain text, because logging set-up happens after all arguments are
parsed.
Since JSON can only encode text, any string representing a file system path may miss non-text parts.
The following types are in use. Progress information is governed by the usual rules for progress information,
it is not produced unless ``--progress`` is specified.
@ -50,17 +92,20 @@ archive_progress
The following keys exist, each represents the current progress.
original_size
Original size of data processed so far (before compression and deduplication)
Original size of data processed so far (before compression and deduplication, may be empty/absent)
compressed_size
Compressed size
Compressed size (may be empty/absent)
deduplicated_size
Deduplicated size
Deduplicated size (may be empty/absent)
nfiles
Number of (regular) files processed so far
Number of (regular) files processed so far (may be empty/absent)
path
Current path
Current path (may be empty/absent)
time
Unix timestamp (float)
finished
boolean indicating whether the operation has finished, only the last object for an *operation*
can have this property set to *true*.
progress_message
A message-based progress information with no concrete progress information, just a message
@ -90,12 +135,14 @@ progress_percent
can have this property set to *true*.
message
A formatted progress message, this will include the percentage and perhaps other information
(absent for finished == true)
current
Current value (always less-or-equal to *total*)
Current value (always less-or-equal to *total*, absent for finished == true)
info
Array that describes the current item, may be *null*, contents depend on *msgid*
(absent for finished == true)
total
Total value
Total value (absent for finished == true)
time
Unix timestamp (float)
@ -208,7 +255,7 @@ Passphrase prompts should be handled differently. Use the environment variables
and *BORG_NEW_PASSPHRASE* (see :ref:`env_vars` for reference) to pass passphrases to Borg, don't
use the interactive passphrase prompts.
When setting a new passphrase (:ref:`borg_init`, :ref:`borg_key_change-passphrase`) normally
When setting a new passphrase (:ref:`borg_repo-create`, :ref:`borg_key_change-passphrase`) normally
Borg prompts whether it should display the passphrase. This can be suppressed by setting
the environment variable *BORG_DISPLAY_PASSPHRASE* to *no*.
@ -233,7 +280,7 @@ and :ref:`borg_list` implement a ``--json`` option which turns their regular out
Some commands, like :ref:`borg_list` and :ref:`borg_diff`, can produce *a lot* of JSON. Since many JSON implementations
don't support a streaming mode of operation, which is pretty much required to deal with this amount of JSON, these
commands implement a ``--json-lines`` option which generates output in the `JSON lines <http://jsonlines.org/>`_ format,
commands implement a ``--json-lines`` option which generates output in the `JSON lines <https://jsonlines.org/>`_ format,
which is simply a number of JSON objects separated by new lines.
Dates are formatted according to ISO 8601 in local time. No explicit time zone is specified *at this time*
@ -252,7 +299,7 @@ last_modified
The *encryption* key, if present, contains:
mode
Textual encryption mode name (same as :ref:`borg_init` ``--encryption`` names)
Textual encryption mode name (same as :ref:`borg_repo-create` ``--encryption`` names)
keyfile
Path to the local key file used for access. Depending on *mode* this key may be absent.
@ -269,12 +316,8 @@ stats
Number of unique chunks
total_size
Total uncompressed size of all chunks multiplied with their reference counts
total_csize
Total compressed and encrypted size of all chunks multiplied with their reference counts
unique_size
Uncompressed size of all chunks
unique_csize
Compressed and encrypted size of all chunks
.. highlight: json
@ -285,10 +328,8 @@ Example *borg info* output::
"path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
"stats": {
"total_chunks": 511533,
"total_csize": 17948017540,
"total_size": 22635749792,
"total_unique_chunks": 54892,
"unique_csize": 1920405405,
"unique_size": 2449675468
}
},
@ -332,11 +373,6 @@ stats
Deduplicated size (against the current repository, not when the archive was created)
nfiles
Number of regular files in the archive
limits
Object describing the utilization of Borg limits
max_archive_size
Float between 0 and 1 describing how large this archive is relative to the maximum size allowed by Borg
command_line
Array of strings of the command line that created the archive
@ -406,9 +442,6 @@ The same archive with more information (``borg info --last 1 --json``)::
"end": "2017-02-27T12:27:20.789123",
"hostname": "host",
"id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a",
"limits": {
"max_archive_size": 0.0001330855110409714
},
"name": "host-system-backup-2017-02-27",
"start": "2017-02-27T12:27:20.789123",
"stats": {
@ -424,10 +457,8 @@ The same archive with more information (``borg info --last 1 --json``)::
"path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
"stats": {
"total_chunks": 511533,
"total_csize": 17948017540,
"total_size": 22635749792,
"total_unique_chunks": 54892,
"unique_csize": 1920405405,
"unique_size": 2449675468
}
},
@ -449,14 +480,15 @@ Refer to the *borg list* documentation for the available keys and their meaning.
Example (excerpt) of ``borg list --json-lines``::
{"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2017-02-27T12:27:20.023407", "size": 0}
{"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux/baz", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2017-02-27T12:27:20.585407", "size": 0}
{"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux", "target": "", "flags": null, "mtime": "2017-02-27T12:27:20.023407", "size": 0}
{"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux/baz", "target": "", "flags": null, "mtime": "2017-02-27T12:27:20.585407", "size": 0}
Archive Differencing
++++++++++++++++++++
Each archive difference item (file contents, user/group/mode) output by :ref:`borg_diff` is represented by an *ItemDiff* object.
The propertiese of an *ItemDiff* object are:
The properties of an *ItemDiff* object are:
path:
The filename/path of the *Item* (file, directory, symlink).
@ -465,13 +497,13 @@ changes:
A list of *Change* objects describing the changes made to the item in the two archives. For example,
there will be two changes if the contents of a file are changed, and its ownership are changed.
The *Change* object can contain a number of properties depending on the type of change that occured.
The *Change* object can contain a number of properties depending on the type of change that occurred.
If a 'property' is not required for the type of change, it is not output.
The possible properties of a *Change* object are:
type:
The **type** property is always present. It identifies the type of change and will be one of these values:
- *modified* - file contents changed.
- *added* - the file was added.
- *removed* - the file was removed.
@ -495,26 +527,26 @@ added:
removed:
See **added** property.
old_mode:
If **type** == '*mode*', then **old_mode** and **new_mode** provide the mode and permissions changes.
new_mode:
See **old_mode** property.
old_user:
If **type** == '*owner*', then **old_user**, **new_user**, **old_group** and **new_group** provide the user
and group ownership changes.
old_group:
See **old_user** property.
new_user:
See **old_user** property.
new_group:
See **old_user** property.
Example (excerpt) of ``borg diff --json-lines``::
@ -533,92 +565,171 @@ Message IDs are strings that essentially give a log message or operation a name,
full text, since texts change more frequently. Message IDs are unambiguous and reduce the need to parse
log messages.
Assigned message IDs are:
Assigned message IDs and related error RCs (exit codes) are:
.. See scripts/errorlist.py; this is slightly edited.
Errors
Archive.AlreadyExists
Archive {} already exists
Archive.DoesNotExist
Archive {} does not exist
Archive.IncompatibleFilesystemEncodingError
Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable.
Cache.CacheInitAbortedError
Cache initialization aborted
Cache.EncryptionMethodMismatch
Repository encryption method changed since last access, refusing to continue
Cache.RepositoryAccessAborted
Repository access aborted
Cache.RepositoryIDNotUnique
Cache is newer than repository - do you have multiple, independently updated repos with same ID?
Cache.RepositoryReplay
Cache is newer than repository - this is either an attack or unsafe (multiple repos with same ID)
Buffer.MemoryLimitExceeded
Error rc: 2 traceback: no
Error: {}
ErrorWithTraceback rc: 2 traceback: yes
Error: {}
Buffer.MemoryLimitExceeded rc: 2 traceback: no
Requested buffer size {} is above the limit of {}.
ExtensionModuleError
The Borg binary extension modules do not seem to be properly installed
IntegrityError
Data integrity error: {}
NoManifestError
Repository has no manifest.
PlaceholderError
EfficientCollectionQueue.SizeUnderflow rc: 2 traceback: no
Could not pop_front first {} elements, collection only has {} elements..
RTError rc: 2 traceback: no
Runtime Error: {}
CancelledByUser rc: 3 traceback: no
Cancelled by user.
CommandError rc: 4 traceback: no
Command Error: {}
PlaceholderError rc: 5 traceback: no
Formatting Error: "{}".format({}): {}({})
KeyfileInvalidError
Invalid key file for repository {} found in {}.
KeyfileMismatchError
Mismatch between repository {} and key file {}.
KeyfileNotFoundError
No key file for repository {} found in {}.
PassphraseWrong
passphrase supplied in BORG_PASSPHRASE is incorrect
PasswordRetriesExceeded
exceeded the maximum password retries
RepoKeyNotFoundError
No key entry found in the config of repository {}.
UnsupportedManifestError
InvalidPlaceholder rc: 6 traceback: no
Invalid placeholder "{}" in string: {}
Repository.AlreadyExists rc: 10 traceback: no
A repository already exists at {}.
Repository.CheckNeeded rc: 12 traceback: yes
Inconsistency detected. Please run "borg check {}".
Repository.DoesNotExist rc: 13 traceback: no
Repository {} does not exist.
Repository.InsufficientFreeSpaceError rc: 14 traceback: no
Insufficient free space to complete transaction (required: {}, available: {}).
Repository.InvalidRepository rc: 15 traceback: no
{} is not a valid repository. Check repo config.
Repository.InvalidRepositoryConfig rc: 16 traceback: no
{} does not have a valid configuration. Check repo config [{}].
Repository.ObjectNotFound rc: 17 traceback: yes
Object with key {} not found in repository {}.
Repository.ParentPathDoesNotExist rc: 18 traceback: no
The parent path of the repo directory [{}] does not exist.
Repository.PathAlreadyExists rc: 19 traceback: no
There is already something at {}.
Repository.PathPermissionDenied rc: 21 traceback: no
Permission denied to {}.
MandatoryFeatureUnsupported rc: 25 traceback: no
Unsupported repository feature(s) {}. A newer version of borg is required to access this repository.
NoManifestError rc: 26 traceback: no
Repository has no manifest.
UnsupportedManifestError rc: 27 traceback: no
Unsupported manifest envelope. A newer version is required to access this repository.
UnsupportedPayloadError
Unsupported payload type {}. A newer version is required to access this repository.
NotABorgKeyFile
Archive.AlreadyExists rc: 30 traceback: no
Archive {} already exists
Archive.DoesNotExist rc: 31 traceback: no
Archive {} does not exist
Archive.IncompatibleFilesystemEncodingError rc: 32 traceback: no
Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable.
KeyfileInvalidError rc: 40 traceback: no
Invalid key data for repository {} found in {}.
KeyfileMismatchError rc: 41 traceback: no
Mismatch between repository {} and key file {}.
KeyfileNotFoundError rc: 42 traceback: no
No key file for repository {} found in {}.
NotABorgKeyFile rc: 43 traceback: no
This file is not a borg key backup, aborting.
RepoIdMismatch
RepoKeyNotFoundError rc: 44 traceback: no
No key entry found in the config of repository {}.
RepoIdMismatch rc: 45 traceback: no
This key backup seems to be for a different backup repository, aborting.
UnencryptedRepo
Keymanagement not available for unencrypted repositories.
UnknownKeyType
Keytype {0} is unknown.
LockError
UnencryptedRepo rc: 46 traceback: no
Key management not available for unencrypted repositories.
UnknownKeyType rc: 47 traceback: no
Key type {0} is unknown.
UnsupportedPayloadError rc: 48 traceback: no
Unsupported payload type {}. A newer version is required to access this repository.
UnsupportedKeyFormatError rc: 49 traceback:no
Your borg key is stored in an unsupported format. Try using a newer version of borg.
NoPassphraseFailure rc: 50 traceback: no
can not acquire a passphrase: {}
PasscommandFailure rc: 51 traceback: no
passcommand supplied in BORG_PASSCOMMAND failed: {}
PassphraseWrong rc: 52 traceback: no
passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect.
PasswordRetriesExceeded rc: 53 traceback: no
exceeded the maximum password retries
Cache.CacheInitAbortedError rc: 60 traceback: no
Cache initialization aborted
Cache.EncryptionMethodMismatch rc: 61 traceback: no
Repository encryption method changed since last access, refusing to continue
Cache.RepositoryAccessAborted rc: 62 traceback: no
Repository access aborted
Cache.RepositoryIDNotUnique rc: 63 traceback: no
Cache is newer than repository - do you have multiple, independently updated repos with same ID?
Cache.RepositoryReplay rc: 64 traceback: no
Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID)
LockError rc: 70 traceback: no
Failed to acquire the lock {}.
LockErrorT
LockErrorT rc: 71 traceback: yes
Failed to acquire the lock {}.
ConnectionClosed
LockFailed rc: 72 traceback: yes
Failed to create/acquire the lock {} ({}).
LockTimeout rc: 73 traceback: no
Failed to create/acquire the lock {} (timeout).
NotLocked rc: 74 traceback: yes
Failed to release the lock {} (was not locked).
NotMyLock rc: 75 traceback: yes
Failed to release the lock {} (was/is locked, but not by me).
ConnectionClosed rc: 80 traceback: no
Connection closed by remote host
InvalidRPCMethod
ConnectionClosedWithHint rc: 81 traceback: no
Connection closed by remote host. {}
InvalidRPCMethod rc: 82 traceback: no
RPC method {} is not valid
PathNotAllowed
Repository path not allowed
RemoteRepository.RPCServerOutdated
PathNotAllowed rc: 83 traceback: no
Repository path not allowed: {}
RemoteRepository.RPCServerOutdated rc: 84 traceback: no
Borg server is too old for {}. Required version {}
UnexpectedRPCDataFormatFromClient
UnexpectedRPCDataFormatFromClient rc: 85 traceback: no
Borg {}: Got unexpected RPC data format from client.
UnexpectedRPCDataFormatFromServer
UnexpectedRPCDataFormatFromServer rc: 86 traceback: no
Got unexpected RPC data format from server:
{}
Repository.AlreadyExists
Repository {} already exists.
Repository.CheckNeeded
Inconsistency detected. Please run "borg check {}".
Repository.DoesNotExist
Repository {} does not exist.
Repository.InsufficientFreeSpaceError
Insufficient free space to complete transaction (required: {}, available: {}).
Repository.InvalidRepository
{} is not a valid repository. Check repo config.
Repository.AtticRepository
Attic repository detected. Please run "borg upgrade {}".
Repository.ObjectNotFound
Object with key {} not found in repository {}.
ConnectionBrokenWithHint rc: 87 traceback: no
Connection to remote host is broken. {}
IntegrityError rc: 90 traceback: yes
Data integrity error: {}
FileIntegrityError rc: 91 traceback: yes
File failed integrity check: {}
DecompressionError rc: 92 traceback: yes
Decompression error: {}
Warnings
BorgWarning rc: 1
Warning: {}
BackupWarning rc: 1
{}: {}
FileChangedWarning rc: 100
{}: file changed while we backed it up
IncludePatternNeverMatchedWarning rc: 101
Include pattern '{}' never matched.
BackupError rc: 102
{}: backup error
BackupRaceConditionError rc: 103
{}: file type or inode changed while we backed it up (race condition, skipped file)
BackupOSError rc: 104
{}: {}
BackupPermissionError rc: 105
{}: {}
BackupIOError rc: 106
{}: {}
BackupFileNotFoundError rc: 107
{}: {}
Operations
- cache.begin_transaction
@ -632,6 +743,7 @@ Operations
- repository.check
- check.verify_data
- check.rebuild_manifest
- check.rebuild_refcounts
- extract
*info* is one string element, the name of the path currently extracted.
@ -649,4 +761,4 @@ Prompts
BORG_CHECK_I_KNOW_WHAT_I_AM_DOING
For "This is a potentially dangerous function..." (check --repair)
BORG_DELETE_I_KNOW_WHAT_I_AM_DOING
For "You requested to completely DELETE the repository *including* all archives it contains:"
For "You requested to DELETE the repository completely *including* all archives it contains:"

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

View file

@ -1,3 +1,5 @@
.. include:: ../global.rst.inc
.. somewhat surprisingly the "bash" highlighter gives nice results with
the pseudo-code notation used in the "Encryption" section.
@ -22,25 +24,22 @@ The attack model of Borg is that the environment of the client process
attacker has any and all access to the repository, including interactive
manipulation (man-in-the-middle) for remote repositories.
Furthermore the client environment is assumed to be persistent across
Furthermore, the client environment is assumed to be persistent across
attacks (practically this means that the security database cannot be
deleted between attacks).
Under these circumstances Borg guarantees that the attacker cannot
1. modify the data of any archive without the client detecting the change
2. rename, remove or add an archive without the client detecting the change
2. rename or add an archive without the client detecting the change
3. recover plain-text data
4. recover definite (heuristics based on access patterns are possible)
structural information such as the object graph (which archives
refer to what chunks)
The attacker can always impose a denial of service per definition (he could
forbid connections to the repository, or delete it entirely).
The attacker can always impose a denial of service by definition (they could
block connections to the repository, or delete it partly or entirely).
When the above attack model is extended to include multiple clients
independently updating the same repository, then Borg fails to provide
confidentiality (i.e. guarantees 3) and 4) do not apply any more).
.. _security_structural_auth:
@ -48,12 +47,12 @@ Structural Authentication
-------------------------
Borg is fundamentally based on an object graph structure (see :ref:`internals`),
where the root object is called the manifest.
where the root objects are the archives.
Borg follows the `Horton principle`_, which states that
not only the message must be authenticated, but also its meaning (often
expressed through context), because every object used is referenced by a
parent object through its object ID up to the manifest. The object ID in
parent object through its object ID up to the archive list entry. The object ID in
Borg is a MAC of the object's plaintext, therefore this ensures that
an attacker cannot change the context of an object without forging the MAC.
@ -61,50 +60,45 @@ In other words, the object ID itself only authenticates the plaintext of the
object and not its context or meaning. The latter is established by a different
object referring to an object ID, thereby assigning a particular meaning to
an object. For example, an archive item contains a list of object IDs that
represent packed file metadata. On their own it's not clear that these objects
represent packed file metadata. On their own, it's not clear that these objects
would represent what they do, but by the archive item referring to them
in a particular part of its own data structure assigns this meaning.
This results in a directed acyclic graph of authentication from the manifest
to the data chunks of individual files.
This results in a directed acyclic graph of authentication from the archive
list entry to the data chunks of individual files.
.. _tam_description:
Above used to be all for borg 1.x and was the reason why it needed the
tertiary authentication mechanism (TAM) for manifest and archives.
.. rubric:: Authenticating the manifest
borg 2 now stores the ro_type ("meaning") of a repo object's data into that
object's metadata (like e.g.: manifest vs. archive vs. user file content data).
When loading data from the repo, borg verifies that the type of object it got
matches the type it wanted. borg 2 does not use TAMs any more.
Since the manifest has a fixed ID (000...000) the aforementioned authentication
does not apply to it, indeed, cannot apply to it; it is impossible to authenticate
the root node of a DAG through its edges, since the root node has no incoming edges.
As both the object's metadata and data are AEAD encrypted and also bound to
the object ID (via giving the ID as AAD), there is no way an attacker (without
access to the borg key) could change the type of the object or move content
to a different object ID.
With the scheme as described so far an attacker could easily replace the manifest,
therefore Borg includes a tertiary authentication mechanism (TAM) that is applied
to the manifest since version 1.0.9 (see :ref:`tam_vuln`).
This effectively 'anchors' each archive to the key, which is controlled by the
client, thereby anchoring the DAG starting from the archives list entry,
making it impossible for an attacker to add or modify any part of the
DAG without Borg being able to detect the tampering.
TAM works by deriving a separate key through HKDF_ from the other encryption and
authentication keys and calculating the HMAC of the metadata to authenticate [#]_::
Please note that removing an archive by removing an entry from archives/*
is possible and is done by ``borg delete`` and ``borg prune`` within their
normal operation. An attacker could also remove some entries there, but, due to
encryption, would not know what exactly they are removing. An attacker with
repository access could also remove other parts of the repository or the whole
repository, so there is not much point in protecting against archive removal.
# RANDOM(n) returns n random bytes
salt = RANDOM(64)
The borg 1.x way of having the archives list within the manifest chunk was
problematic as it required a read-modify-write operation on the manifest,
requiring a lock on the repository. We want to try less locking and more
parallelism in future.
ikm = id_key || enc_key || enc_hmac_key
# *context* depends on the operation, for manifest authentication it is
# the ASCII string "borg-metadata-authentication-manifest".
tam_key = HKDF-SHA-512(ikm, salt, context)
# *data* is a dict-like structure
data[hmac] = zeroes
packed = pack(data)
data[hmac] = HMAC(tam_key, packed)
packed_authenticated = pack(data)
Since an attacker cannot gain access to this key and also cannot make the
client authenticate arbitrary data using this mechanism, the attacker is unable
to forge the authentication.
This effectively 'anchors' the manifest to the key, which is controlled by the
client, thereby anchoring the entire DAG, making it impossible for an attacker
to add, remove or modify any part of the DAG without Borg being able to detect
the tampering.
Passphrase notes
----------------
Note that when using BORG_PASSPHRASE the attacker cannot swap the *entire*
repository against a new repository with e.g. repokey mode and no passphrase,
@ -114,106 +108,95 @@ However, interactively a user might not notice this kind of attack
immediately, if she assumes that the reason for the absent passphrase
prompt is a set BORG_PASSPHRASE. See issue :issue:`2169` for details.
.. [#] The reason why the authentication tag is stored in the packed
data itself is that older Borg versions can still read the
manifest this way, while a changed layout would have broken
compatibility.
.. _security_encryption:
Encryption
----------
Encryption is currently based on the Encrypt-then-MAC construction,
which is generally seen as the most robust way to create an authenticated
encryption scheme from encryption and message authentication primitives.
AEAD modes
~~~~~~~~~~
Every operation (encryption, MAC / authentication, chunk ID derivation)
uses independent, random keys generated by `os.urandom`_ [#]_.
Modes: --encryption (repokey|keyfile)-[blake2-](aes-ocb|chacha20-poly1305)
Borg does not support unauthenticated encryption -- only authenticated encryption
schemes are supported. No unauthenticated encryption schemes will be added
in the future.
Supported: borg 2.0+
Depending on the chosen mode (see :ref:`borg_init`) different primitives are used:
Encryption with these modes is based on AEAD ciphers (authenticated encryption
with associated data) and session keys.
- The actual encryption is currently always AES-256 in CTR mode. The
counter is added in plaintext, since it is needed for decryption,
and is also tracked locally on the client to avoid counter reuse.
Depending on the chosen mode (see :ref:`borg_repo-create`) different AEAD ciphers are used:
- The authentication primitive is either HMAC-SHA-256 or BLAKE2b-256
in a keyed mode. HMAC-SHA-256 uses 256 bit keys, while BLAKE2b-256
uses 512 bit keys.
- AES-256-OCB - super fast, single-pass algorithm IF you have hw accelerated AES.
- chacha20-poly1305 - very fast, purely software based AEAD cipher.
The latter is secure not only because BLAKE2b itself is not
susceptible to `length extension`_, but also since it truncates the
hash output from 512 bits to 256 bits, which would make the
construction safe even if BLAKE2b were broken regarding length
extension or similar attacks.
The chunk ID is derived via a MAC over the plaintext (mac key taken from borg key):
- The primitive used for authentication is always the same primitive
that is used for deriving the chunk ID, but they are always
used with independent keys.
- HMAC-SHA256 - super fast IF you have hw accelerated SHA256 (see section "Encryption" below).
- Blake2b - very fast, purely software based algorithm.
For each borg invocation, a new session id is generated by `os.urandom`_.
From that session id, the initial key material (ikm, taken from the borg key)
and an application and cipher specific salt, borg derives a session key using a
"one-step KDF" based on just sha256.
For each session key, IVs (nonces) are generated by a counter which increments for
each encrypted message.
Session::
sessionid = os.urandom(24)
domain = "borg-session-key-CIPHERNAME"
sessionkey = sha256(crypt_key + sessionid + domain)
message_iv = 0
Encryption::
id = AUTHENTICATOR(id_key, data)
id = MAC(id_key, data)
compressed = compress(data)
iv = reserve_iv()
encrypted = AES-256-CTR(enc_key, 8-null-bytes || iv, compressed)
authenticated = type-byte || AUTHENTICATOR(enc_hmac_key, encrypted) || iv || encrypted
header = type-byte || 00h || message_iv || sessionid
aad = id || header
message_iv++
encrypted, auth_tag = AEAD_encrypt(session_key, message_iv, compressed, aad)
authenticated = header || auth_tag || encrypted
Decryption::
# Given: input *authenticated* data, possibly a *chunk-id* to assert
type-byte, mac, iv, encrypted = SPLIT(authenticated)
# Given: input *authenticated* data and a *chunk-id* to assert
type-byte, past_message_iv, past_sessionid, auth_tag, encrypted = SPLIT(authenticated)
ASSERT(type-byte is correct)
ASSERT( CONSTANT-TIME-COMPARISON( mac, AUTHENTICATOR(enc_hmac_key, encrypted) ) )
decrypted = AES-256-CTR(enc_key, 8-null-bytes || iv, encrypted)
domain = "borg-session-key-CIPHERNAME"
past_key = sha256(crypt_key + past_sessionid + domain)
decrypted = AEAD_decrypt(past_key, past_message_iv, authenticated)
decompressed = decompress(decrypted)
ASSERT( CONSTANT-TIME-COMPARISON( chunk-id, AUTHENTICATOR(id_key, decompressed) ) )
Notable:
The client needs to track which counter values have been used, since
encrypting a chunk requires a starting counter value and no two chunks
may have overlapping counter ranges (otherwise the bitwise XOR of the
overlapping plaintexts is revealed).
- More modern and often faster AEAD ciphers instead of self-assembled stuff.
- Due to the usage of session keys, IVs (nonces) do not need special care here as
they did for the legacy encryption modes.
- The id is now also input into the authentication tag computation.
This strongly associates the id with the written data (== associates the key with
the value). When later reading the data for some id, authentication will only
succeed if what we get was really written by us for that id.
The client does not directly track the counter value, because it
changes often (with each encrypted chunk), instead it commits a
"reservation" to the security database and the repository by taking
the current counter value and adding 4 GiB / 16 bytes (the block size)
to the counter. Thus the client only needs to commit a new reservation
every few gigabytes of encrypted data.
This mechanism also avoids reusing counter values in case the client
crashes or the connection to the repository is severed, since any
reservation would have been committed to both the security database
and the repository before any data is encrypted. Borg uses its
standard mechanism (SaveFile) to ensure that reservations are durable
(on most hardware / storage systems), therefore a crash of the
client's host would not impact tracking of reservations.
Legacy modes
~~~~~~~~~~~~
However, this design is not infallible, and requires synchronization
between clients, which is handled through the repository. Therefore in
a multiple-client scenario a repository can trick a client into
reusing counter values by ignoring counter reservations and replaying
the manifest (which will fail if the client has seen a more recent
manifest or has a more recent nonce reservation). If the repository is
untrusted, but a trusted synchronization channel exists between
clients, the security database could be synchronized between them over
said trusted channel. This is not part of Borg's functionality.
Modes: --encryption (repokey|keyfile)-[blake2]
.. [#] Using the :ref:`borg key migrate-to-repokey <borg_key_migrate-to-repokey>`
command a user can convert repositories created using Attic in "passphrase"
mode to "repokey" mode. In this case the keys were directly derived from
the user's passphrase at some point using PBKDF2.
Supported: borg < 2.0
These were the AES-CTR based modes in previous borg versions.
borg 2.0 does not support creating new repos using these modes,
but ``borg transfer`` can still read such existing repos.
Borg does not support "passphrase" mode otherwise any more.
.. _key_encryption:
@ -227,32 +210,23 @@ For offline storage of the encryption keys they are encrypted with a
user-chosen passphrase.
A 256 bit key encryption key (KEK) is derived from the passphrase
using PBKDF2-HMAC-SHA256 with a random 256 bit salt which is then used
to Encrypt-*and*-MAC (unlike the Encrypt-*then*-MAC approach used
otherwise) a packed representation of the keys with AES-256-CTR with a
constant initialization vector of 0. A HMAC-SHA256 of the plaintext is
generated using the same KEK and is stored alongside the ciphertext,
which is converted to base64 in its entirety.
using argon2_ with a random 256 bit salt. The KEK is then used
to Encrypt-*then*-MAC a packed representation of the keys using the
chacha20-poly1305 AEAD cipher and a constant IV == 0.
The ciphertext is then converted to base64.
This base64 blob (commonly referred to as *keyblob*) is then stored in
the key file or in the repository config (keyfile and repokey modes
respectively).
This scheme, and specifically the use of a constant IV with the CTR
mode, is secure because an identical passphrase will result in a
different derived KEK for every key encryption due to the salt.
The use of Encrypt-and-MAC instead of Encrypt-then-MAC is seen as
uncritical (but not ideal) here, since it is combined with AES-CTR mode,
which is not vulnerable to padding attacks.
The use of a constant IV is secure because an identical passphrase will
result in a different derived KEK for every key encryption due to the salt.
.. seealso::
Refer to the :ref:`key_files` section for details on the format.
Refer to issue :issue:`747` for suggested improvements of the encryption
scheme and password-based key derivation.
Implementations used
--------------------
@ -260,29 +234,16 @@ Implementations used
We do not implement cryptographic primitives ourselves, but rely
on widely used libraries providing them:
- AES-CTR and HMAC-SHA-256 from OpenSSL 1.0 / 1.1 are used,
- AES-OCB and CHACHA20-POLY1305 from OpenSSL 1.1 are used,
which is also linked into the static binaries we provide.
We think this is not an additional risk, since we don't ever
use OpenSSL's networking, TLS or X.509 code, but only their
primitives implemented in libcrypto.
- SHA-256, SHA-512 and BLAKE2b from Python's hashlib_ standard library module are used.
Borg requires a Python built with OpenSSL support (due to PBKDF2), therefore
these functions are delegated to OpenSSL by Python.
- HMAC, PBKDF2 and a constant-time comparison from Python's hmac_ standard
library module is used. While the HMAC implementation is written in Python,
the PBKDF2 implementation is provided by OpenSSL. The constant-time comparison
(``compare_digest``) is written in C and part of Python.
Implemented cryptographic constructions are:
- Encrypt-then-MAC based on AES-256-CTR and either HMAC-SHA-256
or keyed BLAKE2b256 as described above under Encryption_.
- Encrypt-and-MAC based on AES-256-CTR and HMAC-SHA-256
as described above under `Offline key security`_.
- HKDF_-SHA-512
- HMAC and a constant-time comparison from Python's hmac_ standard library module are used.
- argon2 is used via argon2-cffi.
.. _Horton principle: https://en.wikipedia.org/wiki/Horton_Principle
.. _HKDF: https://tools.ietf.org/html/rfc5869
.. _length extension: https://en.wikipedia.org/wiki/Length_extension_attack
.. _hashlib: https://docs.python.org/3/library/hashlib.html
.. _hmac: https://docs.python.org/3/library/hmac.html
@ -303,7 +264,7 @@ SSH server -- Borg RPC does not contain *any* networking
code. Networking is done by the SSH client running in a separate
process, Borg only communicates over the standard pipes (stdout,
stderr and stdin) with this process. This also means that Borg doesn't
have to directly use a SSH client (or SSH at all). For example,
have to use a SSH client directly (or SSH at all). For example,
``sudo`` or ``qrexec`` could be used as an intermediary.
By using the system's SSH client and not implementing a
@ -380,13 +341,12 @@ Compression and Encryption
Combining encryption with compression can be insecure in some contexts (e.g. online protocols).
There was some discussion about this in `github issue #1040`_ and for Borg some developers
There was some discussion about this in :issue:`1040` and for Borg some developers
concluded this is no problem at all, some concluded this is hard and extremely slow to exploit
and thus no problem in practice.
No matter what, there is always the option not to use compression if you are worried about this.
.. _github issue #1040: https://github.com/borgbackup/borg/issues/1040
Fingerprinting
==============
@ -401,19 +361,25 @@ The chunks stored in the repo are the (compressed, encrypted and authenticated)
output of the chunker. The sizes of these stored chunks are influenced by the
compression, encryption and authentication.
buzhash chunker
+++++++++++++++
buzhash and buzhash64 chunker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The buzhash chunker chunks according to the input data, the chunker's
parameters and the secret chunker seed (which all influence the chunk boundary
The buzhash chunkers chunk according to the input data, the chunker's
parameters and secret key material (which all influence the chunk boundary
positions).
Secret key material:
- "buzhash": chunker seed (32bits), used for XORing the hardcoded buzhash table
- "buzhash64": bh64_key (256bits) is derived from ID key, used to cryptographically
generate the table.
Small files below some specific threshold (default: 512 KiB) result in only one
chunk (identical content / size as the original file), bigger files result in
multiple chunks.
fixed chunker
+++++++++++++
~~~~~~~~~~~~~
This chunker yields fixed sized chunks, with optional support of a differently
sized header chunk. The last chunk is not required to have the full block size
@ -445,6 +411,24 @@ To summarize, this is making size-based fingerprinting difficult:
- optional ``obfuscate`` pseudo compressor with different choices
of algorithm and parameters
Secret key usage against fingerprinting
---------------------------------------
Borg uses the borg key also for chunking and chunk ID generation to protect against fingerprinting.
As usual for borg's attack model, the attacker is assumed to have access to a borg repository.
The borg key includes a secret random chunk_seed which (together with the chunking algorithm)
determines the cutting places and thereby the length of the chunks cut. Because the attacker trying
a chunk length fingerprinting attack would use a different chunker secret than the borg setup being
attacked, they would not be able to determine the set of chunk lengths for a known set of files.
The borg key also includes a secret random id_key. The chunk ID generation is not just using a simple
cryptographic hash like sha256 (because that would be insecure as an attacker could see the hashes of
small files that result only in 1 chunk in the repository). Instead, borg uses keyed hash (a MAC,
e.g. HMAC-SHA256) to compute the chunk ID from the content and the secret id_key. Thus, an attacker
can't compute the same chunk IDs for a known set of small files to determine whether these are stored
in the attacked repository.
Stored chunk proximity
----------------------

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

View file

@ -1,8 +1,8 @@
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
.. 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

91
docs/man/borg-analyze.1 Normal file
View file

@ -0,0 +1,91 @@
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-ANALYZE" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-analyze \- Analyzes archives.
.SH SYNOPSIS
.sp
borg [common options] analyze [options]
.SH DESCRIPTION
.sp
Analyze archives to find \(dqhot spots\(dq.
.sp
\fBborg analyze\fP relies on the usual archive matching options to select the
archives that should be considered for analysis (e.g. \fB\-a series_name\fP).
Then it iterates over all matching archives, over all contained files, and
collects information about chunks stored in all directories it encounters.
.sp
It considers chunk IDs and their plaintext sizes (we do not have the compressed
size in the repository easily available) and adds up the sizes of added and removed
chunks per direct parent directory, and outputs a list of \(dqdirectory: size\(dq.
.sp
You can use that list to find directories with a lot of \(dqactivity\(dq — maybe
some of these are temporary or cache directories you forgot to exclude.
.sp
To avoid including these unwanted directories in your backups, you can carefully
exclude them in \fBborg create\fP (for future backups) or use \fBborg recreate\fP
to recreate existing archives without them.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS Archive filters
.INDENT 0.0
.TP
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
only consider archives matching all patterns. See \(dqborg help match\-archives\(dq.
.TP
.BI \-\-sort\-by \ KEYS
Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
.TP
.BI \-\-first \ N
consider the first N archives after other filters are applied
.TP
.BI \-\-last \ N
consider the last N archives after other filters are applied
.TP
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
consider archives older than (now \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g., 7d or 12m.
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.

View file

@ -1,8 +1,5 @@
.\" Man page generated from reStructuredText.
.
.TH BORG-CHANGE-PASSPHRASE 1 "2017-11-25" "" "borg backup tool"
.SH NAME
borg-change-passphrase \- Change repository key file passphrase
.
.nr rst2man-indent-level 0
.
@ -30,24 +27,27 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-BENCHMARK-CPU" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-benchmark-cpu \- Benchmark CPU-bound operations.
.SH SYNOPSIS
.sp
borg [common options] change\-passphrase [options] [REPOSITORY]
borg [common options] benchmark cpu [options]
.SH DESCRIPTION
.sp
The key files used for repository encryption are optionally passphrase
protected. This command can be used to change this passphrase.
This command benchmarks miscellaneous CPU\-bound Borg operations.
.sp
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.
It creates input data in memory, runs the operation and then displays throughput.
To reduce outside influence on the timings, please make sure to run this with:
.INDENT 0.0
.IP \(bu 2
an otherwise as idle as possible machine
.IP \(bu 2
enough free memory so there will be no slow down due to paging activity
.UNINDENT
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.sp
REPOSITORY
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP

View file

@ -27,31 +27,29 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-BENCHMARK-CRUD" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-BENCHMARK-CRUD" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-benchmark-crud \- Benchmark Create, Read, Update, Delete for archives.
.SH SYNOPSIS
.sp
borg [common options] benchmark crud [options] REPOSITORY PATH
borg [common options] benchmark crud [options] PATH
.SH DESCRIPTION
.sp
This command benchmarks borg CRUD (create, read, update, delete) operations.
.sp
It creates input data below the given PATH and backups this data into the given REPO.
It creates input data below the given PATH and backs up 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.
.sp
Make sure you have free space there, you\(aqll need about 1GB each (+ overhead).
Make sure you have free space there; you will need about 1 GB each (+ overhead).
.sp
If your repository is encrypted and borg needs a passphrase to unlock the key, use:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
BORG_PASSPHRASE=mysecret borg benchmark crud REPO PATH
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -88,11 +86,8 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY
repository to use for benchmark (must exist)
.TP
.B PATH
path were to create benchmark input data
path where to create benchmark input data
.UNINDENT
.SH SEE ALSO
.sp

View file

@ -27,12 +27,13 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-BENCHMARK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-BENCHMARK" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-benchmark \- benchmark command
.SH SYNOPSIS
.nf
borg [common options] benchmark crud ...
borg [common options] benchmark cpu ...
.fi
.sp
.SH DESCRIPTION
@ -40,7 +41,7 @@ borg [common options] benchmark crud ...
These commands do various benchmarks.
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-benchmark\-crud(1)\fP
\fIborg\-common(1)\fP, \fIborg\-benchmark\-crud(1)\fP, \fIborg\-benchmark\-cpu(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.

View file

@ -27,26 +27,20 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-BREAK-LOCK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-BREAK-LOCK" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-break-lock \- Break the repository lock (e.g. in case it was left by a dead borg.
borg-break-lock \- Breaks the repository lock (for example, if it was left by a dead Borg process).
.SH SYNOPSIS
.sp
borg [common options] break\-lock [options] [REPOSITORY]
borg [common options] break\-lock [options]
.SH DESCRIPTION
.sp
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.
Use with care and only when no Borg process (on any machine) is
trying to access the cache or the repository.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY
repository for which to break the locks
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP

View file

@ -27,116 +27,133 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-CHECK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-CHECK" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-check \- Check repository consistency
borg-check \- Checks repository consistency.
.SH SYNOPSIS
.sp
borg [common options] check [options] [REPOSITORY_OR_ARCHIVE]
borg [common options] check [options]
.SH DESCRIPTION
.sp
The check command verifies the consistency of a repository and the corresponding archives.
The check command verifies the consistency of a repository and its archives.
It consists of two major steps:
.INDENT 0.0
.IP 1. 3
Checking the consistency of the repository itself. This includes checking
the file magic headers, and both the metadata and data of all objects in
the repository. The read data is checked by size and hash. Bit rot and other
types of accidental damage can be detected this way. Running the repository
check can be split into multiple partial checks using \fB\-\-max\-duration\fP\&.
When checking an <ssh://> remote repository, please note that the checks run on
the server and do not cause significant network traffic.
.IP 2. 3
Checking consistency and correctness of the archive metadata and optionally
archive data (requires \fB\-\-verify\-data\fP). This includes ensuring that the
repository manifest exists, the archive metadata chunk is present, and that
all chunks referencing files (items) in the archive exist. This requires
reading archive and file metadata, but not data. To scan for archives whose
entries were lost from the archive directory, pass \fB\-\-find\-lost\-archives\fP\&.
It requires reading all data and is hence very time\-consuming.
To additionally cryptographically verify the file (content) data integrity,
pass \fB\-\-verify\-data\fP, which is even more time\-consuming.
.sp
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!
When checking archives of a remote repository, archive checks run on the client
machine because they require decrypting data and therefore the encryption key.
.UNINDENT
.sp
Both steps can also be run independently. Pass \fB\-\-repository\-only\fP to run the
repository checks only, or pass \fB\-\-archives\-only\fP to run the archive checks
only.
.sp
The \fB\-\-max\-duration\fP option can be used to split a long\-running repository
check into multiple partial checks. After the given number of seconds, the check
is interrupted. The next partial check will continue where the previous one
stopped, until the full repository has been checked. Assuming a complete check
would take 7 hours, then running a daily check with \fB\-\-max\-duration=3600\fP
(1 hour) would result in one full repository check per week. Doing a full
repository check aborts any previous partial check; the next partial check will
restart from the beginning. With partial repository checks you can run neither
archive checks, nor enable repair mode. Consequently, if you want to use
\fB\-\-max\-duration\fP you must also pass \fB\-\-repository\-only\fP, and must not pass
\fB\-\-archives\-only\fP, nor \fB\-\-repair\fP\&.
.sp
\fBWarning:\fP Please note that partial repository checks (i.e., running with
\fB\-\-max\-duration\fP) can only perform non\-cryptographic checksum checks on the
repository files. Enabling partial repository checks excludes archive checks
for the same reason. Therefore, partial checks may be useful only with very large
repositories where a full check would take too long.
.sp
The \fB\-\-verify\-data\fP option will perform a full integrity verification (as
opposed to checking just the xxh64) of data, which means reading the
data from the repository, decrypting and decompressing it. It is a complete
cryptographic verification and hence very time\-consuming, but will detect any
accidental and malicious corruption. Tamper\-resistance is only guaranteed for
encrypted repositories against attackers without access to the keys. You cannot
use \fB\-\-verify\-data\fP with \fB\-\-repository\-only\fP\&.
.sp
The \fB\-\-find\-lost\-archives\fP option will also scan the whole repository, but
tells Borg to search for lost archive metadata. If Borg encounters any archive
metadata that does not match an archive directory entry (including
soft\-deleted archives), it means that an entry was lost.
Unless \fBborg compact\fP is called, these archives can be fully restored with
\fB\-\-repair\fP\&. Please note that \fB\-\-find\-lost\-archives\fP must read a lot of
data from the repository and is thus very time\-consuming. You cannot use
\fB\-\-find\-lost\-archives\fP with \fB\-\-repository\-only\fP\&.
.SS About repair mode
.sp
The check command is a read\-only task by default. If any corruption is found,
Borg will report the issue and proceed with checking. To actually repair the
issues found, pass \fB\-\-repair\fP\&.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
\fB\-\-repair\fP is a \fBPOTENTIALLY DANGEROUS FEATURE\fP and might lead to data
loss! This does not just include data that was previously lost anyway, but
might include more data for kinds of corruption it is not capable of
dealing with. \fBBE VERY CAREFUL!\fP
.UNINDENT
.UNINDENT
.sp
Pursuant to the previous warning it is also highly recommended to test the
reliability of the hardware running this software with stress testing software
such as memory testers. Unreliable hardware can also lead to data loss especially
when this command is run in repair mode.
reliability of the hardware running Borg with stress testing software. This
especially includes storage and memory testers. Unreliable hardware might lead
to additional data loss.
.sp
First, the underlying repository data files are checked:
It is highly recommended to create a backup of your repository before running
in repair mode (i.e. running it with \fB\-\-repair\fP).
.sp
Repair mode will attempt to fix any corruptions found. Fixing corruptions does
not mean recovering lost data: Borg cannot magically restore data lost due to
e.g. a hardware failure. Repairing a repository means sacrificing some data
for the sake of the repository as a whole and the remaining data. Hence it is,
by definition, a potentially lossy task.
.sp
In practice, repair mode hooks into both the repository and archive checks:
.INDENT 0.0
.IP \(bu 2
For all segments, the segment magic header is checked.
.IP \(bu 2
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.
.IP \(bu 2
In repair mode, if an integrity error is detected in a segment, try to recover
as many objects from the segment as possible.
.IP \(bu 2
In repair mode, make sure that the index is consistent with the data stored in
the segments.
.IP \(bu 2
If checking a remote repo via \fBssh:\fP, the repo check is executed on the server
without causing significant network traffic.
.IP \(bu 2
The repository check can be skipped using the \fB\-\-archives\-only\fP option.
.IP \(bu 2
A repository check can be time consuming. Partial checks are possible with the
\fB\-\-max\-duration\fP option.
.IP 1. 3
When checking the repository\(aqs consistency, repair mode removes corrupted
objects from the repository after it did a 2nd try to read them correctly.
.IP 2. 3
When checking the consistency and correctness of archives, repair mode might
remove whole archives from the manifest if their archive metadata chunk is
corrupt or lost. Borg will also report files that reference missing chunks.
.UNINDENT
.sp
Second, the consistency and correctness of the archive metadata is verified:
.INDENT 0.0
.IP \(bu 2
Is the repo manifest present? If not, it is rebuilt from archive metadata
chunks (this requires reading and decrypting of all metadata and data).
.IP \(bu 2
Check if archive metadata chunk is present; if not, remove archive from manifest.
.IP \(bu 2
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.
.IP \(bu 2
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.
.IP \(bu 2
In verify\-data mode, a complete cryptographic verification of the archive data
integrity is performed. This conflicts with \fB\-\-repository\-only\fP as this mode
only makes sense if the archive checks are enabled. The full details of this mode
are documented below.
.IP \(bu 2
If checking a remote repo via \fBssh:\fP, 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.
.IP \(bu 2
The archive checks can be time consuming; they can be skipped using the
\fB\-\-repository\-only\fP option.
.UNINDENT
.sp
The \fB\-\-max\-duration\fP option can be used to split a long\-running repository check
into multiple partial checks. After the given number of seconds the check is
interrupted. The next partial check will continue where the previous one stopped,
until the complete repository has been checked. Example: Assuming a full check took 7
hours, then running a daily check with \-\-max\-duration=3600 (1 hour) resulted in one
full check per week.
.sp
Attention: Partial checks can only do way less checking than a full check (only the
CRC32 checks on segment file entries are done), and cannot be combined with the
\fB\-\-repair\fP option. Partial checks may therefore be useful only with very large
repositories where a full check took too long. Doing a full repository check aborts a
partial check; the next partial check will restart from the beginning.
.sp
The \fB\-\-verify\-data\fP 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.
If \fB\-\-repair \-\-find\-lost\-archives\fP is given, previously lost entries will
be recreated in the archive directory. This is only possible before
\fBborg compact\fP would remove the archives\(aq data completely.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY_OR_ARCHIVE
repository or archive to check consistency of
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-repository\-only
only perform repository checks
.TP
.B \-\-archives\-only
only perform archives checks
only perform archive checks
.TP
.B \-\-verify\-data
perform cryptographic archive data integrity verification (conflicts with \fB\-\-repository\-only\fP)
@ -144,29 +161,38 @@ perform cryptographic archive data integrity verification (conflicts with \fB\-\
.B \-\-repair
attempt to repair any inconsistencies found
.TP
.B \-\-save\-space
work slower, but using less space
.B \-\-find\-lost\-archives
attempt to find lost archives
.TP
.BI \-\-max\-duration \ SECONDS
do only a partial repo check for max. SECONDS seconds (Default: unlimited)
perform only a partial repository check for at most SECONDS seconds (default: unlimited)
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
.TP
.BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB\-\-prefix\fP and \fB\-\-glob\-archives\fP are mutually exclusive.
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
only consider archives matching all patterns. See \(dqborg help match\-archives\(dq.
.TP
.BI \-\-sort\-by \ KEYS
Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
consider the first N archives after other filters are applied
.TP
.BI \-\-last \ N
consider last N archives after other filters were applied
consider the last N archives after other filters are applied
.TP
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
consider archives older than (now \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g., 7d or 12m.
.UNINDENT
.SH SEE ALSO
.sp

View file

@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-COMMON" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-COMMON" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-common \- Common options of Borg commands
.SH SYNOPSIS
@ -64,10 +64,7 @@ format using IEC units (1KiB = 1024B)
Output one JSON object per log line instead of formatted text.
.TP
.BI \-\-lock\-wait \ SECONDS
wait at most SECONDS for acquiring a repository/cache lock (default: 1).
.TP
.B \-\-bypass\-lock
Bypass locking mechanism
wait at most SECONDS for acquiring a repository/cache lock (default: 10).
.TP
.B \-\-show\-version
show/log the borg version
@ -79,28 +76,25 @@ show/log the return code (rc)
set umask to M (local only, default: 0077)
.TP
.BI \-\-remote\-path \ PATH
use PATH as borg executable on the remote (default: "borg")
.TP
.BI \-\-remote\-ratelimit \ RATE
deprecated, use \fB\-\-upload\-ratelimit\fP instead
use PATH as borg executable on the remote (default: \(dqborg\(dq)
.TP
.BI \-\-upload\-ratelimit \ RATE
set network upload rate limit in kiByte/s (default: 0=unlimited)
.TP
.BI \-\-remote\-buffer \ UPLOAD_BUFFER
deprecated, use \fB\-\-upload\-buffer\fP instead
.TP
.BI \-\-upload\-buffer \ UPLOAD_BUFFER
set network upload buffer size in MiB. (default: 0=no buffer)
.TP
.B \-\-consider\-part\-files
treat part files like normal files (e.g. to list/extract them)
.TP
.BI \-\-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".
Write execution profile in Borg format into FILE. For local use a Python\-compatible file can be generated by suffixing FILE with \(dq.pyprof\(dq.
.TP
.BI \-\-rsh \ RSH
Use this command to connect to the \(aqborg serve\(aq process (default: \(aqssh\(aq)
.TP
.BI \-\-socket \ PATH
Use UNIX DOMAIN (IPC) socket at PATH for client/server communication with socket: protocol.
.TP
.BI \-r \ REPO\fR,\fB \ \-\-repo \ REPO
repository to use
.UNINDENT
.SH SEE ALSO
.sp

View file

@ -27,66 +27,77 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-COMPACT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-COMPACT" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-compact \- compact segment files in the repository
borg-compact \- Collects garbage in the repository.
.SH SYNOPSIS
.sp
borg [common options] compact [options] [REPOSITORY]
borg [common options] compact [options]
.SH DESCRIPTION
.sp
This command frees repository space by compacting segments.
Free repository space by deleting unused chunks.
.sp
Use this regularly to avoid running out of space \- you do not need to use this
after each borg command though. It is especially useful after deleting archives,
because only compaction will really free repository space.
\fBborg compact\fP analyzes all existing archives to determine which repository
objects are actually used (referenced). It then deletes all unused objects
from the repository to free space.
.sp
borg compact does not need a key, so it is possible to invoke it from the
client or also from the server.
Unused objects may result from:
.INDENT 0.0
.IP \(bu 2
use of \fBborg delete\fP or \fBborg prune\fP
.IP \(bu 2
interrupted backups (consider retrying the backup before running compact)
.IP \(bu 2
backups of source files that encountered an I/O error mid\-transfer and were skipped
.IP \(bu 2
corruption of the repository (e.g., the archives directory lost entries; see notes below)
.UNINDENT
.sp
Depending on the amount of segments that need compaction, it may take a while,
so consider using the \fB\-\-progress\fP option.
You usually do not want to run \fBborg compact\fP after every write operation, but
either regularly (e.g., once a month, possibly together with \fBborg check\fP) or
when disk space needs to be freed.
.sp
A segment is compacted if the amount of saved space is above the percentage value
given by the \fB\-\-threshold\fP option. If omitted, a threshold of 10% is used.
When using \fB\-\-verbose\fP, borg will output an estimate of the freed space.
\fBImportant:\fP
.sp
After upgrading borg (server) to 1.2+, you can use \fBborg compact \-\-cleanup\-commits\fP
to clean up the numerous 17byte commit\-only segments that borg 1.1 did not clean up
due to a bug. It is enough to do that once per repository.
After compacting, it is no longer possible to use \fBborg undelete\fP to recover
previously soft\-deleted archives.
.sp
See \fIseparate_compaction\fP in Additional Notes for more details.
\fBborg compact\fP might also delete data from archives that were \(dqlost\(dq due to
archives directory corruption. Such archives could potentially be restored with
\fBborg check \-\-find\-lost\-archives [\-\-repair]\fP, which is slow. You therefore
might not want to do that unless there are signs of lost archives (e.g., when
seeing fatal errors when creating backups or when archives are missing in
\fBborg repo\-list\fP).
.sp
When using the \fB\-\-stats\fP option, borg will internally list all repository
objects to determine their existence and stored size. It will build a fresh
chunks index from that information and cache it in the repository. For some
types of repositories, this might be very slow. It will tell you the sum of
stored object sizes, before and after compaction.
.sp
Without \fB\-\-stats\fP, borg will rely on the cached chunks index to determine
existing object IDs (but there is no stored size information in the index,
thus it cannot compute before/after compaction size statistics).
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.SS options
.INDENT 0.0
.TP
.B REPOSITORY
repository to compact
.UNINDENT
.SS optional arguments
.INDENT 0.0
.B \-n\fP,\fB \-\-dry\-run
do not change the repository
.TP
.B \-\-cleanup\-commits
cleanup commit\-only 17\-byte segment files
.TP
.BI \-\-threshold \ PERCENT
set minimum threshold for saved space in PERCENT (Default: 10)
.B \-s\fP,\fB \-\-stats
print statistics (might be much slower)
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# compact segments and free repo disk space
$ borg compact /path/to/repo
# same as above plus clean up 17byte commit\-only segments
$ borg compact \-\-cleanup\-commits /path/to/repo
.ft P
.fi
.EX
# Compact segments and free repository disk space
$ borg compact
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO

View file

@ -0,0 +1,76 @@
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-COMPLETION" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-completion \- Output shell completion script for the given shell.
.SH SYNOPSIS
.sp
borg [common options] completion [options] SHELL
.SH DESCRIPTION
.sp
This command prints a shell completion script for the given shell.
.sp
Please note that for some dynamic completions (like archive IDs), the shell
completion script will call borg to query the repository. This will work best
if that call can be made without prompting for user input, so you may want to
set BORG_REPO and BORG_PASSPHRASE environment variables.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B SHELL
shell to generate completion for (one of: %(choices)s)
.UNINDENT
.SH EXAMPLES
.sp
To activate completion in your current shell session, evaluate the output
of this command. To enable it persistently, add the corresponding line to
your shell\(aqs startup file.
.INDENT 0.0
.INDENT 3.5
.sp
.EX
# Bash (in ~/.bashrc)
eval \(dq$(borg completion bash)\(dq
# Zsh (in ~/.zshrc)
eval \(dq$(borg completion zsh)\(dq
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.

View file

@ -27,19 +27,19 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-COMPRESSION" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-COMPRESSION" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-compression \- Details regarding compression
.SH DESCRIPTION
.sp
It is no problem to mix different compression methods in one repo,
It is no problem to mix different compression methods in one repository,
deduplication is done on the source data chunks (not on the compressed
or encrypted data).
.sp
If some specific chunk was once compressed and stored into the repo, creating
If some specific chunk was once compressed and stored into the repository, 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.
chunk first determines its compression. See also \fBborg recreate\fP\&.
.sp
Compression is lz4 by default. If you want something else, you have to specify what you want.
.sp
@ -53,20 +53,19 @@ Do not compress.
Use lz4 compression. Very high speed, very low compression. (default)
.TP
.B zstd[,L]
Use zstd ("zstandard") compression, a modern wide\-range algorithm.
Use zstd (\(dqzstandard\(dq) compression, a modern wide\-range algorithm.
If you do not explicitly 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.
.TP
.B zlib[,L]
Use zlib ("gz") compression. Medium speed, medium compression.
Use zlib (\(dqgz\(dq) compression. Medium speed, medium compression.
If you do not explicitly 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.
Giving level 0 (means \(dqno compression\(dq, but still has zlib protocol
overhead) is usually pointless, you better use \(dqnone\(dq compression.
.TP
.B lzma[,L]
Use lzma ("xz") compression. Low speed, high compression.
Use lzma (\(dqxz\(dq) compression. Low speed, high compression.
If you do not explicitly 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
@ -76,55 +75,103 @@ lots of CPU cycles and RAM.
.B 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 incompressible data, it will not use compression (uses \(dqnone\(dq).
For compressible data, it uses the given C[,L] compression \- with C[,L]
being any valid compression specifier.
being any valid compression specifier. This can be helpful for media files
which often cannot be compressed much more.
.TP
.B obfuscate,SPEC,C[,L]
Use compressed\-size obfuscation to make fingerprinting attacks based on
the observable stored chunk size more difficult.
Note:
\- you must combine this with encryption or it won\(aqt make any sense.
\- your repo size will be bigger, of course.
the observable stored chunk size more difficult. Note:
.INDENT 7.0
.IP \(bu 2
You must combine this with encryption, or it won\(aqt make any sense.
.IP \(bu 2
Your repo size will be bigger, of course.
.IP \(bu 2
A chunk is limited by the constant \fBMAX_DATA_SIZE\fP (cur. ~20MiB).
.UNINDENT
.sp
The SPEC value will determine how the size obfuscation will work:
The SPEC value determines how the size obfuscation works:
.sp
\fIRelative random reciprocal size variation\fP (multiplicative)
.sp
Relative random reciprocal size variation:
Size will increase by a factor, relative to the compressed data size.
Smaller factors are often used, larger factors rarely.
1: factor 0.01 .. 100.0
2: factor 0.1 .. 1000.0
3: factor 1.0 .. 10000.0
4: factor 10.0 .. 100000.0
5: factor 100.0 .. 1000000.0
6: factor 1000.0 .. 10000000.0
Smaller factors are used often, larger factors rarely.
.sp
Add a randomly sized padding up to the given size:
110: 1kiB
Available factors:
.INDENT 7.0
.INDENT 3.5
.sp
.EX
1: 0.01 .. 100
2: 0.1 .. 1,000
3: 1 .. 10,000
4: 10 .. 100,000
5: 100 .. 1,000,000
6: 1,000 .. 10,000,000
.EE
.UNINDENT
.UNINDENT
.sp
Example probabilities for SPEC \fB1\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.EX
90 % 0.01 .. 0.1
9 % 0.1 .. 1
0.9 % 1 .. 10
0.09% 10 .. 100
.EE
.UNINDENT
.UNINDENT
.sp
\fIRandomly sized padding up to the given size\fP (additive)
.INDENT 7.0
.INDENT 3.5
.sp
.EX
110: 1kiB (2 ^ (SPEC \- 100))
\&...
120: 1MiB
\&...
123: 8MiB (max.)
.EE
.UNINDENT
.UNINDENT
.sp
\fIPadmé padding\fP (deterministic)
.INDENT 7.0
.INDENT 3.5
.sp
.EX
250: pads to sums of powers of 2, max 12% overhead
.EE
.UNINDENT
.UNINDENT
.sp
Uses the Padmé algorithm to deterministically pad the compressed size to a sum of
powers of 2, limiting overhead to 12%. See <https://lbarman.ch/blog/padme/> for details.
.UNINDENT
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
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
.EX
borg create \-\-compression lz4 \-\-repo REPO ARCHIVE data
borg create \-\-compression zstd \-\-repo REPO ARCHIVE data
borg create \-\-compression zstd,10 \-\-repo REPO ARCHIVE data
borg create \-\-compression zlib \-\-repo REPO ARCHIVE data
borg create \-\-compression zlib,1 \-\-repo REPO ARCHIVE data
borg create \-\-compression auto,lzma,6 \-\-repo REPO ARCHIVE data
borg create \-\-compression auto,lzma ...
borg create \-\-compression obfuscate,3,none ...
borg create \-\-compression obfuscate,110,none ...
borg create \-\-compression obfuscate,3,auto,zstd,10 ...
borg create \-\-compression obfuscate,2,zstd,6 ...
.ft P
.fi
borg create \-\-compression obfuscate,250,zstd,3 ...
.EE
.UNINDENT
.UNINDENT
.SH AUTHOR

View file

@ -27,22 +27,22 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-CONFIG" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-CONFIG" 1 "2024-07-19" "" "borg backup tool"
.SH NAME
borg-config \- get, set, and delete values in a repository or cache config file
.SH SYNOPSIS
.sp
borg [common options] config [options] [REPOSITORY] [NAME] [VALUE]
borg [common options] config [options] [NAME] [VALUE]
.SH DESCRIPTION
.sp
This command gets and sets options in a local repository or cache config file.
For security reasons, this command only works on local repositories.
.sp
To delete a config value entirely, use \fB\-\-delete\fP\&. To list the values
of the configuration file or the default values, use \fB\-\-list\fP\&. To get and existing
of the configuration file or the default values, use \fB\-\-list\fP\&. To get an 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 new value. Keys can be specified in the format \(dqsection.name\(dq or
simply \(dqname\(dq; the section will default to \(dqrepository\(dq and \(dqcache\(dq for
the repo and cache configs, respectively.
.sp
By default, borg config manipulates the repository config file. Using \fB\-\-cache\fP
@ -53,9 +53,6 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY
repository to configure
.TP
.B NAME
name of config key
.TP
@ -90,13 +87,13 @@ making changes!
.nf
.ft C
# find cache directory
$ cd ~/.cache/borg/$(borg config /path/to/repo id)
$ cd ~/.cache/borg/$(borg config id)
# reserve some space
$ borg config /path/to/repo additional_free_space 2G
$ borg config additional_free_space 2G
# make a repo append\-only
$ borg config /path/to/repo append_only 1
$ borg config append_only 1
.ft P
.fi
.UNINDENT

View file

@ -27,36 +27,41 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-CREATE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-CREATE" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-create \- Create new archive
borg-create \- Creates a new archive.
.SH SYNOPSIS
.sp
borg [common options] create [options] ARCHIVE [PATH...]
borg [common options] create [options] NAME [PATH...]
.SH DESCRIPTION
.sp
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
traversing all specified paths. Paths are added to the archive as they are given,
which means that if relative paths are desired, the command must be run from the correct
directory.
.sp
When giving \(aq\-\(aq as path, borg will read data from standard input and create a
file \(aqstdin\(aq in the created archive from that data. In some cases it\(aqs more
appropriate to use \-\-content\-from\-command, however. See section \fIReading from
stdin\fP below for details.
The slashdot hack in paths (recursion roots) is triggered by using \fB/./\fP:
\fB/this/gets/stripped/./this/gets/archived\fP means to process that fs object, but
strip the prefix on the left side of \fB\&./\fP from the archived items (in this case,
\fBthis/gets/archived\fP will be the path in the archived item).
.sp
When specifying \(aq\-\(aq as a path, borg will read data from standard input and create a
file named \(aqstdin\(aq in the created archive from that data. In some cases, it is more
appropriate to use \-\-content\-from\-command. See the section \fIReading from stdin\fP
below for details.
.sp
The archive will consume almost no disk space for files or parts of files that
have already been stored in other archives.
.sp
The archive name needs to be unique. It must not end in \(aq.checkpoint\(aq or
\(aq.checkpoint.N\(aq (with N being a number), because these names are used for
checkpoints and treated in special ways.
The archive name does not need to be unique; you can and should use the same
name for a series of archives. The unique archive identifier is its ID (hash),
and you can abbreviate the ID as long as it is unique.
.sp
In the archive name, you may use the following placeholders:
{now}, {utcnow}, {fqdn}, {hostname}, {user} and some others.
.sp
Backup speed is increased by not reprocessing files that are already part of
existing archives and weren\(aqt modified. The detection of unmodified files is
existing archives and were not modified. The detection of unmodified files is
done by comparing multiple file metadata values with previous values kept in
the files cache.
.sp
@ -91,15 +96,29 @@ ctime vs. mtime: safety vs. speed
.INDENT 0.0
.IP \(bu 2
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
as it cannot 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.
.IP \(bu 2
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
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.
well\-meant, but in both cases mtime\-based cache modes can be problematic.
.UNINDENT
.INDENT 0.0
.TP
.B The \fB\-\-files\-changed\fP option controls how Borg detects if a file has changed during backup:
.INDENT 7.0
.IP \(bu 2
ctime (default): Use ctime to detect changes. This is the safest option.
.IP \(bu 2
mtime: Use mtime to detect changes.
.IP \(bu 2
disabled: Disable the \(dqfile has changed while we backed it up\(dq detection completely.
This is not recommended unless you know what you\(aqre doing, as it could lead to
inconsistent backups if files change during the backup process.
.UNINDENT
.UNINDENT
.sp
The mount points of filesystems or filesystem snapshots should be the same for every
@ -107,13 +126,13 @@ creation of a new archive to ensure fast operation. This is because the file cac
is used to determine changed files quickly uses absolute filenames.
If this is not possible, consider creating a bind mount to a stable location.
.sp
The \fB\-\-progress\fP 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.
The \fB\-\-progress\fP option shows (from left to right) Original and (uncompressed)
deduplicated size (O and U respectively), then the Number of files (N) processed so far,
followed by the currently processed path.
.sp
When using \fB\-\-stats\fP, 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
added \- the \(dqThis Archive\(dq deduplicated size there is most interesting as that is
how much your repository will grow. Please note that the \(dqAll archives\(dq stats refer to
the state after creation. Also, the \fB\-\-stats\fP and \fB\-\-dry\-run\fP options are mutually
exclusive because the data is not actually compressed and deduplicated during a dry run.
.sp
@ -126,13 +145,13 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B ARCHIVE
name of archive to create (must be also a valid directory name)
.B NAME
specify the archive name
.TP
.B PATH
paths to archive
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
@ -142,7 +161,7 @@ do not create a backup archive
print statistics for the created archive
.TP
.B \-\-list
output verbose list of items (files, dirs, ...)
output a verbose list of items (files, dirs, ...)
.TP
.BI \-\-filter \ STATUSCHARS
only display items with the given status characters (see description)
@ -150,34 +169,31 @@ only display items with the given status characters (see description)
.B \-\-json
output stats as JSON. Implies \fB\-\-stats\fP\&.
.TP
.B \-\-no\-cache\-sync
experimental: do not synchronize the cache. Implies not using the files cache.
.TP
.BI \-\-stdin\-name \ NAME
use NAME in archive for stdin data (default: \(aqstdin\(aq)
.TP
.BI \-\-stdin\-user \ USER
set user USER in archive for stdin data (default: \(aqroot\(aq)
set user USER in archive for stdin data (default: do not store user/uid)
.TP
.BI \-\-stdin\-group \ GROUP
set group GROUP in archive for stdin data (default: \(aqwheel\(aq)
set group GROUP in archive for stdin data (default: do not store group/gid)
.TP
.BI \-\-stdin\-mode \ M
set mode to M in archive for stdin data (default: 0660)
.TP
.B \-\-content\-from\-command
interpret PATH as command and store its stdout. See also section Reading from stdin below.
interpret PATH as a command and store its stdout. See also the section \(aqReading from stdin\(aq below.
.TP
.B \-\-paths\-from\-stdin
read DELIM\-separated list of paths to backup from stdin. Will not recurse into directories.
read DELIM\-separated list of paths to back up from stdin. All control is external: it will back up all files given \- no more, no less.
.TP
.B \-\-paths\-from\-command
interpret PATH as command and treat its output as \fB\-\-paths\-from\-stdin\fP
.TP
.BI \-\-paths\-delimiter \ DELIM
set path delimiter for \fB\-\-paths\-from\-stdin\fP and \fB\-\-paths\-from\-command\fP (default: n)
set path delimiter for \fB\-\-paths\-from\-stdin\fP and \fB\-\-paths\-from\-command\fP (default: \fB\en\fP)
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -193,32 +209,23 @@ include/exclude paths matching PATTERN
read include/exclude patterns from PATTERNFILE, one per line
.TP
.B \-\-exclude\-caches
exclude directories that contain a CACHEDIR.TAG file (\fI\%http://www.bford.info/cachedir/spec.html\fP)
exclude directories that contain a CACHEDIR.TAG file ( <http://www.bford.info/cachedir/spec.html> )
.TP
.BI \-\-exclude\-if\-present \ NAME
exclude directories that are tagged by containing a filesystem object with the given NAME
.TP
.B \-\-keep\-exclude\-tags
if tag objects are specified with \fB\-\-exclude\-if\-present\fP, don\(aqt omit the tag objects themselves from the backup archive
.TP
.B \-\-exclude\-nodump
exclude files flagged NODUMP
if tag objects are specified with \fB\-\-exclude\-if\-present\fP, do not omit the tag objects themselves from the backup archive
.UNINDENT
.SS Filesystem options
.INDENT 0.0
.TP
.B \-x\fP,\fB \-\-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.
.TP
.B \-\-numeric\-owner
deprecated, use \fB\-\-numeric\-ids\fP instead
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 description below.
.TP
.B \-\-numeric\-ids
only store numeric user and group identifiers
.TP
.B \-\-noatime
do not store atime into archive
.TP
.B \-\-atime
do store atime into archive
.TP
@ -228,9 +235,6 @@ do not store ctime into archive
.B \-\-nobirthtime
do not store birthtime (creation date) into archive
.TP
.B \-\-nobsdflags
deprecated, use \fB\-\-noflags\fP instead
.TP
.B \-\-noflags
do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive
.TP
@ -246,6 +250,9 @@ detect sparse holes in input (supported only by fixed chunker)
.BI \-\-files\-cache \ MODE
operate files cache in MODE. default: ctime,size,inode
.TP
.BI \-\-files\-changed \ MODE
specify how to detect if a file has changed during backup (ctime, mtime, disabled). default: ctime
.TP
.B \-\-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.
.UNINDENT
@ -256,106 +263,113 @@ open and read block and char device files as well as FIFOs as if they were regul
add a comment text to the archive
.TP
.BI \-\-timestamp \ TIMESTAMP
manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). Alternatively, give a reference file/directory.
.TP
.BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
write checkpoint every SECONDS seconds (Default: 1800)
manually specify the archive creation date/time (yyyy\-mm\-ddThh:mm:ss[(+|\-)HH:MM] format, (+|\-)HH:MM is the UTC offset, default: local time zone). Alternatively, give a reference file/directory.
.TP
.BI \-\-chunker\-params \ PARAMS
specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095
.TP
.BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
select compression algorithm, see the output of the "borg help compression" command for details.
select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
.UNINDENT
.SH EXAMPLES
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Archive series and performance: In Borg 2, archives that share the same NAME form an \(dqarchive series\(dq.
The files cache is maintained per series. For best performance on repeated backups, reuse the same
NAME every time you run \fBborg create\fP for the same dataset (e.g. always use \fBmy\-documents\fP).
Frequently changing the NAME (for example by embedding date/time like \fBmy\-documents\-2025\-11\-10\fP)
prevents cache reuse and forces Borg to re\-scan and re\-chunk files, which can make incremental
backups vastly slower. Only vary the NAME if you intentionally want to start a new series.
.sp
If you must vary the archive name but still want cache reuse across names, see the advanced
knobs described in \fIupgradenotes2\fP (\fBBORG_FILES_CACHE_SUFFIX\fP and \fBBORG_FILES_CACHE_TTL\fP),
but the recommended approach is to keep a stable NAME per series.
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# Backup ~/Documents into an archive named "my\-documents"
$ borg create /path/to/repo::my\-documents ~/Documents
.EX
# Backup ~/Documents into an archive named \(dqmy\-documents\(dq
$ borg create my\-documents ~/Documents
# same, but list all files as we process them
$ borg create \-\-list /path/to/repo::my\-documents ~/Documents
$ borg create \-\-list my\-documents ~/Documents
# Backup /mnt/disk/docs, but strip path prefix using the slashdot hack
$ borg create \-\-repo /path/to/repo docs /mnt/disk/./docs
# Backup ~/Documents and ~/src but exclude pyc files
$ borg create /path/to/repo::my\-files \e
$ borg create my\-files \e
~/Documents \e
~/src \e
\-\-exclude \(aq*.pyc\(aq
# Backup home directories excluding image thumbnails (i.e. only
# /home/<one directory>/.thumbnails is excluded, not /home/*/*/.thumbnails etc.)
$ borg create /path/to/repo::my\-files /home \e
\-\-exclude \(aqsh:/home/*/.thumbnails\(aq
$ borg create my\-files /home \-\-exclude \(aqsh:home/*/.thumbnails\(aq
# 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} /
# Back up the root filesystem into an archive named \(dqroot\-archive\(dq
# Use zlib compression (good, but slow) — default is LZ4 (fast, low compression ratio)
$ borg create \-C zlib,6 \-\-one\-file\-system root\-archive /
# Backup onto a remote host ("push" style) via ssh to port 2222,
# logging in as user "borg" and storing into /path/to/repo
$ borg create ssh://borg@backup.example.org:2222/path/to/repo::{fqdn}\-root\-{now} /
# Backup into an archive name like FQDN\-root
$ borg create \(aq{fqdn}\-root\(aq /
# Backup a remote host locally ("pull" style) using sshfs
# Back up a remote host locally (\(dqpull\(dq 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} .
$ borg create example.com\-root .
$ 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 buzhash,10,23,16,4095 /path/to/repo::small /smallstuff
# Make a big effort in fine\-grained deduplication (big chunk management
# overhead, needs a lot of RAM and disk space; see the formula in the internals docs):
$ borg create \-\-chunker\-params buzhash,10,23,16,4095 small /smallstuff
# Backup a raw device (must not be active/in use/mounted at that time)
$ borg create \-\-read\-special \-\-chunker\-params fixed,4194304 /path/to/repo::my\-sdx /dev/sdX
$ borg create \-\-read\-special \-\-chunker\-params fixed,4194304 my\-sdx /dev/sdX
# Backup a sparse disk image (must not be active/in use/mounted at that time)
$ borg create \-\-sparse \-\-chunker\-params fixed,4194304 /path/to/repo::my\-disk my\-disk.raw
$ borg create \-\-sparse \-\-chunker\-params fixed,4194304 my\-disk my\-disk.raw
# No compression (none)
$ borg create \-\-compression none /path/to/repo::arch ~
$ borg create \-\-compression none arch ~
# Super fast, low compression (lz4, default)
$ borg create /path/to/repo::arch ~
$ borg create arch ~
# Less fast, higher compression (zlib, N = 0..9)
$ borg create \-\-compression zlib,N /path/to/repo::arch ~
$ borg create \-\-compression zlib,N arch ~
# Even slower, even higher compression (lzma, N = 0..9)
$ borg create \-\-compression lzma,N /path/to/repo::arch ~
$ borg create \-\-compression lzma,N arch ~
# Only compress compressible data with lzma,N (N = 0..9)
$ borg create \-\-compression auto,lzma,N /path/to/repo::arch ~
$ borg create \-\-compression auto,lzma,N 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} ~
# Use the short hostname and username as the archive name
$ borg create \(aq{hostname}\-{user}\(aq ~
# Backing up relative paths by moving into the correct directory first
# Back 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
# The root directory of the archive will be \(dqprojectA\(dq
$ borg create \(aqdaily\-projectA\(aq projectA
# Use external command to determine files to archive
# Use \-\-paths\-from\-stdin with find to only backup files less than 1MB in size
$ find ~ \-size \-1000k | borg create \-\-paths\-from\-stdin /path/to/repo::small\-files\-only
# Use \-\-paths\-from\-command with find to only backup files from a given user
$ borg create \-\-paths\-from\-command /path/to/repo::joes\-files \-\- find /srv/samba/shared \-user joe
# Use \-\-paths\-from\-stdin with find to back up only files less than 1 MB in size
$ find ~ \-size \-1000k | borg create \-\-paths\-from\-stdin small\-files\-only
# Use \-\-paths\-from\-command with find to back up files from only a given user
$ borg create \-\-paths\-from\-command joes\-files \-\- find /srv/samba/shared \-user joe
# Use \-\-paths\-from\-stdin with \-\-paths\-delimiter (for example, for filenames with newlines in them)
$ find ~ \-size \-1000k \-print0 | borg create \e
\-\-paths\-from\-stdin \e
\-\-paths\-delimiter "\e0" \e
/path/to/repo::smallfiles\-handle\-newline
.ft P
.fi
\-\-paths\-delimiter \(dq\e0\(dq \e
smallfiles\-handle\-newline
.EE
.UNINDENT
.UNINDENT
.SH NOTES
@ -376,13 +390,13 @@ through using the \fB\-\-keep\-exclude\-tags\fP option.
The \fB\-x\fP or \fB\-\-one\-file\-system\fP option excludes directories, that are mountpoints (and everything in them).
It detects mountpoints by comparing the device number from the output of \fBstat()\fP of the directory and its
parent directory. Specifically, it excludes directories for which \fBstat()\fP 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 \fB\-\-one\-file\-system\fP, 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.
from the device number of their parent.
In general: be aware that there are directories with device number different from their parent, which the kernel
does not consider a mountpoint and also the other way around.
Linux examples for this 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).
macOS examples are the apfs mounts of a typical macOS installation.
Therefore, when using \fB\-\-one\-file\-system\fP, you should double\-check that the backup works as intended.
.SS Item flags
.sp
\fB\-\-list\fP outputs a list of all files, directories and other
@ -395,7 +409,7 @@ If you are interested only in a subset of that output, you can give e.g.
below).
.sp
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
\(dqfiles\(dq 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 \(aqA\(aq and \(aqM\(aq also new data
chunks are stored. For \(aqU\(aq all data chunks refer to already existing chunks.
.INDENT 0.0
@ -421,7 +435,7 @@ borg usually just stores their metadata:
.IP \(bu 2
\(aqc\(aq = char device
.IP \(bu 2
\(aqh\(aq = regular file, hardlink (to already seen inodes)
\(aqh\(aq = regular file, hard link (to already seen inodes)
.IP \(bu 2
\(aqs\(aq = symlink
.IP \(bu 2
@ -431,26 +445,24 @@ borg usually just stores their metadata:
Other flags used include:
.INDENT 0.0
.IP \(bu 2
\(aq+\(aq = included, item would be backed up (if not in dry\-run mode)
.IP \(bu 2
\(aq\-\(aq = excluded, item would not be / was not backed up
.IP \(bu 2
\(aqi\(aq = backup data was read from standard input (stdin)
.IP \(bu 2
\(aq\-\(aq = dry run, item was \fInot\fP backed up
.IP \(bu 2
\(aqx\(aq = excluded, item was \fInot\fP backed up
.IP \(bu 2
\(aq?\(aq = missing status code (if you see this, please file a bug report!)
.UNINDENT
.SS Reading from stdin
.SS Reading backup data from stdin
.sp
There are two methods to read from stdin. Either specify \fB\-\fP as path and
pipe directly to borg:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
backup\-vm \-\-id myvm \-\-stdout | borg create REPO::ARCHIVE \-
.ft P
.fi
.EX
backup\-vm \-\-id myvm \-\-stdout | borg create \-\-repo REPO ARCHIVE \-
.EE
.UNINDENT
.UNINDENT
.sp
@ -461,11 +473,9 @@ to the command:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg create \-\-content\-from\-command REPO::ARCHIVE \-\- backup\-vm \-\-id myvm \-\-stdout
.ft P
.fi
.EX
borg create \-\-content\-from\-command \-\-repo REPO ARCHIVE \-\- backup\-vm \-\-id myvm \-\-stdout
.EE
.UNINDENT
.UNINDENT
.sp
@ -486,9 +496,22 @@ creation a bit.
.sp
By default, the content read from stdin is stored in a file called \(aqstdin\(aq.
Use \fB\-\-stdin\-name\fP to change the name.
.SS Feeding all file paths from externally
.sp
Usually, you give a starting path (recursion root) to borg and then borg
automatically recurses, finds and backs up all fs objects contained in
there (optionally considering include/exclude rules).
.sp
If you need more control and you want to give every single fs object path
to borg (maybe implementing your own recursion or your own rules), you can use
\fB\-\-paths\-from\-stdin\fP or \fB\-\-paths\-from\-command\fP (with the latter, borg will
fail to create an archive should the command fail).
.sp
Borg supports paths with the slashdot hack to strip path prefixes here also.
So, be careful not to unintentionally trigger that.
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-check(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP
\fIborg\-common(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-check(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP, \fIborg\-repo\-create(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.

View file

@ -27,128 +27,103 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-DELETE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-DELETE" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-delete \- Delete an existing repository or archives
borg-delete \- Deletes archives.
.SH SYNOPSIS
.sp
borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE] [ARCHIVE...]
borg [common options] delete [options] [NAME]
.SH DESCRIPTION
.sp
This command deletes an archive from the repository or the complete repository.
This command soft\-deletes archives from the repository.
.sp
Important: When deleting archives, repository disk space is \fBnot\fP freed until
Important:
.INDENT 0.0
.IP \(bu 2
The delete command will only mark archives for deletion (\(dqsoft\-deletion\(dq),
repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&.
.IP \(bu 2
You can use \fBborg undelete\fP to undelete archives, but only until
you run \fBborg compact\fP\&.
.sp
When you delete a complete repository, the security info and local cache for it
(if any) are also deleted. Alternatively, you can delete just the local cache
with the \fB\-\-cache\-only\fP option, or keep the security info with the
\fB\-\-keep\-security\-info\fP option.
.UNINDENT
.sp
When in doubt, use \fB\-\-dry\-run \-\-list\fP to see what would be deleted.
.sp
When using \fB\-\-stats\fP, 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.
.sp
You can delete multiple archives by specifying their common prefix, if they
have one, using the \fB\-\-prefix PREFIX\fP option. You can also specify a shell
pattern to match multiple archives using the \fB\-\-glob\-archives GLOB\fP option
(for more info on these patterns, see \fIborg_patterns\fP). Note that these
two options are mutually exclusive.
.sp
To avoid accidentally deleting archives, especially when using glob patterns,
it might be helpful to use the \fB\-\-dry\-run\fP to test out the command without
actually making any changes to the repository.
You can delete multiple archives by specifying a match pattern using
the \fB\-\-match\-archives PATTERN\fP option (for more information on these
patterns, see \fIborg_patterns\fP).
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY_OR_ARCHIVE
repository or archive to delete
.TP
.B ARCHIVE
archives to delete
.B NAME
specify the archive name
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
do not change repository
do not change the repository
.TP
.B \-\-list
output verbose list of archives
.TP
.B \-s\fP,\fB \-\-stats
print statistics for the deleted archive
.TP
.B \-\-cache\-only
delete only the local cache for the given repository
.TP
.B \-\-force
force deletion of corrupted archives, use \fB\-\-force \-\-force\fP in case \fB\-\-force\fP does not work.
.TP
.B \-\-keep\-security\-info
keep the local security info when deleting a repository
.TP
.B \-\-save\-space
work slower, but using less space
output a verbose list of archives
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
.TP
.BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB\-\-prefix\fP and \fB\-\-glob\-archives\fP are mutually exclusive.
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
only consider archives matching all patterns. See \(dqborg help match\-archives\(dq.
.TP
.BI \-\-sort\-by \ KEYS
Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
consider the first N archives after other filters are applied
.TP
.BI \-\-last \ N
consider last N archives after other filters were applied
consider the last N archives after other filters are applied
.TP
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
consider archives older than (now \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g., 7d or 12m.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# delete a single backup archive:
$ borg delete /path/to/repo::Monday
# actually free disk space:
$ borg compact /path/to/repo
.EX
# Delete all backup archives named \(dqkenny\-files\(dq:
$ borg delete \-a kenny\-files
# Actually free disk space:
$ borg compact
# delete all archives whose names begin with the machine\(aqs hostname followed by "\-"
$ borg delete \-\-prefix \(aq{hostname}\-\(aq /path/to/repo
# Delete a specific backup archive using its unique archive ID prefix
$ borg delete aid:d34db33f
# delete all archives whose names contain "\-2012\-"
$ borg delete \-\-glob\-archives \(aq*\-2012\-*\(aq /path/to/repo
# Delete all archives whose names begin with the machine\(aqs hostname followed by \(dq\-\(dq
$ borg delete \-a \(aqsh:{hostname}\-*\(aq
# see what would be deleted if delete was run without \-\-dry\-run
$ borg delete \-\-list \-\-dry\-run \-a \(aq*\-May\-*\(aq /path/to/repo
# Delete all archives whose names contain \(dq\-2012\-\(dq
$ borg delete \-a \(aqsh:*\-2012\-*\(aq
# 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 \(aqYES\(aq if you understand this and want to continue: YES
.ft P
.fi
# See what would be deleted if delete was run without \-\-dry\-run
$ borg delete \-\-list \-\-dry\-run \-a \(aqsh:*\-May\-*\(aq
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-compact(1)\fP
\fIborg\-common(1)\fP, \fIborg\-compact(1)\fP, \fIborg\-repo\-delete(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.

View file

@ -27,64 +27,54 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-DIFF" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-DIFF" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-diff \- Diff contents of two archives
borg-diff \- Finds differences between two archives.
.SH SYNOPSIS
.sp
borg [common options] diff [options] REPO::ARCHIVE1 ARCHIVE2 [PATH...]
borg [common options] diff [options] ARCHIVE1 ARCHIVE2 [PATH...]
.SH DESCRIPTION
.sp
This command finds differences (file contents, user/group/mode) between archives.
This command finds differences (file contents, metadata) between ARCHIVE1 and ARCHIVE2.
.sp
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).
.sp
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.
.sp
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 \fB\-\-same\-chunker\-params\fP\&.
Note that the chunker params changed from Borg 0.xx to 1.0.
.sp
For more help on include/exclude patterns, see the \fIborg_patterns\fP command output.
For more help on include/exclude patterns, see the output of the \fIborg_patterns\fP command.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPO::ARCHIVE1
repository location and ARCHIVE1 name
.B ARCHIVE1
ARCHIVE1 name
.TP
.B ARCHIVE2
ARCHIVE2 name (no repository location allowed)
ARCHIVE2 name
.TP
.B PATH
paths of items inside the archives to compare; patterns are supported
paths of items inside the archives to compare; patterns are supported.
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-numeric\-owner
deprecated, use \fB\-\-numeric\-ids\fP instead
.TP
.B \-\-numeric\-ids
only consider numeric user and group identifiers
.TP
.B \-\-same\-chunker\-params
Override check of chunker parameters.
override the check of chunker parameters
.TP
.B \-\-sort
Sort the output lines by file path.
.BI \-\-format \ FORMAT
specify format for differences between archives (default: \(dq{change} {path}{NL}\(dq)
.TP
.B \-\-json\-lines
Format output as JSON Lines.
.TP
.B \-\-sort\-by
Sort output by comma\-separated fields (e.g., \(aq>size_added,path\(aq).
.TP
.B \-\-content\-only
Only compare differences in content (exclude metadata differences)
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -103,50 +93,174 @@ read include/exclude patterns from PATTERNFILE, one per line
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ 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 .
$ echo "testing 123" >> file1
$ 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
+17 B \-5 B file1
added 0 B file4
removed 0 B file3
$ borg diff testrepo::archive1 archive3
.EX
$ borg diff archive1 archive2
+17 B \-5 B [\-rw\-r\-\-r\-\- \-> \-rwxr\-xr\-x] file1
+135 B \-252 B file2
added 0 B file4
removed 0 B file3
$ borg diff \-\-json\-lines testrepo::archive1 archive3
{"path": "file1", "changes": [{"type": "modified", "added": 17, "removed": 5}, {"type": "mode", "old_mode": "\-rw\-r\-\-r\-\-", "new_mode": "\-rwxr\-xr\-x"}]}
{"path": "file2", "changes": [{"type": "modified", "added": 135, "removed": 252}]}
{"path": "file4", "changes": [{"type": "added", "size": 0}]}
{"path": "file3", "changes": [{"type": "removed", "size": 0}]
.ft P
.fi
$ borg diff archive1 archive2
{\(dqpath\(dq: \(dqfile1\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: 17, \(dqremoved\(dq: 5}, {\(dqtype\(dq: \(dqmode\(dq, \(dqold_mode\(dq: \(dq\-rw\-r\-\-r\-\-\(dq, \(dqnew_mode\(dq: \(dq\-rwxr\-xr\-x\(dq}]}
{\(dqpath\(dq: \(dqfile2\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: 135, \(dqremoved\(dq: 252}]}
{\(dqpath\(dq: \(dqfile4\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqadded\(dq, \(dqsize\(dq: 0}]}
{\(dqpath\(dq: \(dqfile3\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqremoved\(dq, \(dqsize\(dq: 0}]}
# Use \-\-sort\-by with a comma\-separated list; sorts apply stably from last to first.
# Here: primary by net size change descending, tie\-breaker by path ascending
$ borg diff \-\-sort\-by=\(dq>size_diff,path\(dq archive1 archive2
+17 B \-5 B [\-rw\-r\-\-r\-\- \-> \-rwxr\-xr\-x] file1
removed 0 B file3
added 0 B file4
+135 B \-252 B file2
.EE
.UNINDENT
.UNINDENT
.SH NOTES
.SS The FORMAT specifier syntax
.sp
The \fB\-\-format\fP option uses Python\(aqs format string syntax <https://docs.python.org/3.10/library/string.html#formatstrings>
\&.
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
$ borg diff \-\-format \(aq{content:30} {path}{NL}\(aq ArchiveFoo ArchiveBar
modified: +4.1 kB \-1.0 kB file\-diff
\&...
# {VAR:<NUMBER} \- pad to NUMBER columns left\-aligned.
# {VAR:>NUMBER} \- pad to NUMBER columns right\-aligned.
$ borg diff \-\-format \(aq{content:>30} {path}{NL}\(aq ArchiveFoo ArchiveBar
modified: +4.1 kB \-1.0 kB file\-diff
\&...
.EE
.UNINDENT
.UNINDENT
.sp
The following keys are always available:
.INDENT 0.0
.IP \(bu 2
NEWLINE: OS dependent line separator
.IP \(bu 2
NL: alias of NEWLINE
.IP \(bu 2
NUL: NUL character for creating print0 / xargs \-0 like output
.IP \(bu 2
SPACE: space character
.IP \(bu 2
TAB: tab character
.IP \(bu 2
CR: carriage return character
.IP \(bu 2
LF: line feed character
.UNINDENT
.sp
Keys available only when showing differences between archives:
.INDENT 0.0
.IP \(bu 2
path: archived file path
.IP \(bu 2
change: all available changes
.IP \(bu 2
content: file content change
.IP \(bu 2
mode: file mode change
.IP \(bu 2
type: file type change
.IP \(bu 2
owner: file owner (user/group) change
.IP \(bu 2
group: file group change
.IP \(bu 2
user: file user change
.IP \(bu 2
link: file link change
.IP \(bu 2
directory: file directory change
.IP \(bu 2
blkdev: file block device change
.IP \(bu 2
chrdev: file character device change
.IP \(bu 2
fifo: file fifo change
.IP \(bu 2
mtime: file modification time change
.IP \(bu 2
ctime: file change time change
.IP \(bu 2
isomtime: file modification time change (ISO 8601)
.IP \(bu 2
isoctime: file creation time change (ISO 8601)
.UNINDENT
.SS What is compared
.sp
For each matching item in both archives, Borg reports:
.INDENT 0.0
.IP \(bu 2
Content changes: total added/removed bytes within files. If chunker parameters are comparable,
Borg compares chunk IDs quickly; otherwise, it compares the content.
.IP \(bu 2
Metadata changes: user, group, mode, and other metadata shown inline, like
\(dq[old_mode \-> new_mode]\(dq for mode changes. Use \fB\-\-content\-only\fP to suppress metadata changes.
.IP \(bu 2
Added/removed items: printed as \(dqadded SIZE path\(dq or \(dqremoved SIZE path\(dq.
.UNINDENT
.SS Output formats
.sp
The default (text) output shows one line per changed path, e.g.:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
+135 B \-252 B [ \-rw\-r\-\-r\-\- \-> \-rwxr\-xr\-x ] path/to/file
.EE
.UNINDENT
.UNINDENT
.sp
JSON Lines output (\fB\-\-json\-lines\fP) prints one JSON object per changed path, e.g.:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
{\(dqpath\(dq: \(dqPATH\(dq, \(dqchanges\(dq: [
{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: BYTES, \(dqremoved\(dq: BYTES},
{\(dqtype\(dq: \(dqmode\(dq, \(dqold_mode\(dq: \(dq\-rw\-r\-\-r\-\-\(dq, \(dqnew_mode\(dq: \(dq\-rwxr\-xr\-x\(dq},
{\(dqtype\(dq: \(dqadded\(dq, \(dqsize\(dq: SIZE},
{\(dqtype\(dq: \(dqremoved\(dq, \(dqsize\(dq: SIZE}
]}
.EE
.UNINDENT
.UNINDENT
.SS Sorting
.sp
Use \fB\-\-sort\-by FIELDS\fP where FIELDS is a comma\-separated list of fields.
Sorts are applied stably from last to first in the given list. Prepend \(dq>\(dq for
descending, \(dq<\(dq (or no prefix) for ascending, for example \fB\-\-sort\-by=\(dq>size_added,path\(dq\fP\&.
Supported fields include:
.INDENT 0.0
.IP \(bu 2
path: the item path
.IP \(bu 2
size_added: total bytes added for the item content
.IP \(bu 2
size_removed: total bytes removed for the item content
.IP \(bu 2
size_diff: size_added \- size_removed (net content change)
.IP \(bu 2
size: size of the item as stored in ARCHIVE2 (0 for removed items)
.IP \(bu 2
user, group, uid, gid, ctime, mtime: taken from the item state in ARCHIVE2 when present
.IP \(bu 2
ctime_diff, mtime_diff: timestamp difference (ARCHIVE2 \- ARCHIVE1)
.UNINDENT
.SS Performance considerations
.sp
diff automatically detects whether the archives were created with the same chunker
parameters. If so, only chunk IDs are compared, which is very fast.
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP

View file

@ -1,3 +1,4 @@
'\" t
.\" Man page generated from reStructuredText.
.
.
@ -27,12 +28,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-EXPORT-TAR" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-EXPORT-TAR" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-export-tar \- Export archive contents as a tarball
.SH SYNOPSIS
.sp
borg [common options] export\-tar [options] ARCHIVE FILE [PATH...]
borg [common options] export\-tar [options] NAME FILE [PATH...]
.SH DESCRIPTION
.sp
This command creates a tarball from an archive.
@ -50,7 +51,7 @@ before writing it to FILE:
.IP \(bu 2
\&.tar.xz or .txz: xz
.IP \(bu 2
\&.tar.zstd: zstd
\&.tar.zstd or .tar.zst: zstd
.IP \(bu 2
\&.tar.lz4: lz4
.UNINDENT
@ -59,12 +60,44 @@ Alternatively, a \fB\-\-tar\-filter\fP program may be explicitly specified. It s
read the uncompressed tar stream from stdin and write a compressed/filtered
tar stream to stdout.
.sp
The generated tarball uses the GNU tar format.
.sp
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.
Depending on the \fB\-\-tar\-format\fP option, these formats are created:
.TS
box center;
l|l|l.
T{
\-\-tar\-format
T} T{
Specification
T} T{
Metadata
T}
_
T{
BORG
T} T{
BORG specific, like PAX
T} T{
all as supported by borg
T}
_
T{
PAX
T} T{
POSIX.1\-2001 (pax) format
T} T{
GNU + atime/ctime/mtime ns
+ xattrs
T}
_
T{
GNU
T} T{
GNU tar format
T} T{
mtime s, no atime/ctime,
no ACLs/xattrs/bsdflags
T}
.TE
.sp
A \fB\-\-sparse\fP option (as found in borg extract) is not supported.
.sp
@ -82,16 +115,16 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B ARCHIVE
archive to export
.B NAME
specify the archive name
.TP
.B FILE
output tar file. "\-" to write to stdout instead.
output tar file. \(dq\-\(dq to write to stdout instead.
.TP
.B PATH
paths to extract; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-tar\-filter
@ -99,8 +132,11 @@ filter program to pipe data through
.TP
.B \-\-list
output verbose list of items (files, dirs, ...)
.TP
.BI \-\-tar\-format \ FMT
select tar format: BORG, PAX or GNU
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -118,31 +154,6 @@ read include/exclude patterns from PATTERNFILE, one per line
.BI \-\-strip\-components \ NUMBER
Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# 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 \(aq*.so\(aq
# 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"
.ft P
.fi
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP

View file

@ -27,24 +27,28 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-EXTRACT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-EXTRACT" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-extract \- Extract archive contents
borg-extract \- Extracts archive contents.
.SH SYNOPSIS
.sp
borg [common options] extract [options] ARCHIVE [PATH...]
borg [common options] extract [options] NAME [PATH...]
.SH DESCRIPTION
.sp
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 \fBPATHs\fP as arguments. The file selection can further
be restricted by using the \fB\-\-exclude\fP option.
This command extracts the contents of an archive.
.sp
By default, the entire archive is extracted, but a subset of files and directories
can be selected by passing a list of \fBPATH\fP arguments. The default interpretation
for the paths to extract is \fIpp:\fP which is a literal path\-prefix match. If you want
to use e.g. a wildcard, you must select a different pattern style such as \fIsh:\fP or
\fIfm:\fP\&. See \fIborg_patterns\fP for more information.
.sp
The file selection can be further restricted by using the \fB\-\-exclude\fP option.
For more help on include/exclude patterns, see the \fIborg_patterns\fP command output.
.sp
By using \fB\-\-dry\-run\fP, 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.
output data: reading metadata and data chunks from the repository, checking the hash/HMAC,
decrypting, and decompressing.
.sp
\fB\-\-progress\fP can be slower than no progress display, since it makes one additional
pass over the archive metadata.
@ -52,12 +56,12 @@ pass over the archive metadata.
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Currently, extract always writes into the current working directory ("."),
Currently, extract always writes into the current working directory (\(dq.\(dq),
so make sure you \fBcd\fP to the right place before calling \fBborg extract\fP\&.
.sp
When parent directories are not extracted (because of using file/directory selection
or any other reason), borg can not restore parent directories\(aq metadata, e.g. owner,
group, permission, etc.
or any other reason), Borg cannot restore parent directories\(aq metadata, e.g., owner,
group, permissions, etc.
.UNINDENT
.UNINDENT
.SH OPTIONS
@ -66,29 +70,23 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B ARCHIVE
archive to extract
.B NAME
specify the archive name
.TP
.B PATH
paths to extract; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-list
output verbose list of items (files, dirs, ...)
output a verbose list of items (files, dirs, ...)
.TP
.B \-n\fP,\fB \-\-dry\-run
do not actually change any files
.TP
.B \-\-numeric\-owner
deprecated, use \fB\-\-numeric\-ids\fP instead
.TP
.B \-\-numeric\-ids
only obey numeric user and group identifiers
.TP
.B \-\-nobsdflags
deprecated, use \fB\-\-noflags\fP instead
only use numeric user and group identifiers
.TP
.B \-\-noflags
do not extract/set flags (e.g. NODUMP, IMMUTABLE)
@ -103,9 +101,12 @@ do not extract/set xattrs
write all extracted data to stdout
.TP
.B \-\-sparse
create holes in output sparse file from all\-zero chunks
create holes in the output sparse file from all\-zero chunks
.TP
.B \-\-continue
continue a previously interrupted extraction of the same archive
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -127,27 +128,28 @@ Remove the specified number of leading path elements. Paths with fewer elements
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
# Extract entire archive
$ borg extract /path/to/repo::my\-files
$ borg extract my\-files
# Extract entire archive and list files while processing
$ borg extract \-\-list /path/to/repo::my\-files
$ borg extract \-\-list 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
$ borg extract \-\-dry\-run my\-files
# Extract the "src" directory
$ borg extract /path/to/repo::my\-files home/USERNAME/src
# Extract the \(dqsrc\(dq directory
$ borg extract my\-files home/USERNAME/src
# Extract the "src" directory but exclude object files
$ borg extract /path/to/repo::my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq
# Extract the \(dqsrc\(dq directory but exclude object files
$ borg extract my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq
# Extract only the C files
$ borg extract my\-files \(aqsh:home/USERNAME/src/*.c\(aq
# 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
.ft P
.fi
$ borg extract \-\-stdout my\-sdx | dd of=/dev/sdx bs=10M
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO

View file

@ -27,12 +27,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-IMPORT-TAR" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-IMPORT-TAR" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-import-tar \- Create a backup archive from a tarball
.SH SYNOPSIS
.sp
borg [common options] import\-tar [options] ARCHIVE TARFILE
borg [common options] import\-tar [options] NAME TARFILE
.SH DESCRIPTION
.sp
This command creates a backup archive from a tarball.
@ -49,7 +49,7 @@ based on its file extension and pipe the file through an appropriate filter:
.IP \(bu 2
\&.tar.xz or .txz: xz \-d
.IP \(bu 2
\&.tar.zstd: zstd \-d
\&.tar.zstd or .tar.zst: zstd \-d
.IP \(bu 2
\&.tar.lz4: lz4 \-d
.UNINDENT
@ -61,28 +61,42 @@ stdout.
Most documentation of borg create applies. Note that this command does not
support excluding files.
.sp
import\-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.
.sp
A \fB\-\-sparse\fP option (as found in borg create) is not supported.
.sp
import\-tar reads POSIX.1\-1988 (ustar), POSIX.1\-2001 (pax), GNU tar, UNIX V7 tar
and SunOS tar with extended attributes.
About tar formats and metadata conservation or loss, please see \fBborg export\-tar\fP\&.
.sp
import\-tar reads these tar formats:
.INDENT 0.0
.IP \(bu 2
BORG: borg specific (PAX\-based)
.IP \(bu 2
PAX: POSIX.1\-2001
.IP \(bu 2
GNU: GNU tar
.IP \(bu 2
POSIX.1\-1988 (ustar)
.IP \(bu 2
UNIX V7 tar
.IP \(bu 2
SunOS tar with extended attributes
.UNINDENT
.sp
To import multiple tarballs into a single archive, they can be simply
concatenated (e.g. using \(dqcat\(dq) into a single file, and imported with an
\fB\-\-ignore\-zeros\fP option to skip through the stop markers between them.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B ARCHIVE
name of archive to create (must be also a valid directory name)
.B NAME
specify the archive name
.TP
.B TARFILE
input tar file. "\-" to read from stdin instead.
input tar file. \(dq\-\(dq to read from stdin instead.
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-tar\-filter
@ -99,6 +113,9 @@ only display items with the given status characters
.TP
.B \-\-json
output stats as JSON (implies \-\-stats)
.TP
.B \-\-ignore\-zeros
ignore zero\-filled blocks in the input tarball
.UNINDENT
.SS Archive options
.INDENT 0.0
@ -107,16 +124,83 @@ output stats as JSON (implies \-\-stats)
add a comment text to the archive
.TP
.BI \-\-timestamp \ TIMESTAMP
manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory.
.TP
.BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
write checkpoint every SECONDS seconds (Default: 1800)
manually specify the archive creation date/time (yyyy\-mm\-ddThh:mm:ss[(+|\-)HH:MM] format, (+|\-)HH:MM is the UTC offset, default: local time zone). Alternatively, give a reference file/directory.
.TP
.BI \-\-chunker\-params \ PARAMS
specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095
.TP
.BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
select compression algorithm, see the output of the "borg help compression" command for details.
select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.EX
# Export as an uncompressed tar archive
$ borg export\-tar Monday Monday.tar
# Import an uncompressed tar archive
$ borg import\-tar Monday Monday.tar
# Exclude some file types and compress using gzip
$ borg export\-tar Monday Monday.tar.gz \-\-exclude \(aq*.so\(aq
# Use a higher compression level with gzip
$ borg export\-tar \-\-tar\-filter=\(dqgzip \-9\(dq Monday Monday.tar.gz
# Copy an archive from repoA to repoB
$ borg \-r repoA export\-tar \-\-tar\-format=BORG archive \- | borg \-r repoB import\-tar archive \-
# Export a tar, but instead of storing it on disk, upload it to a remote site using curl
$ borg export\-tar Monday \- | curl \-\-data\-binary @\- https://somewhere/to/POST
# Remote extraction via \(aqtarpipe\(aq
$ borg export\-tar Monday \- | ssh somewhere \(dqcd extracted; tar x\(dq
.EE
.UNINDENT
.UNINDENT
.SS Archives transfer script
.sp
Outputs a script that copies all archives from repo1 to repo2:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
for N I T in \(gaborg list \-\-format=\(aq{archive} {id} {time:%Y\-%m\-%dT%H:%M:%S}{NL}\(aq\(ga
do
echo \(dqborg \-r repo1 export\-tar \-\-tar\-format=BORG aid:$I \- | borg \-r repo2 import\-tar \-\-timestamp=$T $N \-\(dq
done
.EE
.UNINDENT
.UNINDENT
.sp
Kept:
.INDENT 0.0
.IP \(bu 2
archive name, archive timestamp
.IP \(bu 2
archive contents (all items with metadata and data)
.UNINDENT
.sp
Lost:
.INDENT 0.0
.IP \(bu 2
some archive metadata (like the original command line, execution time, etc.)
.UNINDENT
.sp
Please note:
.INDENT 0.0
.IP \(bu 2
all data goes over that pipe, again and again for every archive
.IP \(bu 2
the pipe is dumb, there is no data or transfer time reduction there due to deduplication
.IP \(bu 2
maybe add compression
.IP \(bu 2
pipe over ssh for remote transfer
.IP \(bu 2
no special sparse file support
.UNINDENT
.SH SEE ALSO
.sp

View file

@ -27,39 +27,34 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-INFO" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-INFO" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-info \- Show archive details such as disk space used
.SH SYNOPSIS
.sp
borg [common options] info [options] [REPOSITORY_OR_ARCHIVE]
borg [common options] info [options] [NAME]
.SH DESCRIPTION
.sp
This command displays detailed information about the specified archive or repository.
This command displays detailed information about the specified archive.
.sp
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:
up to the deduplicated size of the repository (\(dqall archives\(dq), because the two
mean different things:
.sp
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 archives / deduplicated size = amount of data stored in the repository
= all chunks in the repository.
.sp
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 \fIutilization of maximum supported archive size\fP\&.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY_OR_ARCHIVE
repository or archive to display information about
.B NAME
specify the archive name
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-json
@ -68,86 +63,55 @@ format output as JSON
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
.TP
.BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB\-\-prefix\fP and \fB\-\-glob\-archives\fP are mutually exclusive.
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
only consider archives matching all patterns. See \(dqborg help match\-archives\(dq.
.TP
.BI \-\-sort\-by \ KEYS
Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
consider the first N archives after other filters are applied
.TP
.BI \-\-last \ N
consider last N archives after other filters were applied
consider the last N archives after other filters are applied
.TP
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
consider archives older than (now \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g., 7d or 12m.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ borg info /path/to/repo::2017\-06\-29T11:00\-srv
Archive name: 2017\-06\-29T11:00\-srv
Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5
.EX
$ borg info aid:f7dea078
Archive name: source\-backup
Archive fingerprint: f7dea0788dfc026cc2be1c0f5b94beb4e4084eb3402fc40c38d8719b1bf2d943
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
.ft P
.fi
Hostname: mba2020
Username: tw
Time (start): Sat, 2022\-06\-25 20:51:40
Time (end): Sat, 2022\-06\-25 20:51:40
Duration: 0.03 seconds
Command line: /usr/bin/borg \-r path/to/repo create source\-backup src
Utilization of maximum supported archive size: 0%
Number of files: 244
Original size: 13.80 MB
Deduplicated size: 531 B
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-list(1)\fP, \fIborg\-diff(1)\fP
\fIborg\-common(1)\fP, \fIborg\-list(1)\fP, \fIborg\-diff(1)\fP, \fIborg\-repo\-info(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.

View file

@ -1,270 +0,0 @@
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-INIT" 1 "2022-02-19" "" "borg backup tool"
.SH NAME
borg-init \- Initialize an empty repository
.SH SYNOPSIS
.sp
borg [common options] init [options] [REPOSITORY]
.SH DESCRIPTION
.sp
This command initializes an empty repository. A repository is a filesystem
directory containing the deduplicated data from zero or more archives.
.SS Encryption mode TLDR
.sp
The encryption mode can only be configured when creating a new repository \-
you can neither configure it on a per\-archive basis nor change the
encryption mode of an existing repository.
.sp
Use \fBrepokey\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg init \-\-encryption repokey /path/to/repo
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or \fBrepokey\-blake2\fP depending on which is faster on your client machines (see below):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg init \-\-encryption repokey\-blake2 /path/to/repo
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Borg will:
.INDENT 0.0
.IP 1. 3
Ask you to come up with a passphrase.
.IP 2. 3
Create a borg key (which contains 3 random secrets. See \fIkey_files\fP).
.IP 3. 3
Encrypt the key with your passphrase.
.IP 4. 3
Store the encrypted borg key inside the repository directory (in the repo config).
This is why it is essential to use a secure passphrase.
.IP 5. 3
Encrypt and sign your backups to prevent anyone from reading or forging them unless they
have the key and know the passphrase. Make sure to keep a backup of
your key \fBoutside\fP the repository \- do not lock yourself out by
"leaving your keys inside your car" (see \fIborg_key_export\fP).
For remote backups the encryption is done locally \- the remote machine
never sees your passphrase, your unencrypted key or your unencrypted files.
Chunking and id generation are also based on your key to improve
your privacy.
.IP 6. 3
Use the key when extracting files to decrypt them and to verify that the contents of
the backups have not been accidentally or maliciously altered.
.UNINDENT
.SS Picking a passphrase
.sp
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\(aqt unlock and use it without knowing the
passphrase.
.sp
Be careful with special or non\-ascii characters in your passphrase:
.INDENT 0.0
.IP \(bu 2
Borg processes the passphrase as unicode (and encodes it as utf\-8),
so it does not have problems dealing with even the strangest characters.
.IP \(bu 2
BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
.UNINDENT
.sp
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.
.sp
You can change your passphrase for existing repos at any time, it won\(aqt affect
the encryption/decryption key or other secrets.
.SS More encryption modes
.sp
Only use \fB\-\-encryption none\fP if you are OK with anyone who has access to
your repository being able to read your backups and tamper with their
contents without you noticing.
.sp
If you want "passphrase and having\-the\-key" security, use \fB\-\-encryption keyfile\fP\&.
The key will be stored in your home directory (in \fB~/.config/borg/keys\fP).
.sp
If you do \fBnot\fP want to encrypt the contents of your backups, but still
want to detect malicious tampering use \fB\-\-encryption authenticated\fP\&.
.sp
If \fBBLAKE2b\fP is faster than \fBSHA\-256\fP on your hardware, use \fB\-\-encryption authenticated\-blake2\fP,
\fB\-\-encryption repokey\-blake2\fP or \fB\-\-encryption keyfile\-blake2\fP\&. Note: for remote backups
the hashing is done on your local machine.
.\" nanorst: inline-fill
.
.TS
center;
|l|l|l|l|.
_
T{
Hash/MAC
T} T{
Not encrypted
no auth
T} T{
Not encrypted,
but authenticated
T} T{
Encrypted (AEAD w/ AES)
and authenticated
T}
_
T{
SHA\-256
T} T{
none
T} T{
\fIauthenticated\fP
T} T{
repokey
keyfile
T}
_
T{
BLAKE2b
T} T{
n/a
T} T{
\fIauthenticated\-blake2\fP
T} T{
\fIrepokey\-blake2\fP
\fIkeyfile\-blake2\fP
T}
_
.TE
.\" nanorst: inline-replace
.
.sp
Modes \fImarked like this\fP in the above table are new in Borg 1.1 and are not
backwards\-compatible with Borg 1.0.x.
.sp
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 \fIauthenticated\-blake2\fP faster than \fInone\fP and \fIauthenticated\fP\&.
.sp
On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster
than BLAKE2b\-256 there. NEON accelerates AES as well.
.sp
Hardware acceleration is always used automatically when available.
.sp
\fIrepokey\fP and \fIkeyfile\fP 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.
.sp
\fIrepokey\-blake2\fP and \fIkeyfile\-blake2\fP 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 \fInot\fP compatible with Borg 1.0.x.
.sp
\fIauthenticated\fP mode uses no encryption, but authenticates repository contents
through the same HMAC\-SHA256 hash as the \fIrepokey\fP and \fIkeyfile\fP modes (it uses it
as the chunk ID hash). The key is stored like \fIrepokey\fP\&.
This mode is new and \fInot\fP compatible with Borg 1.0.x.
.sp
\fIauthenticated\-blake2\fP is like \fIauthenticated\fP, but uses the keyed BLAKE2b\-256 hash
from the other blake2 modes.
This mode is new and \fInot\fP compatible with Borg 1.0.x.
.sp
\fInone\fP 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 \fBborg create\fP on contents controlled by an attacker.
Use it only for new repositories where no encryption is wanted \fBand\fP when compatibility
with 1.0.x is important. If compatibility with 1.0.x is not important, use
\fIauthenticated\-blake2\fP or \fIauthenticated\fP instead.
This mode is compatible with Borg 1.0.x.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY
repository to create
.UNINDENT
.SS optional arguments
.INDENT 0.0
.TP
.BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE
select encryption key mode \fB(required)\fP
.TP
.B \-\-append\-only
create an append\-only mode repository. Note that this only affects the low level structure of the repository, and running \fIdelete\fP or \fIprune\fP will still be allowed. See \fIappend_only_mode\fP in Additional Notes for more details.
.TP
.BI \-\-storage\-quota \ QUOTA
Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
.TP
.B \-\-make\-parent\-dirs
create the parent directories of the repository directory, if they are missing.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# 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 <REPO_DIR>/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
.ft P
.fi
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-create(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-check(1)\fP, \fIborg\-list(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.

View file

@ -0,0 +1,91 @@
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-KEY-CHANGE-ALGORITHM" 1 "2022-06-26" "" "borg backup tool"
.SH NAME
borg-key-change-algorithm \- Change repository key algorithm
.SH SYNOPSIS
.sp
borg [common options] key change\-algorithm [options] ALGORITHM
.SH DESCRIPTION
.sp
Change the algorithm we use to encrypt and authenticate the borg key.
.sp
Important: In a \fIrepokey\fP mode (e.g. repokey\-blake2) all users share the same key.
In this mode upgrading to \fIargon2\fP will make it impossible to access the repo for users who use an old version of borg.
We recommend upgrading to the latest stable version.
.sp
Important: In a \fIkeyfile\fP mode (e.g. keyfile\-blake2) each user has their own key (in \fB~/.config/borg/keys\fP).
In this mode this command will only change the key used by the current user.
If you want to upgrade to \fIargon2\fP to strengthen security, you will have to upgrade each user\(aqs key individually.
.sp
Your repository is encrypted and authenticated with a key that is randomly generated by \fBborg init\fP\&.
The key is encrypted and authenticated with your passphrase.
.sp
We currently support two choices:
.INDENT 0.0
.IP 1. 3
argon2 \- recommended. This algorithm is used by default when initialising a new repository.
The key encryption key is derived from your passphrase via argon2\-id.
Argon2 is considered more modern and secure than pbkdf2.
.IP 2. 3
pbkdf2 \- the legacy algorithm. Use this if you want to access your repo via old versions of borg.
The key encryption key is derived from your passphrase via PBKDF2\-HMAC\-SHA256.
.UNINDENT
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# Upgrade an existing key to argon2
borg key change\-algorithm /path/to/repo argon2
# Downgrade to pbkdf2 \- use this if upgrading borg is not an option
borg key change\-algorithm /path/to/repo pbkdf2
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B ALGORITHM
select key algorithm
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.

View file

@ -0,0 +1,71 @@
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-KEY-CHANGE-LOCATION" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-key-change-location \- Changes the repository key location.
.SH SYNOPSIS
.sp
borg [common options] key change\-location [options] KEY_LOCATION
.SH DESCRIPTION
.sp
Change the location of a Borg key. The key can be stored at different locations:
.INDENT 0.0
.IP \(bu 2
keyfile: locally, usually in the home directory
.IP \(bu 2
repokey: inside the repository (in the repository config)
.UNINDENT
.sp
Please note:
.sp
This command does NOT change the crypto algorithms, just the key location,
thus you must ONLY give the key location (keyfile or repokey).
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B KEY_LOCATION
select key location
.UNINDENT
.SS options
.INDENT 0.0
.TP
.B \-\-keep
keep the key also at the current location (default: remove it)
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.

View file

@ -27,12 +27,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-KEY-CHANGE-PASSPHRASE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-CHANGE-PASSPHRASE" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-key-change-passphrase \- Change repository key file passphrase
borg-key-change-passphrase \- Changes the repository key file passphrase.
.SH SYNOPSIS
.sp
borg [common options] key change\-passphrase [options] [REPOSITORY]
borg [common options] key change\-passphrase [options]
.SH DESCRIPTION
.sp
The key files used for repository encryption are optionally passphrase
@ -45,29 +45,25 @@ does not protect future (nor past) backups to the same repository.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.sp
REPOSITORY
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
# Create a key file protected repository
$ borg init \-\-encryption=keyfile \-v /path/to/repo
Initializing repository at "/path/to/repo"
$ borg repo\-create \-\-encryption=keyfile\-aes\-ocb \-v
Initializing repository at \(dq/path/to/repo\(dq
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.
Key in \(dq/root/.config/borg/keys/mnt_backup\(dq 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
$ borg key change\-passphrase \-v
Enter passphrase for key /root/.config/borg/keys/mnt_backup:
Enter new passphrase:
Enter same passphrase again:
@ -77,9 +73,8 @@ Key updated
# Import a previously\-exported key into the specified
# key file (creating or overwriting the output key)
# (keyfile repositories only)
$ BORG_KEY_FILE=/path/to/output\-key borg key import /path/to/repo /path/to/exported
.ft P
.fi
$ BORG_KEY_FILE=/path/to/output\-key borg key import /path/to/exported
.EE
.UNINDENT
.UNINDENT
.sp
@ -87,14 +82,12 @@ Fully automated using environment variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ 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.
.ft P
.fi
.EX
$ BORG_NEW_PASSPHRASE=old borg repo\-create \-\-encryption=repokey\-aes\-ocb
# now \(dqold\(dq is the current passphrase.
$ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change\-passphrase
# now \(dqnew\(dq is the current passphrase.
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO

View file

@ -27,16 +27,16 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-KEY-EXPORT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-EXPORT" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-key-export \- Export the repository key for backup
borg-key-export \- Exports the repository key for backup.
.SH SYNOPSIS
.sp
borg [common options] key export [options] [REPOSITORY] [PATH]
borg [common options] key export [options] [PATH]
.SH DESCRIPTION
.sp
If repository encryption is used, the repository is inaccessible
without the key. This command allows one to backup this essential key.
without the key. This command allows one to back up 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.
@ -56,43 +56,38 @@ 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.
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg key export /path/to/repo > encrypted\-key\-backup
borg key export \-\-paper /path/to/repo > encrypted\-key\-backup.txt
borg key export \-\-qr\-html /path/to/repo > encrypted\-key\-backup.html
# Or pass the output file as an argument instead of redirecting stdout:
borg key export /path/to/repo encrypted\-key\-backup
borg key export \-\-paper /path/to/repo encrypted\-key\-backup.txt
borg key export \-\-qr\-html /path/to/repo encrypted\-key\-backup.html
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.sp
REPOSITORY
.INDENT 0.0
.TP
.B PATH
where to store the backup
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-paper
Create an export suitable for printing and later type\-in
.TP
.B \-\-qr\-html
Create an html file suitable for printing and later type\-in or qr scan
Create an HTML file suitable for printing and later type\-in or QR scan
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.EX
borg key export > encrypted\-key\-backup
borg key export \-\-paper > encrypted\-key\-backup.txt
borg key export \-\-qr\-html > encrypted\-key\-backup.html
# Or pass the output file as an argument instead of redirecting stdout:
borg key export encrypted\-key\-backup
borg key export \-\-paper encrypted\-key\-backup.txt
borg key export \-\-qr\-html encrypted\-key\-backup.html
.EE
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp

View file

@ -27,12 +27,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-KEY-IMPORT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-IMPORT" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-key-import \- Import the repository key from backup
borg-key-import \- Imports the repository key from backup.
.SH SYNOPSIS
.sp
borg [common options] key import [options] [REPOSITORY] [PATH]
borg [common options] key import [options] [PATH]
.SH DESCRIPTION
.sp
This command restores a key previously backed up with the export command.
@ -53,14 +53,12 @@ key import\fP creates a new key file in \fB$BORG_KEYS_DIR\fP\&.
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.sp
REPOSITORY
.INDENT 0.0
.TP
.B PATH
path to the backup (\(aq\-\(aq to read from stdin)
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-paper

View file

@ -27,20 +27,20 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-KEY" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-key \- Manage a keyfile or repokey of a repository
borg-key \- Manage the keyfile or repokey of a repository
.SH SYNOPSIS
.nf
borg [common options] key export ...
borg [common options] key import ...
borg [common options] key change\-passphrase ...
borg [common options] key migrate\-to\-repokey ...
borg [common options] key change\-location ...
.fi
.sp
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP, \fIborg\-key\-migrate\-to\-repokey(1)\fP
\fIborg\-common(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP, \fIborg\-key\-change\-location(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.

View file

@ -27,66 +27,45 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-LIST" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-LIST" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-list \- List archive or repository contents
borg-list \- List archive contents.
.SH SYNOPSIS
.sp
borg [common options] list [options] [REPOSITORY_OR_ARCHIVE] [PATH...]
borg [common options] list [options] NAME [PATH...]
.SH DESCRIPTION
.sp
This command lists the contents of a repository or an archive.
This command lists the contents of an archive.
.sp
For more help on include/exclude patterns, see the \fIborg_patterns\fP command output.
For more help on include/exclude patterns, see the output of \fIborg_patterns\fP\&.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY_OR_ARCHIVE
repository or archive to list contents of
.B NAME
specify the archive name
.TP
.B PATH
paths to list; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-consider\-checkpoints
Show checkpoint archives in the repository contents list (default: hidden).
.TP
.B \-\-short
only print file/directory names, nothing else
.TP
.BI \-\-format \ FORMAT
specify format for file or archive listing (default for files: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; for archives: "{archive:<36} {time} [{id}]{NL}")
.TP
.B \-\-json
Only valid for listing repository contents. Format output as JSON. The form of \fB\-\-format\fP 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.
specify format for file listing (default: \(dq{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}\(dq)
.TP
.B \-\-json\-lines
Only valid for listing archive contents. Format output as JSON Lines. The form of \fB\-\-format\fP 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.
Format output as JSON Lines. The form of \fB\-\-format\fP is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text.
.TP
.BI \-\-depth \ N
only list files up to the specified directory depth
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
.TP
.BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB\-\-prefix\fP and \fB\-\-glob\-archives\fP are mutually exclusive.
.TP
.BI \-\-sort\-by \ KEYS
Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
.TP
.BI \-\-last \ N
consider last N archives after other filters were applied
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -105,16 +84,8 @@ read include/exclude patterns from PATTERNFILE, one per line
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ 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
.EX
$ borg list 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
@ -122,14 +93,14 @@ lrwxrwxrwx root root 0 Fri, 2015\-03\-27 20:24:26 bin/bzcmp \-> bzdif
\-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*"
$ borg list root\-2016\-02\-15 \-\-pattern \(dq\- bin/ba*\(dq
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}"
$ borg list archiveA \-\-format=\(dq{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}\(dq
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
@ -137,50 +108,38 @@ 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.text
\&...
$ borg list /path/to/repo/::archiveA \-\-pattern \(aqre:\e.ext$\(aq
$ borg list archiveA \-\-pattern \(aq+ re:\e.ext$\(aq \-\-pattern \(aq\- re:^.*$\(aq
\-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.ext
\&...
$ borg list /path/to/repo/::archiveA \-\-pattern \(aqre:.ext$\(aq
$ borg list archiveA \-\-pattern \(aq+ re:.ext$\(aq \-\-pattern \(aq\- re:^.*$\(aq
\-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.ext
\-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.text
\&...
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.SH NOTES
.SS The FORMAT specifier syntax
.sp
The \fB\-\-format\fP option uses python\(aqs \fI\%format string syntax\fP\&.
The \fB\-\-format\fP option uses Python\(aqs format string syntax <https://docs.python.org/3.10/library/string.html#formatstrings>
\&.
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ borg list \-\-format \(aq{archive}{NL}\(aq /path/to/repo
ArchiveFoo
ArchiveBar
\&...
# {VAR:NUMBER} \- pad to NUMBER columns.
# Strings are left\-aligned, numbers are right\-aligned.
# Note: time columns except \(ga\(gaisomtime\(ga\(ga, \(ga\(gaisoctime\(ga\(ga and \(ga\(gaisoatime\(ga\(ga cannot be padded.
$ borg list \-\-format \(aq{archive:36} {time} [{id}]{NL}\(aq /path/to/repo
ArchiveFoo Thu, 2021\-12\-09 10:22:28 [0b8e9a312bef3f2f6e2d0fc110c196827786c15eba0188738e81697a7fa3b274]
$ borg list \-\-format \(aq{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}\(aq /path/to/repo::ArchiveFoo
.EX
$ borg list \-\-format \(aq{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}\(aq ArchiveFoo
\-rw\-rw\-r\-\- user user 1024 Thu, 2021\-12\-09 10:22:17 file\-foo
\&...
# {VAR:<NUMBER} \- pad to NUMBER columns left\-aligned.
# {VAR:>NUMBER} \- pad to NUMBER columns right\-aligned.
$ borg list \-\-format \(aq{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}\(aq /path/to/repo::ArchiveFoo
$ borg list \-\-format \(aq{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}\(aq ArchiveFoo
\-rw\-rw\-r\-\- user user 1024 Thu, 2021\-12\-09 10:22:17 file\-foo
\&...
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -191,93 +150,57 @@ NEWLINE: OS dependent line separator
.IP \(bu 2
NL: alias of NEWLINE
.IP \(bu 2
NUL: NUL character for creating print0 / xargs \-0 like output, see barchive and bpath keys below
NUL: NUL character for creating print0 / xargs \-0 like output
.IP \(bu 2
SPACE
SPACE: space character
.IP \(bu 2
TAB
TAB: tab character
.IP \(bu 2
CR
CR: carriage return character
.IP \(bu 2
LF
.UNINDENT
.sp
Keys available only when listing archives in a repository:
.INDENT 0.0
.IP \(bu 2
archive: archive name interpreted as text (might be missing non\-text characters, see barchive)
.IP \(bu 2
name: alias of "archive"
.IP \(bu 2
barchive: verbatim archive name, can contain any character except NUL
.IP \(bu 2
comment: archive comment interpreted as text (might be missing non\-text characters, see bcomment)
.IP \(bu 2
bcomment: verbatim archive comment, can contain any character except NUL
.IP \(bu 2
id: internal ID of the archive
.IP \(bu 2
start: time (start) of creation of the archive
.IP \(bu 2
time: alias of "start"
.IP \(bu 2
end: time (end) of creation of the archive
.IP \(bu 2
command_line: command line which was used to create the archive
.IP \(bu 2
hostname: hostname of host on which this archive was created
.IP \(bu 2
username: username of user who created this archive
LF: line feed character
.UNINDENT
.sp
Keys available only when listing files in an archive:
.INDENT 0.0
.IP \(bu 2
type
type: file type (file, dir, symlink, ...)
.IP \(bu 2
mode
mode: file mode (as in stat)
.IP \(bu 2
uid
uid: user id of file owner
.IP \(bu 2
gid
gid: group id of file owner
.IP \(bu 2
user
user: user name of file owner
.IP \(bu 2
group
group: group name of file owner
.IP \(bu 2
path: path interpreted as text (might be missing non\-text characters, see bpath)
path: file path
.IP \(bu 2
bpath: verbatim POSIX path, can contain any character except NUL
target: link target for symlinks
.IP \(bu 2
source: link target for links (identical to linktarget)
hlid: hard link identity (same if hardlinking same fs object)
.IP \(bu 2
linktarget
inode: inode number
.IP \(bu 2
flags
flags: file flags
.IP \(bu 2
size
.IP \(bu 2
csize: compressed size
.IP \(bu 2
dsize: deduplicated size
.IP \(bu 2
dcsize: deduplicated compressed size
size: file size
.IP \(bu 2
num_chunks: number of chunks in this file
.IP \(bu 2
unique_chunks: number of unique chunks in this file
mtime: file modification time
.IP \(bu 2
mtime
ctime: file change time
.IP \(bu 2
ctime
atime: file access time
.IP \(bu 2
atime
isomtime: file modification time (ISO 8601 format)
.IP \(bu 2
isomtime
isoctime: file change time (ISO 8601 format)
.IP \(bu 2
isoctime
.IP \(bu 2
isoatime
isoatime: file access time (ISO 8601 format)
.IP \(bu 2
blake2b
.IP \(bu 2
@ -305,17 +228,15 @@ sha512
.IP \(bu 2
xxh64: XXH64 checksum of this file (note: this is NOT a cryptographic hash!)
.IP \(bu 2
archiveid
archiveid: internal ID of the archive
.IP \(bu 2
archivename
archivename: name of the archive
.IP \(bu 2
extra: prepends {source} with " \-> " for soft links and " link to " for hard links
.IP \(bu 2
health: either "healthy" (file ok) or "broken" (if file has all\-zero replacement chunks)
extra: prepends {target} with \(dq \-> \(dq for soft links and \(dq link to \(dq for hard links
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-info(1)\fP, \fIborg\-diff(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-patterns(1)\fP
\fIborg\-common(1)\fP, \fIborg\-info(1)\fP, \fIborg\-diff(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-repo\-list(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.

View file

@ -0,0 +1,99 @@
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-MATCH-ARCHIVES" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-match-archives \- Details regarding match-archives
.SH DESCRIPTION
.sp
The \fB\-\-match\-archives\fP option matches a given pattern against the list of all archives
in the repository. It can be given multiple times.
.sp
The patterns can have a prefix of:
.INDENT 0.0
.IP \(bu 2
name: pattern match on the archive name (default)
.IP \(bu 2
aid: prefix match on the archive id (only one result allowed)
.IP \(bu 2
user: exact match on the username who created the archive
.IP \(bu 2
host: exact match on the hostname where the archive was created
.IP \(bu 2
tags: match on the archive tags
.UNINDENT
.sp
In case of a name pattern match,
it uses pattern styles similar to the ones described by \fBborg help patterns\fP:
.INDENT 0.0
.TP
.B Identical match pattern, selector \fBid:\fP (default)
Simple string match, must fully match exactly as given.
.TP
.B Shell\-style patterns, selector \fBsh:\fP
Match like on the shell, wildcards like \fI*\fP and \fI?\fP work.
.TP
.B Regular expressions <https://docs.python.org/3/library/re.html>
, selector \fBre:\fP
Full regular expression support.
This is very powerful, but can also get rather complicated.
.UNINDENT
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
# name match, id: style
borg delete \-\-match\-archives \(aqid:archive\-with\-crap\(aq
borg delete \-a \(aqid:archive\-with\-crap\(aq # same, using short option
borg delete \-a \(aqarchive\-with\-crap\(aq # same, because \(aqid:\(aq is the default
# name match, sh: style
borg delete \-a \(aqsh:home\-kenny\-*\(aq
# name match, re: style
borg delete \-a \(aqre:pc[123]\-home\-(user1|user2)\-2022\-09\-.*\(aq
# archive id prefix match:
borg delete \-a \(aqaid:d34db33f\(aq
# host or user match
borg delete \-a \(aquser:kenny\(aq
borg delete \-a \(aqhost:kenny\-pc\(aq
# tags match
borg delete \-a \(aqtags:TAG1\(aq \-a \(aqtags:TAG2\(aq
.EE
.UNINDENT
.UNINDENT
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.

View file

@ -27,18 +27,37 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-MOUNT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-MOUNT" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-mount \- Mount archive or an entire repository as a FUSE filesystem
borg-mount \- Mounts an archive or an entire repository as a FUSE filesystem.
.SH SYNOPSIS
.sp
borg [common options] mount [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...]
borg [common options] mount [options] MOUNTPOINT [PATH...]
.SH DESCRIPTION
.sp
This command mounts an archive as a FUSE filesystem. This can be useful for
browsing an archive or restoring individual files. Unless the \fB\-\-foreground\fP
option is given the command will run in the background until the filesystem
is \fBumounted\fP\&.
This command mounts a repository or an archive as a FUSE filesystem.
This can be useful for browsing or restoring individual files.
.sp
When restoring, take into account that the current FUSE implementation does
not support special fs flags and ACLs.
.sp
When mounting a repository, the top directories will be named like the
archives and the directory structure below these will be loaded on\-demand from
the repository when entering these directories, so expect some delay.
.sp
Unless the \fB\-\-foreground\fP option is given, the command will run in the
background until the filesystem is \fBunmounted\fP\&.
.sp
Performance tips:
.INDENT 0.0
.IP \(bu 2
When doing a \(dqwhole repository\(dq mount:
do not enter archive directories if not needed; this avoids on\-demand loading.
.IP \(bu 2
Only mount a specific archive, not the whole repository.
.IP \(bu 2
Only mount specific paths in a specific archive, not the complete archive.
.UNINDENT
.sp
The command \fBborgfs\fP provides a wrapper for \fBborg mount\fP\&. This can also be
used in fstab entries:
@ -50,100 +69,107 @@ To allow a regular user to use fstab entries, add the \fBuser\fP option:
For FUSE configuration and mount options, see the mount.fuse(8) manual page.
.sp
Borg\(aqs default behavior is to use the archived user and group names of each
file and map them to the system\(aqs respective user and group ids.
file and map them to the system\(aqs respective user and group IDs.
Alternatively, using \fBnumeric\-ids\fP will instead use the archived user and
group ids without any mapping.
group IDs without any mapping.
.sp
The \fBuid\fP and \fBgid\fP mount options (implemented by Borg) can be used to
override the user and group ids of all files (i.e., \fBborg mount \-o
override the user and group IDs of all files (i.e., \fBborg mount \-o
uid=1000,gid=1000\fP).
.sp
The man page references \fBuser_id\fP and \fBgroup_id\fP mount options
(implemented by fuse) which specify the user and group id of the mount owner
(aka, the user who does the mounting). It is set automatically by libfuse (or
(implemented by FUSE) which specify the user and group ID of the mount owner
(also known as the user who does the mounting). It is set automatically by libfuse (or
the filesystem if libfuse is not used). However, you should not specify these
manually. Unlike the \fBuid\fP and \fBgid\fP mount options which affect all files,
\fBuser_id\fP and \fBgroup_id\fP affect the user and group id of the mounted
manually. Unlike the \fBuid\fP and \fBgid\fP mount options, which affect all files,
\fBuser_id\fP and \fBgroup_id\fP affect the user and group ID of the mounted
(base) directory.
.sp
Additional mount options supported by borg:
Additional mount options supported by Borg:
.INDENT 0.0
.IP \(bu 2
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.
\fBversions\fP: when used with a repository mount, this gives a merged, versioned
view of the files in the archives. EXPERIMENTAL; layout may change in the future.
.IP \(bu 2
allow_damaged_files: by default damaged files (where missing chunks were
replaced with runs of zeros by borg check \fB\-\-repair\fP) are not readable and
return EIO (I/O error). Set this option to read such files.
\fBallow_damaged_files\fP: by default, damaged files (where chunks are missing)
will return EIO (I/O error) when trying to read the related parts of the file.
Set this option to replace the missing parts with all\-zero bytes.
.IP \(bu 2
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".
\fBignore_permissions\fP: for security reasons the \fBdefault_permissions\fP mount
option is internally enforced by Borg. \fBignore_permissions\fP can be given to
not enforce \fBdefault_permissions\fP\&.
.UNINDENT
.sp
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
The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is intended for advanced users
to tweak 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.
.sp
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.
to delete data unintentionally.
.sp
When running in the foreground ^C/SIGINT unmounts cleanly, but other
signals or crashes do not.
When running in the foreground, ^C/SIGINT cleanly unmounts the filesystem,
but other signals or crashes do not.
.sp
Debugging:
.sp
\fBborg mount\fP usually daemonizes and the daemon process sends stdout/stderr
to /dev/null. Thus, you need to either use \fB\-f / \-\-foreground\fP to make it stay
in the foreground and not daemonize, or use \fBBORG_LOGGING_CONF\fP to reconfigure
the logger to output to a file.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY_OR_ARCHIVE
repository or archive to mount
.TP
.B MOUNTPOINT
where to mount filesystem
where to mount the filesystem
.TP
.B PATH
paths to extract; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-consider\-checkpoints
Show checkpoint archives in the repository contents list (default: hidden).
.TP
.B \-f\fP,\fB \-\-foreground
stay in foreground, do not daemonize
.TP
.B \-o
Extra mount options
.TP
.B \-\-numeric\-owner
deprecated, use \fB\-\-numeric\-ids\fP instead
extra mount options
.TP
.B \-\-numeric\-ids
use numeric user and group identifiers from archive(s)
use numeric user and group identifiers from archives
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
.TP
.BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB\-\-prefix\fP and \fB\-\-glob\-archives\fP are mutually exclusive.
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
only consider archives matching all patterns. See \(dqborg help match\-archives\(dq.
.TP
.BI \-\-sort\-by \ KEYS
Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
consider the first N archives after other filters are applied
.TP
.BI \-\-last \ N
consider last N archives after other filters were applied
consider the last N archives after other filters are applied
.TP
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
consider archives older than (now \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g., 7d or 12m.
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN

View file

@ -27,48 +27,58 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-PATTERNS" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-PATTERNS" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-patterns \- Details regarding patterns
.SH DESCRIPTION
.sp
The path/filenames used as input for the pattern matching start from the
When specifying one or more file paths in a Borg command that supports
patterns for the respective option or argument, you can apply the
patterns described here to include only desired files and/or exclude
unwanted ones. Patterns can be used
.INDENT 0.0
.IP \(bu 2
for \fB\-\-exclude\fP option,
.IP \(bu 2
in the file given with \fB\-\-exclude\-from\fP option,
.IP \(bu 2
for \fB\-\-pattern\fP option,
.IP \(bu 2
in the file given with \fB\-\-patterns\-from\fP option and
.IP \(bu 2
for \fBPATH\fP arguments that explicitly support them.
.UNINDENT
.sp
The path/filenames used as input for the pattern matching start with the
currently active recursion root. You usually give the recursion root(s)
when invoking borg and these can be either relative or absolute paths.
.sp
So, when you give \fIrelative/\fP as root, the paths going into the matcher
will look like \fIrelative/.../file.ext\fP\&. When you give \fI/absolute/\fP as
root, they will look like \fI/absolute/.../file.ext\fP\&.
Be careful, your patterns must match the archived paths:
.INDENT 0.0
.IP \(bu 2
Archived paths never start with a leading slash (\(aq/\(aq), nor with \(aq.\(aq, nor with \(aq..\(aq.
.INDENT 2.0
.IP \(bu 2
When you back up absolute paths like \fB/home/user\fP, the archived
paths start with \fBhome/user\fP\&.
.IP \(bu 2
When you back up relative paths like \fB\&./src\fP, the archived paths
start with \fBsrc\fP\&.
.IP \(bu 2
When you back up relative paths like \fB\&../../src\fP, the archived paths
start with \fBsrc\fP\&.
.UNINDENT
.UNINDENT
.sp
File paths in Borg archives are always stored normalized and relative.
This means that e.g. \fBborg create /path/to/repo ../some/path\fP will
store all files as \fIsome/path/.../file.ext\fP and \fBborg create
/path/to/repo /home/user\fP will store all files as
\fIhome/user/.../file.ext\fP\&.
Borg supports different pattern styles. To define a non\-default
style for a specific pattern, prefix it with two characters followed
by a colon \(aq:\(aq (i.e. \fBfm:path/*\fP, \fBsh:path/**\fP).
.sp
A directory exclusion pattern can end either with or without a slash (\(aq/\(aq).
If it ends with a slash, such as \fIsome/path/\fP, the directory will be
included but not its content. If it does not end with a slash, such as
\fIsome/path\fP, both the directory and content will be excluded.
.sp
File patterns support these styles: fnmatch, shell, regular expressions,
path prefixes and path full\-matches. By default, fnmatch is used for
\fB\-\-exclude\fP patterns and shell\-style is used for the \fB\-\-pattern\fP
option. For commands that support patterns in their \fBPATH\fP argument
like (\fBborg list\fP), the default pattern is path prefix.
.sp
Starting with Borg 1.2, for all but regular expression pattern matching
styles, all paths are treated as relative, meaning that a leading path
separator is removed after normalizing and before matching. This allows
you to use absolute or relative patterns arbitrarily.
.sp
If followed by a colon (\(aq:\(aq) 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. \fIaa:something/*\fP).
The default pattern style for \fB\-\-exclude\fP differs from \fB\-\-pattern\fP, see below.
.INDENT 0.0
.TP
.B \fI\%Fnmatch\fP, selector \fIfm:\fP
.B Fnmatch <https://docs.python.org/3/library/fnmatch.html>
, selector \fBfm:\fP
This is the default style for \fB\-\-exclude\fP and \fB\-\-exclude\-from\fP\&.
These patterns use a variant of shell pattern syntax, with \(aq*\(aq matching
any number of characters, \(aq?\(aq matching any single character, \(aq[...]\(aq
@ -76,7 +86,7 @@ matching any single character specified, including ranges, and \(aq[!...]\(aq
matching any character not specified. For the purpose of these patterns,
the path separator (backslash for Windows and \(aq/\(aq on other systems) is not
treated specially. Wrap meta\-characters in brackets for a literal
match (i.e. \fI[?]\fP to match the literal character \fI?\fP). For a path
match (i.e. \fB[?]\fP to match the literal character \(aq?\(aq). 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
@ -84,33 +94,33 @@ matching is attempted. Thus, if a given pattern ends in a path
separator, a \(aq*\(aq is appended before matching is attempted. A leading
path separator is always removed.
.TP
.B Shell\-style patterns, selector \fIsh:\fP
.B Shell\-style patterns, selector \fBsh:\fP
This is the default style for \fB\-\-pattern\fP and \fB\-\-patterns\-from\fP\&.
Like fnmatch patterns these are similar to shell patterns. The difference
is that the pattern may include \fI**/\fP for matching zero or more directory
levels, \fI*\fP for matching zero or more arbitrary characters with the
exception of any path separator. A leading path separator is always removed.
is that the pattern may include \fB**/\fP for matching zero or more directory
levels, \fB*\fP for matching zero or more arbitrary characters with the
exception of any path separator, \fB{}\fP containing comma\-separated
alternative patterns. A leading path separator is always removed.
.TP
.B Regular expressions, selector \fIre:\fP
Regular expressions similar to those found in Perl are supported. Unlike
shell patterns regular expressions are not required to match the full
.B Regular expressions <https://docs.python.org/3/library/re.html>
, selector \fBre:\fP
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 (\(aq^\(aq), to the end (\(aq$\(aq) or both. Path
separators (backslash for Windows and \(aq/\(aq on other systems) in paths are
always normalized to a forward slash (\(aq/\(aq) before applying a pattern. The
regular expression syntax is described in the \fI\%Python documentation for
the re module\fP\&.
always normalized to a forward slash \(aq/\(aq before applying a pattern.
.TP
.B Path prefix, selector \fIpp:\fP
This pattern style is useful to match whole sub\-directories. The pattern
\fIpp:root/somedir\fP matches \fIroot/somedir\fP and everything therein. A leading
path separator is always removed.
.B Path prefix, selector \fBpp:\fP
This pattern style is useful to match whole subdirectories. The pattern
\fBpp:root/somedir\fP matches \fBroot/somedir\fP and everything therein.
A leading path separator is always removed.
.TP
.B Path full\-match, selector \fIpf:\fP
.B Path full\-match, selector \fBpf:\fP
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. \fIpf:root/file.ext\fP matches
\fIroot/file.ext\fP only. A leading path separator is always removed.
This is kind of a pseudo pattern as it cannot have any variable or
unspecified parts \- the full path must be given. \fBpf:root/file.ext\fP
matches \fBroot/file.ext\fP only. A leading path separator is always
removed.
.sp
Implementation note: this is implemented via very time\-efficient O(1)
hashtable lookups (this means you can have huge amounts of such patterns
@ -125,12 +135,12 @@ Same logic applies for exclude.
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
\fIre:\fP, \fIsh:\fP and \fIfm:\fP 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 \fIre:\fP patterns.
Further, ensure that \fIsh:\fP and \fIfm:\fP patterns only contain a handful of
wildcards at most.
\fBre:\fP, \fBsh:\fP and \fBfm:\fP 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 \fBre:\fP patterns. Further, ensure that \fBsh:\fP and
\fBfm:\fP patterns only contain a handful of wildcards at most.
.UNINDENT
.UNINDENT
.sp
@ -138,9 +148,18 @@ Exclusions can be passed via the command line option \fB\-\-exclude\fP\&. When u
from within a shell, the patterns should be quoted to protect them from
expansion.
.sp
Patterns matching special characters, e.g. whitespace, within a shell may
require adjustments, such as putting quotation marks around the arguments.
Example:
Using bash, the following command line option would match and exclude \(dqitem name\(dq:
\fB\-\-pattern=\(aq\-path/item name\(aq\fP
Note that when patterns are used within a pattern file directly read by borg,
e.g. when using \fB\-\-exclude\-from\fP or \fB\-\-patterns\-from\fP, there is no shell
involved and thus no quotation marks are required.
.sp
The \fB\-\-exclude\-from\fP option permits loading exclusion patterns from a text
file with one pattern per line. Lines empty or starting with the number sign
(\(aq#\(aq) after removing whitespace on both ends are ignored. The optional style
file with one pattern per line. Lines empty or starting with the hash sign
\(aq#\(aq 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.
@ -152,77 +171,133 @@ Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
# Exclude a directory anywhere in the tree named \(ga\(gasteamapps/common\(ga\(ga
# (and everything below it), regardless of where it appears:
$ borg create \-e \(aqsh:**/steamapps/common/**\(aq archive /
# Exclude the contents of \(ga\(ga/home/user/.cache\(ga\(ga:
$ borg create \-e \(aqsh:home/user/.cache/**\(aq archive /home/user
$ borg create \-e home/user/.cache/ archive /home/user
# The file \(aq/home/user/.cache/important\(aq is *not* backed up:
$ borg create \-e home/user/.cache/ archive / /home/user/.cache/important
# Exclude \(aq/home/user/file.o\(aq but not \(aq/home/user/file.odt\(aq:
$ borg create \-e \(aq*.o\(aq backup /
$ borg create \-e \(aq*.o\(aq archive /
# Exclude \(aq/home/user/junk\(aq and \(aq/home/user/subdir/junk\(aq but
# not \(aq/home/user/importantjunk\(aq or \(aq/etc/junk\(aq:
$ borg create \-e \(aq/home/*/junk\(aq backup /
$ borg create \-e \(aqhome/*/junk\(aq archive /
# Exclude the contents of \(aq/home/user/cache\(aq but not the directory itself:
$ borg create \-e home/user/cache/ backup /
# The file \(aq/home/user/cache/important\(aq is *not* backed up:
$ borg create \-e /home/user/cache/ backup / /home/user/cache/important
# The contents of directories in \(aq/home\(aq are not backed up when their name
# ends in \(aq.tmp\(aq
$ borg create \-\-exclude \(aqre:^/home/[^/]+\e.tmp/\(aq backup /
$ borg create \-\-exclude \(aqre:^home/[^/]+\e.tmp/\(aq archive /
# Load exclusions from file
$ cat >exclude.txt <<EOF
# Comment line
/home/*/junk
home/*/junk
*.tmp
fm:aa:something/*
re:^/home/[^/]+\e.tmp/
sh:/home/*/.thumbnails
re:^home/[^/]+\e.tmp/
sh:home/*/.thumbnails
# Example with spaces, no need to escape as it is processed by borg
some file with spaces.txt
EOF
$ borg create \-\-exclude\-from exclude.txt backup /
.ft P
.fi
$ borg create \-\-exclude\-from exclude.txt archive /
.EE
.UNINDENT
.UNINDENT
.sp
A more general and easier to use way to define filename matching patterns exists
with the \fB\-\-pattern\fP and \fB\-\-patterns\-from\fP options. Using these, you may
specify the backup roots (starting points) and patterns for inclusion/exclusion.
A root path starts with the prefix \fIR\fP, followed by a path (a plain path, not a
file pattern). An include rule starts with the prefix +, an exclude rule starts
with the prefix \-, an exclude\-norecurse rule starts with !, all followed by a pattern.
A more general and easier to use way to define filename matching patterns
exists with the \fB\-\-pattern\fP and \fB\-\-patterns\-from\fP options. Using
these, you may specify the backup roots, default pattern styles and
patterns for inclusion and exclusion.
.INDENT 0.0
.TP
.B Root path prefix \fBR\fP
A recursion root path starts with the prefix \fBR\fP, followed by a path
(a plain path, not a file pattern). Use this prefix to have the root
paths in the patterns file rather than as command line arguments.
.TP
.B Pattern style prefix \fBP\fP (only useful within patterns files)
To change the default pattern style, use the \fBP\fP prefix, followed by
the pattern style abbreviation (\fBfm\fP, \fBpf\fP, \fBpp\fP, \fBre\fP, \fBsh\fP).
All patterns following this line in the same patterns file will use this
style until another style is specified or the end of the file is reached.
When the current patterns file is finished, the default pattern style will
reset.
.TP
.B Exclude pattern prefix \fB\-\fP
Use the prefix \fB\-\fP, followed by a pattern, to define an exclusion.
This has the same effect as the \fB\-\-exclude\fP option.
.TP
.B Exclude no\-recurse pattern prefix \fB!\fP
Use the prefix \fB!\fP, followed by a pattern, to define an exclusion
that does not recurse into subdirectories. This saves time, but
prevents include patterns to match any files in subdirectories.
.TP
.B Include pattern prefix \fB+\fP
Use the prefix \fB+\fP, followed by a pattern, to define inclusions.
This is useful to include paths that are covered in an exclude
pattern and would otherwise not be backed up.
.UNINDENT
.sp
The first matching pattern is used, so if an include pattern matches
before an exclude pattern, the file is backed up. Note that a no\-recurse
exclude stops examination of subdirectories so that potential includes
will not match \- use normal excludes for such use cases.
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
# Define the recursion root
R /
# Exclude all iso files in any directory
\- **/*.iso
# Explicitly include all inside etc and root
+ etc/**
+ root/**
# Exclude a specific directory under each user\(aqs home directories
\- home/*/.cache
# Explicitly include everything in /home
+ home/**
# Explicitly exclude some directories without recursing into them
! re:^(dev|proc|run|sys|tmp)
# Exclude all other files and directories
# that are not specifically included earlier.
\- **
.EE
.UNINDENT
.UNINDENT
.sp
\fBTip: You can easily test your patterns with \-\-dry\-run and \-\-list\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
$ borg create \-\-dry\-run \-\-list \-\-patterns\-from patterns.txt archive
.EE
.UNINDENT
.UNINDENT
.sp
This will list the considered files one per line, prefixed with a
character that indicates the action (e.g. \(aqx\(aq for excluding, see
\fBItem flags\fP in \fIborg create\fP usage docs).
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Via \fB\-\-pattern\fP or \fB\-\-patterns\-from\fP you can define BOTH inclusion and exclusion
of files using pattern prefixes \fB+\fP and \fB\-\fP\&. With \fB\-\-exclude\fP and
\fB\-\-exclude\-from\fP ONLY excludes are defined.
It is possible that a subdirectory or file is matched while its parent
directories are not. In that case, parent directories are not backed
up and thus their user, group, permission, etc. cannot be restored.
.UNINDENT
.UNINDENT
.sp
Inclusion patterns are useful to include paths that are contained in an excluded
path. The first matching pattern is used so if an include pattern matches before
an exclude pattern, the file is backed up. If an exclude\-norecurse pattern matches
a directory, it won\(aqt recurse into it and won\(aqt discover any potential matches for
include rules below that directory.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
It\(aqs possible that a sub\-directory/file is matched while parent directories are not.
In that case, parent directories are not backed up thus their user, group, permission,
etc. can not be restored.
.UNINDENT
.UNINDENT
.sp
Note that the default pattern style for \fB\-\-pattern\fP and \fB\-\-patterns\-from\fP is
shell style (\fIsh:\fP), so those patterns behave similar to rsync include/exclude
patterns. The pattern style can be set via the \fIP\fP prefix.
.sp
Patterns (\fB\-\-pattern\fP) and excludes (\fB\-\-exclude\fP) from the command line are
considered first (in the order of appearance). Then patterns from \fB\-\-patterns\-from\fP
are added. Exclusion patterns from \fB\-\-exclude\-from\fP files are appended last.
@ -231,16 +306,20 @@ Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# backup pics, but not the ones from 2018, except the good ones:
.EX
# back up pics, but not the ones from 2018, except the good ones:
# note: using = is essential to avoid cmdline argument parsing issues.
borg create \-\-pattern=+pics/2018/good \-\-pattern=\-pics/2018 repo::arch pics
borg create \-\-pattern=+pics/2018/good \-\-pattern=\-pics/2018 archive pics
# use a file with patterns:
borg create \-\-patterns\-from patterns.lst repo::arch
.ft P
.fi
# back up only JPG/JPEG files (case insensitive) in all home directories:
borg create \-\-pattern \(aq+ re:\e.jpe?g(?i)$\(aq archive /home
# back up homes, but exclude big downloads (like .ISO files) or hidden files:
borg create \-\-exclude \(aqre:\e.iso(?i)$\(aq \-\-exclude \(aqsh:home/**/.*\(aq archive /home
# use a file with patterns (recursion root \(aq/\(aq via command line):
borg create \-\-patterns\-from patterns.lst archive /
.EE
.UNINDENT
.UNINDENT
.sp
@ -248,26 +327,19 @@ The patterns.lst file could look like that:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# "sh:" pattern style is the default, so the following line is not needed:
P sh
R /
# can be rebuild
\- /home/*/.cache
# they\(aqre downloads for a reason
\- /home/*/Downloads
# susan is a nice person
.EX
# \(dqsh:\(dq pattern style is the default
# exclude caches
\- home/*/.cache
# include susans home
+ /home/susan
+ home/susan
# also back up this exact file
+ pf:/home/bobby/specialfile.txt
# don\(aqt backup the other home directories
\- /home/*
# don\(aqt even look in /proc
! /proc
.ft P
.fi
+ pf:home/bobby/specialfile.txt
# don\(aqt back up the other home directories
\- home/*
# don\(aqt even look in /dev, /proc, /run, /sys, /tmp (note: would exclude files like /device, too)
! re:^(dev|proc|run|sys|tmp)
.EE
.UNINDENT
.UNINDENT
.sp
@ -275,31 +347,26 @@ You can specify recursion roots either on the command line or in a patternfile:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
# these two commands do the same thing
borg create \-\-exclude /home/bobby/junk repo::arch /home/bobby /home/susan
borg create \-\-patterns\-from patternfile.lst repo::arch
.ft P
.fi
borg create \-\-exclude home/bobby/junk archive /home/bobby /home/susan
borg create \-\-patterns\-from patternfile.lst archive
.EE
.UNINDENT
.UNINDENT
.sp
The patternfile:
patternfile.lst:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
# note that excludes use fm: by default and patternfiles use sh: by default.
# therefore, we need to specify fm: to have the same exact behavior.
P fm
R /home/bobby
R /home/susan
\- /home/bobby/junk
.ft P
.fi
\- home/bobby/junk
.EE
.UNINDENT
.UNINDENT
.sp

View file

@ -27,12 +27,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-PLACEHOLDERS" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-PLACEHOLDERS" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-placeholders \- Details regarding placeholders
.SH DESCRIPTION
.sp
Repository (or Archive) URLs, \fB\-\-prefix\fP, \fB\-\-glob\-archives\fP, \fB\-\-comment\fP
Repository URLs, \fB\-\-name\fP, \fB\-a\fP / \fB\-\-match\-archives\fP, \fB\-\-comment\fP
and \fB\-\-remote\-path\fP values support these placeholders:
.INDENT 0.0
.TP
@ -47,11 +47,13 @@ The full name of the machine in reverse domain name notation.
.TP
.B {now}
The current local date and time, by default in ISO\-8601 format.
You can also supply your own \fI\%format string\fP, e.g. {now:%Y\-%m\-%d_%H:%M:%S}
You can also supply your own format string <https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-behavior>
, e.g. {now:%Y\-%m\-%d_%H:%M:%S}
.TP
.B {utcnow}
The current UTC date and time, by default in ISO\-8601 format.
You can also supply your own \fI\%format string\fP, e.g. {utcnow:%Y\-%m\-%d_%H:%M:%S}
You can also supply your own format string <https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-behavior>
, e.g. {utcnow:%Y\-%m\-%d_%H:%M:%S}
.TP
.B {user}
The user name (or UID, if no name is available) of the user running borg.
@ -76,11 +78,9 @@ If literal curly braces need to be used, double them for escaping:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg create /path/to/repo::{{literal_text}}
.ft P
.fi
.EX
borg create \-\-repo /path/to/repo {{literal_text}}
.EE
.UNINDENT
.UNINDENT
.sp
@ -88,13 +88,11 @@ Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg create /path/to/repo::{hostname}\-{user}\-{utcnow} ...
borg create /path/to/repo::{hostname}\-{now:%Y\-%m\-%d_%H:%M:%S} ...
borg prune \-\-prefix \(aq{hostname}\-\(aq ...
.ft P
.fi
.EX
borg create \-\-repo /path/to/repo {hostname}\-{user}\-{utcnow} ...
borg create \-\-repo /path/to/repo {hostname}\-{now:%Y\-%m\-%d_%H:%M:%S%z} ...
borg prune \-a \(aqsh:{hostname}\-*\(aq ...
.EE
.UNINDENT
.UNINDENT
.sp

View file

@ -27,90 +27,106 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-PRUNE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-PRUNE" "1" "2025-12-23" "" "borg backup tool"
.SH NAME
borg-prune \- Prune repository archives according to specified rules
borg-prune \- Prune archives according to specified rules.
.SH SYNOPSIS
.sp
borg [common options] prune [options] [REPOSITORY]
borg [common options] prune [options] [NAME]
.SH DESCRIPTION
.sp
The prune command prunes a repository by deleting all archives not matching
any of the specified retention options.
The prune command prunes a repository by soft\-deleting all archives not
matching any of the specified retention options.
.sp
Important: Repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&.
Important:
.INDENT 0.0
.IP \(bu 2
The prune command will only mark archives for deletion (\(dqsoft\-deletion\(dq),
repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&.
.IP \(bu 2
You can use \fBborg undelete\fP to undelete archives, but only until
you run \fBborg compact\fP\&.
.UNINDENT
.sp
This command is normally used by automated backup scripts wanting to keep a
certain number of historic backups. This retention policy is commonly referred to as
\fI\%GFS\fP
GFS <https://en.wikipedia.org/wiki/Backup_rotation_scheme#Grandfather-father-son>
(Grandfather\-father\-son) backup rotation scheme.
.sp
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 (\fB\-\-keep\-X\fP).
.sp
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.
The recommended way to use prune is to give the archive series name to it via the
NAME argument (assuming you have the same name for all archives in a series).
Alternatively, you can also use \-\-match\-archives (\-a), then only archives that
match the pattern are considered for deletion and only those archives count
towards the totals specified by the rules.
Otherwise, \fIall\fP 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.
contents. These need to be distinguished by specifying matching globs.
.sp
If you have multiple sequences of archives with different data sets (e.g.
If you have multiple series 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.
series.
.sp
The \fB\-\-keep\-within\fP option takes an argument of the form "<int><char>",
where char is "H", "d", "w", "m", "y". For example, \fB\-\-keep\-within 2d\fP 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.
The \fB\-\-keep\-within\fP option takes an argument of the form \(dq<int><char>\(dq,
where char is \(dqy\(dq, \(dqm\(dq, \(dqw\(dq, \(dqd\(dq, \(dqH\(dq, \(dqM\(dq, or \(dqS\(dq. For example,
\fB\-\-keep\-within 2d\fP means to keep all archives that were created within
the past 2 days. \(dq1m\(dq is taken to mean \(dq31d\(dq. The archives kept with
this option do not count towards the totals specified by any other options.
.sp
A good procedure is to thin out more and more the older your backups get.
As an example, \fB\-\-keep\-daily 7\fP 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. As of borg
1.2.0, borg will retain the oldest archive if any of the secondly, minutely,
hourly, daily, weekly, monthly, or yearly rules was not otherwise able to meet
its retention target. This enables the first chronological archive to continue
aging until it is replaced by a newer archive that meets the retention criteria.
starts is used for pruning purposes. Dates and times are interpreted in the local
timezone of the system where borg prune runs, and weeks go from Monday to Sunday.
Specifying a negative number of archives to keep means that there is no limit.
.sp
Borg will retain the oldest archive if any of the secondly, minutely, hourly,
daily, weekly, monthly, quarterly, or yearly rules was not otherwise able to
meet its retention target. This enables the first chronological archive to
continue aging until it is replaced by a newer archive that meets the retention
criteria.
.sp
The \fB\-\-keep\-13weekly\fP and \fB\-\-keep\-3monthly\fP rules are two different
strategies for keeping archives every quarter year.
.sp
The \fB\-\-keep\-last N\fP option is doing the same as \fB\-\-keep\-secondly N\fP (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).
.sp
When using \fB\-\-stats\fP, 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.
You can influence how the \fB\-\-list\fP output is formatted by using the \fB\-\-short\fP
option (less wide output) or by giving a custom format using \fB\-\-format\fP (see
the \fBborg repo\-list\fP description for more details about the format string).
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B REPOSITORY
repository to prune
.B NAME
specify the archive name
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
do not change repository
.TP
.B \-\-force
force pruning of corrupted archives, use \fB\-\-force \-\-force\fP in case \fB\-\-force\fP does not work.
.TP
.B \-s\fP,\fB \-\-stats
print statistics for the deleted archive
do not change the repository
.TP
.B \-\-list
output verbose list of archives it keeps/prunes
output a verbose list of archives it keeps/prunes
.TP
.B \-\-short
use a less wide archive part format
.TP
.B \-\-list\-pruned
output verbose list of archives it prunes
.TP
.B \-\-list\-kept
output verbose list of archives it keeps
.TP
.BI \-\-format \ FORMAT
specify format for the archive part (default: \(dq{archive:<36} {time} [{id}]\(dq)
.TP
.BI \-\-keep\-within \ INTERVAL
keep all archives within this time interval
@ -133,57 +149,77 @@ number of weekly archives to keep
.B \-m\fP,\fB \-\-keep\-monthly
number of monthly archives to keep
.TP
.B \-\-keep\-13weekly
number of quarterly archives to keep (13 week strategy)
.TP
.B \-\-keep\-3monthly
number of quarterly archives to keep (3 month strategy)
.TP
.B \-y\fP,\fB \-\-keep\-yearly
number of yearly archives to keep
.TP
.B \-\-save\-space
work slower, but using less space
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
only consider archives matching all patterns. See \(dqborg help match\-archives\(dq.
.TP
.BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB\-\-prefix\fP and \fB\-\-glob\-archives\fP are mutually exclusive.
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
consider archives older than (now \- TIMESPAN), e.g., 7d or 12m.
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g., 7d or 12m.
.UNINDENT
.SH EXAMPLES
.sp
Be careful, prune is a potentially dangerous command, it will remove backup
Be careful: prune is a potentially dangerous command that removes backup
archives.
.sp
The default of prune is to apply to \fBall archives in the repository\fP unless
you restrict its operation to a subset of the archives using \fB\-\-prefix\fP\&.
When using \fB\-\-prefix\fP, be careful to choose a good prefix \- e.g. do not use a
prefix "foo" if you do not also want to match "foobar".
By default, prune applies to \fBall archives in the repository\fP unless you
restrict its operation to a subset of the archives.
.sp
The recommended way to name archives (with \fBborg create\fP) is to use the
identical archive name within a series of archives. Then you can simply give
that name to prune as well, so it operates only on that series of archives.
.sp
Alternatively, you can use \fB\-a\fP/\fB\-\-match\-archives\fP to match archive names
and select a subset of them.
When using \fB\-a\fP, be careful to choose a good pattern — for example, do not use a
prefix \(dqfoo\(dq if you do not also want to match \(dqfoobar\(dq.
.sp
It is strongly recommended to always run \fBprune \-v \-\-list \-\-dry\-run ...\fP
first so you will see what it would do without it actually doing anything.
first, so you will see what it would do without it actually doing anything.
.sp
Do not forget to run \fBborg compact \-v\fP after prune to actually free disk space.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
# 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
$ borg prune \-v \-\-list \-\-dry\-run \-\-keep\-daily=7 \-\-keep\-weekly=4
# 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=\(aq{hostname}\-\(aq /path/to/repo
# actually free disk space:
$ borg compact /path/to/repo
# Similar to the above, but only apply to the archive series named \(aq{hostname}\(aq:
$ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \(aq{hostname}\(aq
# Similar to the above, but apply to archive names starting with the hostname
# of the machine followed by a \(aq\-\(aq character:
$ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \-a \(aqsh:{hostname}\-*\(aq
# 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
$ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \-\-keep\-monthly=\-1
# 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
.ft P
.fi
$ borg prune \-v \-\-list \-\-keep\-within=10d \-\-keep\-weekly=4 \-\-keep\-monthly=\-1
.EE
.UNINDENT
.UNINDENT
.sp

Some files were not shown because too many files have changed in this diff Show more