Compare commits

...

589 commits

Author SHA1 Message Date
Thomas Waldmann
4c131059bc
build_man 2023-12-02 01:02:03 +01:00
Thomas Waldmann
46c1e01d29
build_usage 2023-12-02 01:01:46 +01:00
Thomas Waldmann
8b70bb36c6
update CHANGES 2023-12-02 00:59:58 +01:00
TW
e50d26757c
Merge pull request #7956 from ThomasWaldmann/py313-unistdh-1.2
include unistd.h in _chunker.c
2023-12-02 00:44:59 +01:00
TW
d3e412c7c6
Merge pull request #7957 from ThomasWaldmann/docs-rebuild-refcounts-1.2
docs: Add "check.rebuild_refcounts" message
2023-12-02 00:23:25 +01:00
Sophie Herold
897f88dfaa
docs: Add "check.rebuild_refcounts" message 2023-12-02 00:01:12 +01:00
Felix Schwarz
13c6d1b710
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-12-01 23:58:24 +01:00
TW
b2929b4cee
Merge pull request #7952 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2-maint)
2023-11-29 16:48:38 +01:00
Kevin Yin
bcc8f74b56
Remove period that could be interpreted as part of the command (#7946)
CVE upgrade steps: remove period that could be interpreted as part of the command
2023-11-27 18:12:26 +01:00
Thomas Waldmann
4bdd404949
update CHANGES 2023-11-27 18:08:00 +01:00
TW
70eed5e9fc
Merge pull request #7939 from ThomasWaldmann/lockroster-remove-fix-1.2
LockRoster.modify fix (1.2-maint)
2023-11-18 17:35:22 +01:00
Thomas Waldmann
ec17b00411
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-16 15:59:28 +01:00
zDEFz
2cefe8f53d
Add backup by SERIAL method (#7934)
docs: create disk/partition sector backup by disk serial number
2023-11-13 22:03:09 +01:00
TW
2341ba62d3
Merge pull request #7926 from ThomasWaldmann/update-requirements-1.2
update requirements.d/development.lock.txt
2023-11-09 02:19:51 +01:00
Thomas Waldmann
f08386f699
update requirements.d/development.lock.txt 2023-11-09 00:46:12 +01:00
TW
4e349cf3fa
Merge pull request #7915 from ThomasWaldmann/fix-subcommand-env-1.2
create --*-from-command: run subcommands with a clean environment
2023-11-07 03:42:25 +01:00
Thomas Waldmann
e006a6f368
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-06 17:41:52 +01:00
TW
11af475308
Merge pull request #7913 from ThomasWaldmann/docs-upgrade-chkpt-tam-1.2
CVE-2023-36811 upgrade docs: consider checkpoint archives, fixes #7802
2023-11-06 14:30:36 +01:00
Thomas Waldmann
9c886330d3
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 13:31:02 +01:00
TW
21d67b8295
Merge pull request #7904 from ThomasWaldmann/fix-shadow-index2-1.2
shadow index: add more comments
2023-11-05 01:24:47 +01:00
Thomas Waldmann
2a2b750b9d
shadow index: add more comments 2023-11-05 01:22:07 +01:00
TW
a13504c6d5
Merge pull request #7903 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2-maint)
2023-11-04 18:05:03 +01:00
Thomas Waldmann
d9a0deb227
update CHANGES 2023-11-03 18:43:22 +01:00
TW
686714c366
Merge pull request #7896 from ThomasWaldmann/fix-shadow-index-1.2
fix shadow index update for double-put (1.2-maint)
2023-11-03 14:42:57 +01:00
TW
55ee4e2d28
Merge pull request #7897 from ThomasWaldmann/check-fixes-shadow-index-1.2
check --repair fixes shadow_index (1.2-maint)
2023-11-03 14:42:39 +01:00
TW
cf5c61644b
Merge pull request #7901 from ThomasWaldmann/update-docs-1.2
Update docs (1.2-maint)
2023-11-03 14:35:02 +01:00
Thomas Waldmann
6b928dac93
docs: not only attack/unsafe, can also be a fs issue, fixes #7853 2023-11-01 18:04:24 +01:00
Thomas Waldmann
da4fcc5a66
docs: point to CVE-2023-36811 upgrade steps from borg 1.1 to 1.2 upgrade steps, fixes #7899
also: use 1.2.6 to refer to the fixed version

1.2.5 had issues and was superseded by 1.2.6 just 1 day later,
so we do not need to talk about that.

Also, the docs point out that:
"""
Below, if we speak of borg 1.2.6, we mean a borg version >= 1.2.6 **or** a
borg version that has the relevant security patches for this vulnerability applied
(could be also an older version in that case).
"""

So, it now just talks about "1.2.6" at the relevant places.
2023-11-01 18:04:22 +01:00
Thomas Waldmann
136e3ed1d6
docs: upgrade steps needed for all kinds of repos, fixes #7813
Repos with encryption=none of course can not do real authentication (because there is no secret key material to work with).

But the code always works the same way and such repos also use (and expect) TAMs, so the instructions should be followed in any case.
2023-11-01 18:04:20 +01:00
Thomas Waldmann
a19ebe5ecc
docs: consequences of borg check, fixes #7816 2023-11-01 17:18:32 +01:00
Thomas Waldmann
a7809429b3
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-10-29 01:12:15 +02:00
Thomas Waldmann
48feb28e11
check --repair: test if shadow index is recreated
still failing here, because it is not.
2023-10-29 01:01:17 +02:00
Thomas Waldmann
8a8837e255
shadow index updates: simplify and more comments
no functional change here.
2023-10-28 17:36:10 +02:00
Thomas Waldmann
b21ed3c658
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-10-28 17:17:47 +02:00
Thomas Waldmann
8e6449f28e
test the shadowing-by-double-put behaviour, see #5661
the new test is currently failing due to a bug in the
repository code.
2023-10-28 17:13:13 +02:00
TW
c35cddeb7e
Merge pull request #7892 from ThomasWaldmann/ci-timeout-1.2
CI: increase timeout to 90min
2023-10-28 01:25:33 +02:00
Thomas Waldmann
dff29627dc
CI: increase timeout to 90min
esp. the macOS CI jobs are sometimes rather slow,
so 40min were not enough.
2023-10-27 22:30:52 +02:00
TW
b83525cd4c
Merge pull request #7891 from ThomasWaldmann/sort-by-aliases-1.2
--sort-by: support "archive" as alias of "name", fixes #7873 (1.2-maint)
2023-10-27 22:27:59 +02:00
TW
fa7a6d7095
Merge pull request #7890 from ThomasWaldmann/doc-updates-1.2
doc updates (1.2-maint)
2023-10-27 22:25:59 +02:00
Thomas Waldmann
0e3773d8c7
--sort-by: support "archive" as alias of "name", fixes #7873 2023-10-27 20:46:03 +02:00
TW
75bc62e2ae
Merge pull request #7889 from ThomasWaldmann/udev-uuid-1.2
automated-local.rst: use GPT UUID for consistent udev rule (1.2-maint)
2023-10-27 20:33:57 +02:00
Thomas Waldmann
05cec8b3b0
docs: OS X -> macOS 2023-10-27 20:31:26 +02:00
Thomas Waldmann
7a4d53c2f5
docs: update macOS hint about full disk access 2023-10-27 20:28:57 +02:00
Thomas Waldmann
661e5cccd3
docs: minor fixes/update to notes 2023-10-27 20:27:51 +02:00
Thomas Waldmann
d13b5d5557
docs: remove info about borg 1.0 files per dir 2023-10-27 20:26:27 +02:00
Thomas Waldmann
e0f80812a5
docs: no signature upload on pypi any more
but we upload it on github releases,
so people can check it.
2023-10-27 20:25:29 +02:00
Thomas Waldmann
7640973d6b
docs: CI only on github actions now 2023-10-27 20:23:00 +02:00
azrdev
69d71d99bf
automated-local.rst: Partition table UUID match works for MBR too
not only GPT
2023-10-27 20:15:05 +02:00
azrdev
b61a565fbc
automated-local.rst: use GPT UUID for consistent udev rule 2023-10-27 20:14:50 +02:00
TW
4a8f8bf789
Merge pull request #7886 from ThomasWaldmann/fix-inv-pattern-errorhandling-1.2
Fix arg parsing error handling (1.2-maint)
2023-10-27 20:09:36 +02:00
Thomas Waldmann
5bfa417546
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-10-25 12:06:27 +02:00
Thomas Waldmann
1bd015cdb5
fix invalid pattern argument error msg 2023-10-25 11:06:37 +02:00
Johannes Lade
d482251a3e
Clarify borg prune -a option description (#7871)
Clarify borg prune -a option description.

The -a option for borg prune accepts only glob pattern (i.e. sh:)
but not the actual prefix sh: which can be confusing especially for
people who don't actually know what glob pattern is.
2023-10-14 22:00:19 +02:00
TW
e2ea9b6547
Merge pull request #7864 from ThomasWaldmann/remove-bountysource-badge-1.2
remove bountysource badge (1.2-maint)
2023-10-10 21:01:56 +02:00
Thomas Waldmann
b8d950d097
remove bountysource badge 2023-10-10 20:32:11 +02:00
TW
bc553b1258
Merge pull request #7857 from ThomasWaldmann/misc-updates-1.2
misc. updates (1.2-maint)
2023-10-09 20:57:11 +02:00
Felix Schwarz
90de901ff4
replace "datetime.utcfromtimestamp" with custom helper to avoid deprecation warnings when using Python 3.12 2023-10-09 20:23:10 +02:00
Thomas Waldmann
f72adc9e61
vagrant: use generic/debian9 box, fixes #7579
the debian/stretch64 was broken and never fixed.
2023-10-08 21:53:32 +02:00
Thomas Waldmann
37c3177e90
update development.lock.txt
there was some breakage with py312, so better
use current tooling.
2023-10-08 21:42:04 +02:00
Thomas Waldmann
d6ad508a29
github CI: test on py312 (w/o -dev) 2023-10-08 00:20:31 +02:00
Thomas Waldmann
3c4b1090a6
vagrant: install py312 via pyenv 2023-10-08 00:15:39 +02:00
Thomas Waldmann
9df5e6c139
allow setuptools_scm >= 8 again
8.0.4 got a fix, so we can allow it again.
2023-10-08 00:10:36 +02:00
TW
8c267e5c3c
Merge pull request #7850 from ThomasWaldmann/allow-msgpack107-1.2
allow msgpack 1.0.7 (1.2-maint)
2023-09-28 15:36:54 +02:00
Thomas Waldmann
39761ebadc
allow msgpack 1.0.7 2023-09-28 14:26:48 +02:00
TW
e936d53a66
Merge pull request #7845 from ThomasWaldmann/update-changes-1.2
update CHANGES
2023-09-26 00:03:10 +02:00
Thomas Waldmann
5195fb2dcf
update CHANGES 2023-09-25 17:07:28 +02:00
TW
c9c495db0a
Merge pull request #7839 from ThomasWaldmann/traceback-for-tam-exceptions-1.2
activate tracebacks for TAM exceptions
2023-09-25 16:53:22 +02:00
TW
4188e03ffc
Merge pull request #7844 from ThomasWaldmann/py312-1.2
support python 3.12 (1.2-maint)
2023-09-25 16:45:04 +02:00
Thomas Waldmann
1a24c2fa43
avoid tarfile deprecation warning for py312 2023-09-25 15:36:43 +02:00
Thomas Waldmann
8f820d1f32
add wheel to build-system requirements 2023-09-25 15:34:44 +02:00
Thomas Waldmann
906962b631
setup.py: declare python 3.12 support 2023-09-25 15:33:02 +02:00
Thomas Waldmann
ce274aa11c
test on python 3.12-dev 2023-09-25 15:29:30 +02:00
TW
47e65d9c00
Merge pull request #7842 from ThomasWaldmann/offline-docs2-1.2
offline docs: remove epub, pdf. only build htlmzip.
2023-09-25 15:15:10 +02:00
Thomas Waldmann
377d02c4b2
offline docs: remove epub, pdf. only build htlmzip.
something is broken with these, build fails.
2023-09-25 15:14:26 +02:00
TW
20f9953293
Merge pull request #7841 from ThomasWaldmann/offline-docs-1.2
readthedocs: also build offline docs, fixes #7835 (1.2-maint)
2023-09-25 14:47:52 +02:00
TW
6170ab7d34
Merge pull request #7840 from ThomasWaldmann/allow-msgpack106-1.2
Allow msgpack 1.0.6 (1.2-maint)
2023-09-25 14:47:28 +02:00
Thomas Waldmann
da2b885179
readthedocs: also build offline docs, fixes #7835 2023-09-25 14:24:13 +02:00
Thomas Waldmann
ed87e45bab
use setuptools_scm < 8 for now
https://github.com/pypa/setuptools_scm/issues/938
2023-09-25 14:14:51 +02:00
Thomas Waldmann
93b93abc18
allow msgpack 1.0.6 2023-09-25 14:10:32 +02:00
Thomas Waldmann
6dbfbd6a19
activate tracebacks for TAM exceptions 2023-09-25 11:01:38 +02:00
TW
0c198160f8
Merge pull request #7821 from ThomasWaldmann/vagrant-updates-1.2
vagrant: add VM with debian bookworm
2023-09-12 22:07:41 +02:00
Thomas Waldmann
3d367b0fd3
vagrant: add VM with debian bookworm
this also brings OpenSSL 3.0.x.
2023-09-12 18:41:38 +02:00
TW
83028c0b89
Merge pull request #7820 from ThomasWaldmann/remove-twine-1.2
remove twine from requirements
2023-09-12 17:37:34 +02:00
Thomas Waldmann
1407a2b2fb
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 17:05:02 +02:00
TW
a0069d4b45
Merge pull request #7801 from ThomasWaldmann/fix-upgrade-docs-1.2
docs: minor fix to CVE-2023-36811 related upgrade instructions
2023-09-02 15:53:06 +02:00
Thomas Waldmann
97b8eb2104
docs: minor fix to CVE-2023-36811 related upgrade instructions
while the main issue in the code has been fixed since 1.2.5,
let's better refer to 1.2.6, which has fixes in upgrade docs and code.
2023-09-02 15:47:13 +02:00
TW
ee6a8e2ddf
Merge pull request #7798 from ThomasWaldmann/check-improve-TAM-logging-1.2
check: improve logging for TAM issues, fixes #7797
2023-09-01 22:07:59 +02:00
Thomas Waldmann
7fd91f4bb8
check: improve logging for TAM issues, fixes #7797 2023-09-01 15:35:04 +02:00
TW
65d75c167a
Merge pull request #7792 from ThomasWaldmann/rel126
Release 1.2.6
2023-08-31 23:37:46 +02:00
Thomas Waldmann
98dea3e876
requirements: remove cython restrictions 2023-08-31 01:03:34 +02:00
Thomas Waldmann
c133303243
update CHANGES, incl. upgrade instructions 2023-08-31 01:02:44 +02:00
Thomas Waldmann
d05d02f238
implement BORG_WORKAROUNDS=ignore_invalid_archive_tam, see #7791 2023-08-31 00:36:04 +02:00
TW
7ab28487ce
Merge pull request #7790 from ThomasWaldmann/fix-changelog-markup-1.2
fix changelog markup
2023-08-30 18:41:31 +02:00
Thomas Waldmann
447d0df1bb
fix changelog markup 2023-08-30 18:36:42 +02:00
TW
f7a93b30fa
Merge pull request #7788 from ThomasWaldmann/fix-cve-docs-1.2
fix CVE timeline
2023-08-30 14:41:05 +02:00
Thomas Waldmann
ee33c22443
fix CVE timeline 2023-08-30 14:39:41 +02:00
TW
c8b9d72bdb
Merge pull request from GHSA-8fjr-hghr-4m99
Release 1.2.5 incl. archives TAM security fix
2023-08-30 14:18:17 +02:00
Thomas Waldmann
509a5fd71c
build_usage / build_man 2023-08-30 03:49:47 +02:00
Thomas Waldmann
ed1ab84cc7
update CHANGES 2023-08-30 03:47:35 +02:00
Thomas Waldmann
9e63abb679
document vulnerability, repo upgrade procedure 2023-08-30 02:52:34 +02:00
Thomas Waldmann
5e0632a3d0
add tests for archive TAMs, upgrade 2023-08-30 02:52:32 +02:00
Thomas Waldmann
d78ed697ae
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 02:52:27 +02:00
Thomas Waldmann
85b173d3d1
TAM msgs: be more specific: archives vs. manifest 2023-08-30 02:52:23 +02:00
Thomas Waldmann
7d0d11b979
upgrade: allow enable/disable manifest TAM for unencrypted repos
Recent borg wrote TAM authenticated **archives**
even for unencrypted repos (encryption "none"),
so we also do that for the manifest.

It's kind of fake as there is no secret key involved then,
but it simplifies the code.
2023-08-30 02:52:21 +02:00
Thomas Waldmann
19a7809fe8
upgrade --archives-tam: make sure all archives are TAM authenticated
borg check (rebuild_manifest and rebuild_refcounts) drops archives without TAM,
so let's just always add the TAM.

for unencrypted repos (encryption=none) the TAM is insecure,
but without encryption and authentication, there is no expectation
of security anyway.
2023-08-30 02:52:17 +02:00
Thomas Waldmann
75518d945c
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 02:52:15 +02:00
Thomas Waldmann
155d8ee23b
cache sync: check archive TAM 2023-08-30 02:52:13 +02:00
Thomas Waldmann
7da8738513
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 02:51:52 +02:00
Thomas Waldmann
1fd94bd38f
check: rebuild_manifest must verify archive TAM 2023-08-29 21:59:04 +02:00
TW
8ae06199ef
Merge pull request #7784 from ThomasWaldmann/vagrant-updates-1.2
Vagrant updates (1.2-maint)
2023-08-29 20:49:13 +02:00
Thomas Waldmann
de51c67085
vagrant: fix netbsd pkgsrc
9.0_current stopped working, let's use 9.3.
2023-08-29 19:45:39 +02:00
Thomas Waldmann
055fb76bd8
vagrant / binary build: use python 3.9.18 2023-08-29 19:44:30 +02:00
TW
9133cf5f36
Merge pull request #7783 from ThomasWaldmann/rel-prep-1.2
build_man / build_usage
2023-08-29 18:50:04 +02:00
Thomas Waldmann
62ca4f666b
build_man / build_usage 2023-08-29 18:48:41 +02:00
TW
a034febe55
Merge pull request #7782 from ThomasWaldmann/update-changes-1.2
update CHANGES
2023-08-29 18:34:10 +02:00
Thomas Waldmann
7f07f81e39
update CHANGES 2023-08-29 18:24:56 +02:00
TW
186b3d1319
Merge pull request #7781 from ThomasWaldmann/cy029-1.2
require cython <3 for now
2023-08-29 16:15:33 +02:00
Thomas Waldmann
f8673a379c
require cython <3 for now
also in requirements.d/development.txt.
2023-08-29 16:09:08 +02:00
TW
844ca6b61e
Merge pull request #7772 from ThomasWaldmann/cython029-1.2
use cython 0.29 (1.2-maint)
2023-08-26 14:44:54 +02:00
Thomas Waldmann
37a813f7f8
stay on latest Cython 0.29 (0.29.36) for borg 1.2.x
master branch tests Cython 3 now.
1.2-maint branch may or may not upgrade to build with Cython 3 later.
2023-08-26 14:18:23 +02:00
TW
0493695b6c
Merge pull request #7769 from ThomasWaldmann/docs-fix-rcreate-1.2
docs: fix borg init command in environment.rst.inc
2023-08-24 12:04:38 +02:00
Thomas Waldmann
276781081b
docs: fix borg init command in environment.rst.inc
It mentioned borg rcreate due to a bad backport from master.
Must be borg init in borg 1.2.x.
2023-08-24 11:49:17 +02:00
TW
f6e20fb07c
Merge pull request #7751 from ThomasWaldmann/fix-unreadable-parent-of-root-fixup-1.2
remove unused "flags_root" open flags
2023-07-30 01:18:40 +02:00
Thomas Waldmann
de7e7e2a95
remove unused "flags_root" open flags 2023-07-29 23:42:36 +02:00
TW
ef52d13608
Merge pull request #7749 from ThomasWaldmann/fix-unreadable-parent-of-root-1.2
do not try to read parent dir of recursion root (1.2-maint)
2023-07-29 23:38:28 +02:00
Thomas Waldmann
ed7a410084
create: do not try to read parent dir of recursion root, fixes #7746 2023-07-29 23:04:44 +02:00
Thomas Waldmann
453d35fa47
add a test for unreadable parent dir, see #7746 2023-07-29 22:48:13 +02:00
TW
a3f4adf899
Merge pull request #7732 from ThomasWaldmann/update-docs-1.2
update docs 1.2
2023-07-23 15:08:31 +02:00
Thomas Waldmann
dedbd38844
1.1.x upgrade notes: more precise borg upgrade instructions, fixes #3396 2023-07-22 18:08:35 +02:00
Thomas Waldmann
b419b6ad03
build_man / build_usage 2023-07-20 18:57:22 +02:00
Thomas Waldmann
65a2fe8502
update CHANGES 2023-07-20 18:54:55 +02:00
TW
aa913cda83
Merge pull request #7731 from ThomasWaldmann/authenticated_no_key-fix-1.2
bugfix: skip TAM check with BORG_WORKAROUNDS=authenticated_no_key
2023-07-20 18:34:05 +02:00
Thomas Waldmann
104cc196fc
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 18:02:58 +02:00
TW
b067aeadef
Merge pull request #7723 from PhrozenByte/docs-check-rewrite-1.2
Backport: Docs: Rewrite `borg check` docs
2023-07-11 00:49:20 +02:00
Daniel Rudolf
c6a6161c60
Docs: Rewrite borg check docs
This commit is a backport of the following commits to the `1.2-maint` branch:

    commit 9edbf4e931
    Author: Daniel Rudolf

        Docs: Rewrite `borg check` docs

    commit 9d59146de4
    Author: Daniel Rudolf

        Docs: Remove technical description from `borg check` docs

    commit a661da13ee
    Author: Daniel Rudolf

        Docs: Improve explanation of `borg check --max-duration`'s side effects

    commit 2647673dc8
    Author: Daniel Rudolf

        Docs: Improve `borg check` docs
2023-07-10 23:03:47 +02:00
TW
4721a35863
Merge pull request #7702 from ThomasWaldmann/authenticated-no-key-1.2
BORG_WORKAROUNDS=authenticated_no_key, fixes #7700
2023-07-07 01:02:41 +02:00
TW
c79e970b78
Merge pull request #7717 from FelixSchwarz/borg12-py312
add `utcnow()` helper function to avoid `datetime.utcnow()`
2023-07-06 23:45:58 +02:00
Felix Schwarz
98f547f278 add utcnow() helper function to avoid datetime.utcnow()
`datetime.utcnow()` is deprecated since Python 3.12. This causes additional lines of
output and thus breaks the test suite. I was not sure if all borg internals are
ready to deal with timezone-aware datetime instances so tried to keep the changes
minimal.
2023-07-06 21:44:09 +02:00
TW
e5cc2e16e3
Merge pull request #7709 from TimWolla/backport-doc-keep-within
Backport: Improve the documentation for `--keep-within`
2023-07-04 14:11:55 +02:00
Tim Düsterhus
b58c6ce3b1 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

(cherry picked from commit a6f452a050)
2023-07-04 09:16:39 +02:00
TW
dfa04eece6
Merge pull request #7704 from ThomasWaldmann/remove-coala-1.2
remove coala (outdated)
2023-07-03 19:11:27 +02:00
Thomas Waldmann
ae7fd9b101
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-03 18:40:52 +02:00
Thomas Waldmann
8ac7178ab9
BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos without key, fixes #7700 2023-07-03 15:38:21 +02:00
TW
6b0dc53f11
Merge pull request #7693 from ThomasWaldmann/docs-1.2
docs updates (1.2-maint)
2023-07-01 15:07:04 +02:00
Thomas Waldmann
d01852c100
update CHANGES 2023-07-01 14:49:28 +02:00
Thomas Waldmann
6d9e8e5483
docs: move upgrade notes to own section, see #7546 2023-07-01 14:43:44 +02:00
Thomas Waldmann
55af769b71
mount -olocal: how to show mount in finder's sidebar, fixes #5321 2023-07-01 14:43:35 +02:00
TW
98cea7516b
Merge pull request #7691 from ThomasWaldmann/macfuse-volname-1.2
mount: make up volname if not given (macOS), fixes #7690
2023-07-01 14:41:14 +02:00
TW
230065f52b
Merge pull request #7694 from ThomasWaldmann/fix-4110-1.2
extract: fix false warning about pattern never matching, fixes #4110
2023-07-01 14:40:24 +02:00
Thomas Waldmann
f5f5311e2b
extract: fix false warning about pattern never matching, fixes #4110 2023-07-01 02:05:58 +02:00
Thomas Waldmann
7c82969761
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-06-30 22:10:32 +02:00
TW
de53164931
Merge pull request #7689 from ThomasWaldmann/diff-surrogate-escape-1.2
diff: remove surrogates before output, fixes #7535
2023-06-30 17:52:26 +02:00
Thomas Waldmann
c587e88830
diff: remove surrogates before output, fixes #7535 2023-06-30 17:10:56 +02:00
TW
a0bc7b9434
Merge pull request #7683 from ThomasWaldmann/fix-repo-reopen-1.2
tests: fix repo reopen 1.2 (backport from master)
2023-06-28 00:24:41 +02:00
Thomas Waldmann
fbf287f825
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-06-27 22:43:00 +02:00
Thomas Waldmann
0ac07b7a3f
RepositoryTestCaseBase: call __exit__
As we call __enter__ in setUp,
let's call __exit__ in tearDown.
2023-06-27 22:34:11 +02:00
Thomas Waldmann
83b2b5cb6c
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-06-27 22:33:57 +02:00
TW
0947e9fb22
Merge pull request #7680 from ThomasWaldmann/improve-key-sanity-check-1.2
keyfile: improve key sanity check, fixes #7561
2023-06-27 22:32:30 +02:00
TW
edc9a0843a
Merge pull request #7682 from ThomasWaldmann/test-cosmetics-1.2
tests: avoid long ids in pytest output
2023-06-27 22:30:16 +02:00
Thomas Waldmann
81588989fe
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-06-27 21:50:51 +02:00
Thomas Waldmann
a5801b9971
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-27 21:39:43 +02:00
TW
1da5beacb3
Merge pull request #7678 from ThomasWaldmann/fix-crash-files-cache-size-1.2
--files-cache=size: fix crash, fixes #7658
2023-06-27 21:36:49 +02:00
TW
c7d5fff200
Merge pull request #7679 from ThomasWaldmann/pypi-no-upload-signature-1.2
do not upload gpg signature to pypi, fixes #7649
2023-06-27 21:36:05 +02:00
TW
f6805f3850
Merge pull request #7681 from ThomasWaldmann/fix-list-pattern-docs-1.2
list: fix --pattern examples, fixes #7611
2023-06-27 21:35:41 +02:00
Thomas Waldmann
893530fdac
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-27 21:00:05 +02:00
Thomas Waldmann
de643c211b
do not upload gpg signature to pypi, fixes #7649 2023-06-27 18:45:41 +02:00
Thomas Waldmann
45aa88dbec
--files-cache=size: fix crash, fixes #7658 2023-06-27 18:40:48 +02:00
TW
f73eb5c6c2
Merge pull request #7644 from eoli3n/1.2-maint
Backport of improvements in patterns help
2023-06-11 17:10:47 +02:00
eoli3n
91547e9844 improve patterns help: declarative includes sample 2023-06-11 11:14:24 +02:00
eoli3n
099f23032e improve patterns help: added pattern prefixes 2023-06-11 11:12:49 +02:00
eoli3n
3e8b0da8be improve patterns help: define a pattern style 2023-06-11 11:09:41 +02:00
eoli3n
952d778bc1 Improve patterns help 2023-06-11 11:08:31 +02:00
TW
c5d579be39
Merge pull request #7628 from ThomasWaldmann/fix-chunksize-distrib-test-1.2
fix test_buzhash_chunksize_distribution
2023-06-06 11:25:11 +02:00
Thomas Waldmann
796d8e2d13
fix test_buzhash_chunksize_distribution
the last chunk can be smaller than 2**min_exp.
2023-06-06 10:46:53 +02:00
TW
742d0df294
Merge pull request #7613 from ThomasWaldmann/1.2-clear-empty-dirs-typo
fix typo
2023-05-29 15:22:15 +02:00
Thomas Waldmann
e711df20e2
fix typo 2023-05-29 14:56:47 +02:00
TW
0bfbd8d8fc
Merge pull request #7595 from nain-F49FF806/1.2-clear-empty-dirs
clear empty directories at end of compact process, fixes #6823
2023-05-27 11:04:13 +02:00
nain
aac55b1ad2 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-27 04:41:50 -04:00
TW
912dc81a2d
Merge pull request #7606 from nain-F49FF806/data-scandir-unify
unify scanning and listing of segment dirs, files and apply good practices
2023-05-27 10:31:36 +02:00
nain
edb5e749f5 Move value bounds of segment (index) into constants module and use them instead 2023-05-27 02:33:53 -04:00
nain
3f2da1bba9 Simplify generator functions and make get_segment_dirs inputs consistent with get_segment_files
+ get_segment_dirs explicitly takes data_dir for clarity and future flexibility
+ removed multiple cases for one general purpose generator expression
2023-05-26 02:42:13 -04:00
nain
c9f35a16e9 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
+ Have seperate generators to avoid unnecessary less_than / greater_than checking for every dir/file when not required

Resolves #7597
2023-05-25 11:55:16 -04:00
TW
53bedfb63b
Merge pull request #7589 from ThomasWaldmann/chunker-params-1.2
relax chunker params validation, tests (1.2-maint)
2023-05-19 19:19:04 +02:00
Thomas Waldmann
5cc4e3af6a
tests: only warn about "invalid" chunker params, fixes #7590
we previously allowed some weird chunker params, so we just warn
about them instead of rejecting them.

e.g. one could use super small chunk sizes. borg can do that,
but you'll end up with a huge amount of chunks and very large
hash tables (RAM usage) to manage them.

also, one can violate the min <= mask <= max chunker param condition
as in #7590 and it will somehow work, but will likely not dedup as good
as when not violating that.

borg2 **will** reject such strange chunker params, see #7586 for
some ideas how to "fix" your repos.
2023-05-19 18:05:26 +02:00
Thomas Waldmann
965e8a957f
tests: check buzhash chunksize distribution, see #7586 2023-05-19 18:05:20 +02:00
TW
ce50796b1f
Merge pull request #7568 from elandorr/1.2-maint
incl./excl. options, path-from-stdin exclusiveness
2023-05-15 21:48:29 +02:00
elandorr
8e41831f4c
Update archiver.py 2023-05-15 11:39:10 +00:00
elandorr
dedd58969c
mention paths-from-stdin's exclusiveness 2023-05-14 20:28:52 +00:00
elandorr
4047076e70
include/exclude options 2023-05-14 20:21:41 +00:00
TW
823f0fb9e0
Merge pull request #7564 from elandorr/1.2-maint
doc markup fixes
2023-05-14 18:58:42 +02:00
elandorr
6b38207aeb
markup fix + note about MAX_DATA_SIZE 2023-05-14 07:57:12 +00:00
elandorr
f1bd5da8c9
escape 2023-05-14 07:50:27 +00:00
TW
dbc142a32a
Merge pull request #7549 from sashadev-sky/fix-progress-msg-width-1.2
ProgressIndicatorPercent: fix space computation for wide chars, fixes #3027
2023-05-08 19:46:17 +02:00
Thomas Waldmann
21a9458848 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).

(cherry picked from commit 3dd14f4855)
2023-05-08 12:44:05 -04:00
TW
2181103c3f
Merge pull request #7550 from sashadev-sky/fix-argparse-errors-1.2
Fix argparse error messages
2023-05-08 15:39:11 +02:00
TW
1d4a7803dd
Merge pull request #7547 from sashadev-sky/issue-7476-1.2
Added pre-commit for linting purposes. Fixes #7476
2023-05-08 15:28:51 +02:00
Thomas Waldmann
3e9668ecbc fix CompressionSpec validator and tests
(cherry picked from commit 0b40e038ad)
2023-05-07 21:03:56 -04:00
Thomas Waldmann
de199c23ab fix SortBySpec validator
(cherry picked from commit 05bf29f504)
2023-05-07 21:01:10 -04:00
Thomas Waldmann
7707ea538c fix FilesCacheMode validator
(cherry picked from commit 0f923c8c4a)
2023-05-07 21:00:20 -04:00
Thomas Waldmann
067e36bccc fix ChunkerParams validator and tests
(cherry picked from commit 6d38530ff1)
2023-05-07 20:59:17 -04:00
Sasha Boginsky
5b5e9282e3 Remove black formatting from cherry-pick 2023-05-07 18:52:42 -04:00
TW
d1ddd57eaf
Merge pull request #7548 from sashadev-sky/option-x-help-1.2
improve --one-file-system help /docs
2023-05-06 20:35:59 +02:00
Thomas Waldmann
49b58bfbab --one-file-system: add macOS apfs notes, fixes #4876
(cherry picked from commit b7adee65bd)
2023-05-06 03:00:08 -04:00
Thomas Waldmann
8cbaaf6113 improve --one-file-system help string, fixes #5618
(cherry picked from commit 6ca1ed9716)
2023-05-06 02:59:14 -04:00
Michael Deyaso
172b03ef4d Changed black rev in pre-commit yaml. Fixes #7476
(cherry picked from commit 20a4c960ec)
2023-05-05 23:51:14 -04:00
Michael Deyaso
9e7b20660b Installed and configured pre-commit to lint and format code. Fixes #7476
(cherry picked from commit 98d1c65b40)
2023-05-05 23:51:09 -04:00
TW
0067077f7a
Merge pull request #7480 from ThomasWaldmann/update-codeql-1.2
codeql action: upgrade to v2 (1.2-maint)
2023-03-27 20:07:28 +02:00
Thomas Waldmann
54d8636a2d
codeql action: upgrade to v2 2023-03-27 16:28:19 +02:00
TW
7d649faea1
Merge pull request #7466 from ThomasWaldmann/rel124
release 1.2.4
2023-03-23 23:24:34 +01:00
Thomas Waldmann
35d76f9a64
build_man 2023-03-23 22:11:46 +01:00
Thomas Waldmann
0d14f3b36f
build_usage 2023-03-23 22:11:45 +01:00
Thomas Waldmann
b81b1abdeb
it's 2023! 2023-03-23 22:11:44 +01:00
Thomas Waldmann
73ee704afa
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.
2023-03-23 22:11:42 +01:00
Thomas Waldmann
391e05a6c6
change log: set release date, remove outdated stuff 2023-03-23 22:11:41 +01:00
Thomas Waldmann
af16e19933
update CHANGES 2023-03-23 22:10:22 +01:00
TW
05bfed50c3
Merge pull request #7471 from Michael-Girma/bug/issue-7470
Resolved mode bug and added sleep clause for darwin systems. Fixes #7470
2023-03-23 21:29:56 +01:00
Michael Deyaso
ea08161fe8 Resolved mode bug and added sleep clause for darwin systems. Fixes #7470 2023-03-23 21:39:55 +03:00
TW
de2f894bcc
Merge pull request #7464 from ThomasWaldmann/docs-borg-key-file-1.2
BORG_KEY_FILE: clarify docs, fixes #7444
2023-03-22 22:33:42 +01:00
TW
4c230a52e6
Merge pull request #7465 from dotdoom/1.2-maint-ignorezeros
Add --ignore-zeros flag to import-tar
2023-03-22 22:31:37 +01:00
Artem Sheremet
3b7c0605af Add --ignore-zeros flag to import-tar
Fixes #7432.

Backport of #7460.
2023-03-22 18:59:58 +01:00
Thomas Waldmann
e6b8e03e19
BORG_KEY_FILE: clarify docs, fixes #7444 2023-03-22 18:52:58 +01:00
TW
671c66361d
Merge pull request #7456 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2-maint)
2023-03-20 23:00:03 +01:00
Thomas Waldmann
3cffbbd3af
update CHANGES 2023-03-20 22:10:49 +01:00
TW
2ab678ca93
Merge pull request #7414 from Michael-Girma/backport/1.2-maint-7248
Show ctime and mtime on borg diff, fixes #7248 (Backport of #7335)
2023-03-20 14:14:30 +01:00
Michael Deyaso
19bb27741d bugfix: Fixes path related bug seen when addressing deferred items. 2023-03-20 07:28:59 +03:00
TW
62080a5737
Merge pull request #7441 from ThomasWaldmann/vagrant-updates2-1.2
Vagrant updates2 (1.2-maint)
2023-03-13 09:56:20 +01:00
Thomas Waldmann
cfd6f035ff
vagrant: use pythons working on freebsd
pyenv could not install py38, thus using the fbsd system py38.

removed py38 from pyenv completely.
2023-03-13 04:05:24 +01:00
Thomas Waldmann
96dff54655
vagrant: freebsd: kldload fusefs 2023-03-13 00:56:09 +01:00
TW
6354e4ada4
Merge pull request #7435 from ThomasWaldmann/freebsd-xattr-fixes-1.2
xattrs: fix namespace processing on FreeBSD, fixes #6997
2023-03-13 00:54:13 +01:00
Thomas Waldmann
bd299f1ff3
xattrs: fix namespace processing on FreeBSD, fixes #6997 2023-03-12 23:35:52 +01:00
TW
f623742709
Merge pull request #7439 from ThomasWaldmann/vagrant-updates-1.2
Vagrant updates (1.2-maint)
2023-03-12 23:34:22 +01:00
Thomas Waldmann
e3f887414b
vagrant: pyenv: also install python 3.11.1 for testing 2023-03-12 23:07:11 +01:00
Thomas Waldmann
96a8a98d97
vagrant: pyenv: use python 3.10.1, 3.10.0 build is broken on freebsd 2023-03-12 23:06:57 +01:00
Thomas Waldmann
fc0c594ff6
vagrant: local freebsd 12.1 box -> generic/freebsd13 box
Building in the 12.1 box stopped working, thus replaced it
with the same box as we use in master.
2023-03-12 23:06:50 +01:00
TW
0a61c7b767
Merge pull request #7428 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2-maint)
2023-03-11 19:17:52 +01:00
TW
c9190fe867
Merge pull request #7434 from ThomasWaldmann/remove-os-directory-1.2
docs: remove OS directory from install docs
2023-03-11 19:15:58 +01:00
Thomas Waldmann
f2825a96d2
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:52:58 +01:00
TW
019a999364
Merge pull request #7429 from abebeos/1.2-maint
docs: installation: add link to OS dependencies
2023-03-11 01:16:36 +01:00
abebeos
9e464edb7c docs: installation: add link to OS dependencies 2023-03-10 22:39:30 +00:00
Thomas Waldmann
cd35e22d06
update CHANGES 2023-03-10 22:46:10 +01:00
TW
134583a7bf
Merge pull request #7412 from ThomasWaldmann/hardlink-master-bug-1.2
set .hardlink_master for hardlinkable items, fixes #7175
2023-03-10 19:49:12 +01:00
TW
7643f39901
Merge pull request #7419 from ThomasWaldmann/msgpack105-1.2
allow msgpack 1.0.5 also
2023-03-09 22:20:22 +01:00
Thomas Waldmann
2842463f21
allow msgpack 1.0.5 also 2023-03-09 17:58:57 +01:00
Michael Deyaso
6c042d7192 Show ctime and mtime on borg diff. Fixes #7248
---

- Added assert_line_exists helper in BaseTestCase
- JSON strings in diff output are now sorted alphabetically
- Modified diff test cases to confirm to new output format
- Added a test case to test ctime and mtime inclusion
- Mode, ctime & mtime are now only displayed on diff if --content-only flag is used
2023-03-07 10:54:29 +03:00
Thomas Waldmann
843c12cbea
set .hardlink_master for hardlinkable items, fixes #7175
before, we only set this for regular files, but we better also set this
for block/char devices and fifos also, so we have it for all item types
borg 1.x considers "hardlinkable".

this is important for sequential processing of items in an archive:
if we encounter a hardlinkable item and .source is not set (that
would make it a hardlink slave), it could be a hardlink master or not:

- hardlink_master == False  # this item is not part of a hl group
- hardlink_master == True  # this item is a hardlink master

This will also be important when items are converted to borg2.
2023-03-05 19:20:22 +01:00
TW
d44cf3482e
Merge pull request #7402 from ThomasWaldmann/unicode-filenames-docs-1.2
update FAQ about locale/unicode issues, fixes #6999
2023-03-05 17:48:55 +01:00
TW
d5e4f3f8cf
Merge pull request #7404 from ThomasWaldmann/mount-docs-1.2
docs: improve mount options rendering, fixes #7359
2023-03-05 17:48:01 +01:00
TW
ca1fea37a6
Merge pull request #7410 from snsmac/backport/autocompressortests
"auto" compressor tests: don't assume a specific size (backport to 1.2-maint)
2023-03-05 17:22:45 +01:00
TW
831c9d0c40
Merge pull request #7408 from snsmac/backport/hashindex
hashindex bugfix and refactoring (backport to 1.2-maint)
2023-03-05 15:29:50 +01:00
Thomas Waldmann
8cf313900a "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-05 11:05:47 +01:00
Thomas Waldmann
a7ce1db529 add num_entries assertion 2023-03-05 11:01:44 +01:00
Thomas Waldmann
f1d68fe4b3 hashindex: simplify size_idx function
Thanks to @jdchristensen for the code.
2023-03-05 11:01:44 +01:00
Thomas Waldmann
d57fafadad Simplify full HT scan assertion 2023-03-05 11:01:44 +01:00
Thomas Waldmann
ec32413b5e hashindex: always have at least 1 empty bucket
avoid rounding / integer conversion issues bringing this down to 0.
2023-03-05 11:01:44 +01:00
Thomas Waldmann
241eaec413 implement ht idx wrap around less strangely, add comment 2023-03-05 11:01:44 +01:00
Thomas Waldmann
51189e1383 if HT is full with entries and tombstones: give up/fail early 2023-03-05 11:01:44 +01:00
Thomas Waldmann
32519617b6 more comments for hashindex_lookup 2023-03-05 11:01:44 +01:00
Thomas Waldmann
3a44894aca bugfix: do not resize hashindex with wrong num_empty
otherwise we would lose the decrement operation on num_empty.
2023-03-05 11:01:44 +01:00
Thomas Waldmann
ecf5ad43ed hashindex: simplify assert 2023-03-05 11:01:44 +01:00
Thomas Waldmann
b2117bfd4f _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-03-05 11:01:44 +01:00
TW
cef5b446ac
Merge pull request #7411 from ThomasWaldmann/debug-id-hash-command-1.2
debug id-hash: implement file content id-hash computation, see #7406
2023-03-04 22:33:20 +01:00
TW
42fb72c022
Merge pull request #7409 from snsmac/backport/hashtablestress
Add hashtable stress test (backport to 1.2-maint)
2023-03-04 22:14:47 +01:00
Thomas Waldmann
eb8ccd22d4
debug id-hash: implement file content id-hash computation, see #7406 2023-03-04 21:47:14 +01:00
snsmac
c339d2e9e2 Update hashtable stress test to work with borg < 2 where NSIndex has 2-tuples as values 2023-03-04 21:41:31 +01:00
TW
086a4237ca
Merge pull request #7407 from ThomasWaldmann/fix-debug-cmds-1.2
fix borg debug get-obj/put-obj (1.2-maint)
2023-03-04 21:21:09 +01:00
Thomas Waldmann
356ba3cc79
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: fix error handling in get-obj.
2023-03-04 20:25:45 +01:00
Thomas Waldmann
8fe980c94e "auto" compressor tests: don't assume a specific size, fixes #7363
The tests assumed a specific compressed results size, which
is bad, because it might vary depending on the zlib implementation.

Now the "auto" compressor tests just check if it is the same size
as when unconditionally using the zlib compressor.
2023-03-04 20:19:08 +01:00
Thomas Waldmann
b7d70f2064 add comment about how to provoke more collisions 2023-03-04 20:09:58 +01:00
Thomas Waldmann
b33fea7718 add hashtable stress tests
Using NSIndex (repo index) HashIndex, but they all are very similar.
2023-03-04 20:09:50 +01:00
Thomas Waldmann
d739f29657
docs: improve mount options rendering, fixes #7359 2023-03-04 17:08:15 +01:00
Thomas Waldmann
e8573193e4
update FAQ about locale/unicode issues, fixes #6999 2023-03-04 16:32:48 +01:00
TW
6e8c58c125
Merge pull request #7395 from helmutg/reproducible-docs-1.2
Make timestamps in manual pages reproducible
2023-03-01 09:20:20 +01:00
Vagrant Cascadian
a5c9231e88 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>

(cherry picked from commit 98352cf667)
2023-02-28 13:38:45 +01:00
TW
a7a80ffe90
Merge pull request #7382 from ThomasWaldmann/rtd-config-1.2
add .readthedocs.yaml
2023-02-25 18:51:51 +01:00
Thomas Waldmann
fd6e76e6a4
add .readthedocs.yaml
same as in master branch
2023-02-25 18:42:49 +01:00
TW
836bd0339d
Merge pull request #7361 from voegelas/1.2-maint-fedora
Installation: Update Fedora in distribution list
2023-02-17 18:58:50 +01:00
Andreas Vögele
007b73ac67 Installation: Update Fedora in distribution list
Fixes #7357
2023-02-17 14:45:17 +01:00
TW
1dce595d8f
Merge pull request #7338 from ThomasWaldmann/timestamp-comparisons-1.2
relaxed timestamp comparisons (1.2)
2023-02-11 00:19:08 +01:00
TW
e41466dbb3
Merge pull request #7337 from ThomasWaldmann/fix-recreate-rechunkify-1.2
recreate without --chunker-params shall not rechunk (1.2)
2023-02-10 18:37:11 +01:00
Thomas Waldmann
6bf818a2a1
tests: use same_ts_ns for all timestamp comparisons 2023-02-10 18:36:10 +01:00
Thomas Waldmann
b3da30e6d4
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-10 17:58:46 +01:00
Thomas Waldmann
cd23d810d3
recreate: --chunker-params must default to None, fixes #7337
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-10 14:12:08 +01:00
Thomas Waldmann
dbe1c98cb3
tests: recreate without --chunker-params shall not rechunk 2023-02-10 14:01:04 +01:00
TW
5ccfaa7a45
Merge pull request #7299 from ThomasWaldmann/test-dir-mtime-1.2
add test for extracted directory mtime
2023-01-28 00:59:59 +01:00
Thomas Waldmann
b472768b57
more directory timestamp tests 2023-01-24 15:58:30 +01:00
Thomas Waldmann
2291ab755d
add test for extracted directory mtime 2023-01-24 15:22:01 +01:00
TW
48713ebff6
Merge pull request #7265 from ThomasWaldmann/fix-locking-1.2
Fix locking (1.2-maint)
2023-01-19 18:15:28 +01:00
TW
dbba9cbc53
Merge pull request #7268 from ThomasWaldmann/recreate-with-target-1.2
recreate: when --target is given, do not detect "nothing to do"
2023-01-16 17:22:50 +01:00
Thomas Waldmann
c43140686b
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:28:57 +01:00
Thomas Waldmann
16eb38e20a
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:36:50 +01:00
Thomas Waldmann
91104674e7
use os.replace not os.rename 2023-01-13 22:32:11 +01:00
Thomas Waldmann
804867d3ad
bugfix: thread id must be parsed as hex from lock file name 2023-01-13 22:30:28 +01:00
TW
1dcaa74788
Merge pull request #7252 from puetzk/test_size_on_disk_accurate-flush-1.2
[1.2-maint] Fix test_size_on_disk_accurate for large st_blksize, fixes #7250
2023-01-12 20:52:48 +01:00
Kevin Puetz
fe3775cf80 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 8ddfd94f09)
- 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:19:43 -06:00
TW
2336c4b5a6
Merge pull request #7256 from ThomasWaldmann/docs-libb2-1.2
remove BORG_LIBB2_PREFIX (not used any more)
2023-01-10 14:24:38 +01:00
Thomas Waldmann
47e0f9bcb0
remove BORG_LIBB2_PREFIX (not used any more)
the code now uses hashlib.blake2b from python stdlib.
2023-01-10 14:09:28 +01:00
TW
1ac19b034b
Merge pull request #7242 from ThomasWaldmann/upgrade-cython-1.2
upgrade Cython to 0.29.33
2023-01-06 22:04:18 +01:00
TW
32b5f44bbb
Merge pull request #7235 from ThomasWaldmann/macos-resourcefork-mtime-1.2
extract: fix mtime when ResourceFork xattr is set (macOS specific)
2023-01-06 21:41:29 +01:00
Thomas Waldmann
497eca0faf
upgrade Cython to 0.29.33 2023-01-06 21:39:22 +01:00
Thomas Waldmann
b96781b9dd
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.
2022-12-30 00:08:06 +01:00
Thomas Waldmann
c095e2ef61
macOS: test correct timestamp extraction if ResourceFork xattr is present, see #7234 2022-12-30 00:08:04 +01:00
TW
4ca090bb8c
Merge pull request #7229 from ThomasWaldmann/update-requirements-1.2
update development.lock.txt
2022-12-27 20:31:28 +01:00
Thomas Waldmann
3837e0233d
update development.lock.txt
including a setuptools security fix, see #7227

also:
- cosmetic change in development.txt to have same order
- removed exclusion of broken Cython release (outdated since long)
2022-12-27 19:32:20 +01:00
TW
06716a7971
Merge pull request #7224 from ThomasWaldmann/rel123
release 1.2.3
2022-12-24 23:25:57 +01:00
Thomas Waldmann
ae8b0eb3e4
avoid git complaining about dubious ownership
this lead to breakage of setuptools_scm, it could not
determine the borg version under fakeroot due to this
git / ownership issue.
2022-12-24 18:15:49 +01:00
Thomas Waldmann
795a553675
build_man 2022-12-24 18:09:33 +01:00
Thomas Waldmann
ec49d60d1f
build_usage 2022-12-24 18:09:32 +01:00
Thomas Waldmann
e4cbd28bdd
update CHANGES 2022-12-24 18:09:30 +01:00
Thomas Waldmann
ffd6d51b2c
fix xattr tests
while fixing #6988, some strings were changed, but the tests not adapted:

a758fda089
2022-12-24 18:09:28 +01:00
TW
ab0f0d24fd
Merge pull request #7223 from ThomasWaldmann/fix-docs-prefix-1.2
Fix docs / tests concerning deprecated --prefix (1.2-maint)
2022-12-24 15:10:56 +01:00
Thomas Waldmann
90a937e1ed
remove deprecated --prefix from docs, fixes #7109
also:

- rather mention --glob-archives
- rather test --glob-archives
2022-12-24 14:44:05 +01:00
TW
2f78e545e0
Merge pull request #7222 from ThomasWaldmann/vagrant-updates
Vagrant updates
2022-12-24 04:40:08 +01:00
Thomas Waldmann
aa2c2a4e34
vagrant: use python 3.9.16 for the binary build 2022-12-24 02:24:35 +01:00
Thomas Waldmann
5a442743f5
vagrant: use the openbsd 7.1 box
openbsd 6.9 was removed from the ftp servers and
the vagrant box stopped working. so we now use the
same box as in master branch.
2022-12-24 02:21:50 +01:00
TW
5704c4d887
Merge pull request #7215 from ThomasWaldmann/github-actions-updates-1.2
GitHub actions updates (1.2-maint)
2022-12-17 21:39:07 +01:00
TW
28bf1db2c8
Merge pull request #7216 from ThomasWaldmann/fix-ci-1.2
fix github CI (1.2-maint)
2022-12-17 21:38:05 +01:00
Thomas Waldmann
96d36e32cb
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 20:27:49 +01:00
Thomas Waldmann
dd8e5487e3
github CI: prepend to PKG_CONFIG_PATH 2022-12-17 20:27:39 +01:00
Thomas Waldmann
0849ef25de
github CI: use actions/cache@v3 2022-12-17 20:02:52 +01:00
Thomas Waldmann
b69721ebe0
no fail fast, just checking... 2022-12-17 18:48:41 +01:00
Thomas Waldmann
fe1c89e5ba
github CI: use actions/setup-python@v4
should fix the node12 deprecation warning.
2022-12-17 18:33:26 +01:00
Thomas Waldmann
bb1c132bbc
github CI: use actions/checkout@v3
should fix the node12 deprecation warning.
2022-12-17 18:33:12 +01:00
Thomas Waldmann
73097c8162
github CI: use ubuntu-20.04 (not -latest)
affects only the lint job, everything else used 20.04 already.
2022-12-17 18:33:06 +01:00
TW
d61f5eba63
Merge pull request #7214 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2-maint)
2022-12-17 18:13:31 +01:00
Thomas Waldmann
9c8ac57399
update CHANGES 2022-12-17 18:04:03 +01:00
TW
2aae879c49
Merge pull request #7210 from ThomasWaldmann/list-directories-dry-run-1.2
create: --list --dry-run output for directories, fixes #7209
2022-12-15 17:50:46 +01:00
Thomas Waldmann
dca6792850
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:26:36 +01:00
TW
6d5c4a48b3
Merge pull request #7201 from ThomasWaldmann/fix-macos-ci-1.2
fix tox4 issue on macOS CI (1.2-maint)
2022-12-10 20:52:29 +01:00
Thomas Waldmann
e66d8c399b
fix tox4 passenv issue, fixes #7199
also: have a setting to disable fail-fast, in case something breaks again.
2022-12-10 19:55:28 +01:00
TW
79b6c985a1
Merge pull request #7169 from ThomasWaldmann/update-twine-upload-1.2
twine: use repo name instead of url
2022-11-27 01:25:39 +01:00
Thomas Waldmann
3984a7e3da
twine: use repo name instead of url 2022-11-27 01:24:25 +01:00
TW
d4cd911d46
Merge pull request #7150 from ThomasWaldmann/fix-nfiles-1.2
Fix nfiles 1.2
2022-11-20 20:30:25 +01:00
TW
889c8778a1
Merge pull request #7149 from ThomasWaldmann/py311-1.2
update python 3.9 and 3.11
2022-11-20 18:48:25 +01:00
Thomas Waldmann
f6419ee28b
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-11-20 18:33:53 +01:00
Thomas Waldmann
822a23da92
github CI: use python 3.11 (not -dev) 2022-11-20 17:58:43 +01:00
Thomas Waldmann
d623b47da9
vagrant: use python 3.9.15 for tests/binary build 2022-11-20 17:57:16 +01:00
TW
c233a964f2
Merge pull request #7147 from ThomasWaldmann/fix-repository-tests-1.2
Fix repository tests 1.2
2022-11-19 17:06:07 +01:00
Rayyan Ansari
d0b09dfc95
testsuite: repository: skip some tests for RemoteRepository 2022-11-19 14:30:41 +01:00
Rayyan Ansari
82f6adf8e0
file_integrity.py: make sure file_fd is always closed on exit 2022-11-19 14:30:16 +01:00
Rayyan Ansari
9cff9d96fa
testsuite: repository: close fd before deleting segment
See last commit.
2022-11-19 14:28:14 +01:00
Rayyan Ansari
05505de807
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-19 14:25:01 +01:00
Rayyan Ansari
6a97e936ac
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-19 14:22:35 +01:00
TW
97261dbb22
Merge pull request #7135 from ThomasWaldmann/remove-py37-compat-code-1.2
remove python < 3.7 compatibility code
2022-11-07 09:04:37 +01:00
Thomas Waldmann
f1a355f3d9
remove python < 3.7 compatibility code
not supported any more in master and 1.2-maint branches.
2022-11-06 18:25:03 +01:00
TW
fff56edd8a
Merge pull request #7130 from ThomasWaldmann/fix-6070-1.2
improve/clarify strange test code, fixes #6070
2022-11-05 02:15:25 +01:00
TW
2ae41fd9e6
Merge pull request #7128 from ThomasWaldmann/fix-root-paths-1.2
fix args.paths related argparsing, fixes #6994
2022-11-05 01:12:45 +01:00
Thomas Waldmann
25d6649bcd improve/clarify strange test code, fixes #6070 2022-11-05 00:51:44 +01:00
Thomas Waldmann
d57ed9dd98 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-05 00:30:46 +01:00
TW
01b921dea4
Merge pull request #7124 from ThomasWaldmann/hashindex-test-win-1.2
Fix test_size_on_disk_accurate on Windows
2022-11-04 21:12:58 +01:00
Thomas Waldmann
8ddfd94f09 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:28:09 +01:00
TW
3d1f11b2e2
Merge pull request #7106 from RayyanAnsari/msys2-ci-backport
Use MSYS2 for Windows CI [backport]
2022-10-28 19:11:39 +02:00
Rayyan Ansari
e8dd5c449e
Add new Windows build scripts and CI with GitHub and MSYS2 [backport]
Fixes #7105
2022-10-27 16:56:08 +01:00
Rayyan Ansari
4b27ab2fbd
Remove old Windows scripts and Appveyor CI [backport] 2022-10-27 16:33:02 +01:00
nyuszika7h
84f4c12752
tar_filter: recognize .tar.zst as zstd (backport) (#7095)
tar_filter: recognize .tar.zst as zstd

Backported from #7093
2022-10-22 13:41:11 +02:00
TW
0989cb4040
Merge pull request #7082 from ThomasWaldmann/fix-chunker-params-comparison
Fix chunker params comparison
2022-10-11 20:29:32 +02:00
Thomas Waldmann
3200190cdb diff: more precise warning msgs for different chunker params
if we know both archives' chunker params, use "are different" not "might be".
also do not recommend to enforce it using --same-chunker-params in this case.
2022-10-11 19:44:11 +02:00
Thomas Waldmann
651bef450d recreate: normalize chunker params before comparing them, see #7079
borg < 1.2 did not have the chunker name as first element in the tuple,
but it always was buzhash, because there was no other chunker.
2022-10-10 22:41:39 +02:00
Thomas Waldmann
a6207370a9 diff: normalize chunker params before comparing them, fixes #7079
borg < 1.2 did not have the chunker name as first element in the tuple,
but it always was buzhash, because there was no other chunker.
2022-10-10 22:27:12 +02:00
TW
773f3bff77
Merge pull request #7057 from ThomasWaldmann/fix-recreate-fixed-chunker-1.2
get_chunker: fix missing sparse=False argument, fixes #7056
2022-09-27 22:36:03 +02:00
Thomas Waldmann
875c94a20d get_chunker: fix missing sparse=False argument, fixes #7056 2022-09-27 21:45:51 +02:00
Thomas Waldmann
2f6197df0c add test for recreate with "fixed" chunker 2022-09-27 21:45:51 +02:00
Emmanuel Tanimowo
f49133da04
update automating backups script (#7039)
update "automating backups" script: remove last backslash, use --glob-archives
2022-09-21 00:54:38 +02:00
TW
44b4791e98
Merge pull request #7035 from ThomasWaldmann/fix-7034-1.2
check: fix uninitialised variable if repo is completely empty, fixes #7034
2022-09-17 20:51:48 +02:00
Thomas Waldmann
4f4be2631a check: fix uninitialised variable if repo is completely empty, fixes #7034 2022-09-17 20:29:34 +02:00
TW
9fe7339a39
Merge pull request #7024 from ThomasWaldmann/compat-setuptoolsscm4-1.2
do not use version_tuple placeholder in setuptools_scm template
2022-09-17 13:26:55 +02:00
Thomas Waldmann
3404346419 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.
2022-09-13 21:25:35 +02:00
TW
1b3cbe2461
Merge pull request #6990 from ThomasWaldmann/more-fine-grained-extended-stat-1.2
xattrs / extended stat: improve exception handling (1.2-maint)
2022-09-05 16:06:10 +02:00
Thomas Waldmann
3bd3600875 cosmetic: add missing blank to xattr test skip reason 2022-08-24 14:19:53 +02:00
Thomas Waldmann
a758fda089 xattrs: improve error handling, fixes #6988
looks like we can not rely on listxattr only returning
valid, acceptable names for getxattr.

so getxattr can still fail with EINVAL.

also:

- do not raise an exception if getting a single
xattr fails, rather emit a warning and continue
processing the remaining xattrs (and also the whole
file). we already had that for EPERM (and similar
for ENOATTR), just do it for all errors.

- _check, when it raises OSError, gives us a nice
exception object, use it.

- more helpful error msgs, try not to lose error information
2022-08-24 12:03:51 +02:00
Thomas Waldmann
b5d43506d3 extended stat: more fine grained exception handling
see #6988: it was unclear where exactly the error came from (flags, xattrs or ACLs getting?).
2022-08-23 21:56:31 +02:00
TW
9bfe210948
Merge pull request #6980 from ThomasWaldmann/rel122
release 1.2.2
2022-08-20 21:04:12 +02:00
Thomas Waldmann
101a06234f netbsd vagrant box: py310, remove some outdated fixes
seems like that stuff got fixed in 9.3.
2022-08-20 16:52:31 +02:00
Thomas Waldmann
e87c54a0a1 update CHANGES 2022-08-20 15:38:10 +02:00
Thomas Waldmann
bbad73502b requirements.lock.txt: upgrade Cython and tox 2022-08-20 15:38:10 +02:00
Thomas Waldmann
92ca260fd8 build_usage ; build_man 2022-08-20 15:38:10 +02:00
Thomas Waldmann
b024379904 fix sphinx warnings 2022-08-20 15:38:10 +02:00
TW
4e2cc02e86
Merge pull request #6967 from ThomasWaldmann/fix-versionpy-format-1.2
_version.py: remove trailing blank, add LF at EOF
2022-08-15 15:17:56 +02:00
TW
ec389edc83
Merge pull request #6944 from ThomasWaldmann/fix-ctrl-c-remote-repo-1.2
ctrl-c must not kill important subprocesses, fixes #6912
2022-08-13 23:23:50 +02:00
Thomas Waldmann
6799405012 _version.py: remove trailing blank, add LF at EOF 2022-08-13 20:35:03 +02:00
Thomas Waldmann
7a31978c55 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 12:48:54 +02:00
Thomas Waldmann
5d83d5f153 ctrl-c must not kill the ssh subprocess, fixes #6912 2022-08-06 12:29:10 +02:00
TW
e215525339
Merge pull request #6943 from ThomasWaldmann/update-changes-1.2
update CHANGES
2022-08-06 11:37:07 +02:00
Thomas Waldmann
c4e552a1e5 update CHANGES 2022-08-06 10:41:58 +02:00
TW
fa8d8ecd73
Merge pull request #6918 from ThomasWaldmann/compaction-debugging-1.2
repository: add debug logging for issue #6687
2022-08-06 10:27:23 +02:00
TW
52cba940ea
Merge pull request #6936 from ThomasWaldmann/mkstemp_mode-1.2
use a custom mkstemp with mode support, fixes #6933, fixes #6400
2022-08-05 13:04:24 +02:00
TW
28bc76a916
Merge pull request #6937 from ThomasWaldmann/fix-warnings-1.2
Fix warnings (1.2-maint)
2022-08-04 18:23:34 +02:00
Thomas Waldmann
69f4898460 make setuptools happy, fixes #6874
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 15:50:05 +02:00
Thomas Waldmann
b3b5602ac2 _chunker.c: fix warnings on macOS
macOS does not have POSIX_FADV_DONTNEED, thus some variables are not
needed.
2022-08-04 14:51:06 +02:00
Thomas Waldmann
b0eee13124 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:22:56 +02:00
Thomas Waldmann
e5b6670bc6 repository: add debug logging for issue #6687
i suspect that compact_segments wrongly drops some DEL tags.

this could make already deleted chunks re-appear, leading to:
- suddenly more repo index entries than previously (check, repo part)
- suddenly orphaned chunks appearing (check, archives part)

if this is the case, the issue is harmless, but annoying/confusing.

to fix the issue, i need the complete log line "dropping DEL for id X".
the id X it mentions is one of the chunk ids borg check complains about.
2022-07-31 19:05:54 +02:00
TW
4b54cfef45
Merge pull request #6914 from ThomasWaldmann/update-changes-1.2
update CHANGES
2022-07-30 18:32:58 +02:00
Thomas Waldmann
fe27be9f3e update CHANGES 2022-07-30 17:57:57 +02:00
TW
ade2241163
Merge pull request #6911 from horazont/docs/internal-details-1.2
docs(1.2): provide more details on object layout
2022-07-30 17:43:27 +02:00
Jonas Schäfer
bd89fb717e 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 17:32:36 +02:00
TW
01f87c6ca1
Merge pull request #6887 from ThomasWaldmann/prune-checkpointing-1.2
prune/delete --checkpoint-interval=1800 and ctrl-c/SIGINT support, fixes #6284
2022-07-30 16:54:50 +02:00
TW
5e291ff5e1
Merge pull request #6905 from ThomasWaldmann/fix-flags-formatting-1.2
list: fix {flags:<WIDTH>} formatting, fixes #6081
2022-07-30 15:34:19 +02:00
TW
78ae0114d4
Merge pull request #6909 from ThomasWaldmann/update-changes-1.2
update CHANGES
2022-07-30 15:30:48 +02:00
TW
32616111e0
Merge pull request #6901 from ThomasWaldmann/fix-5719-1.2
check: try harder to create the key, fixes #5719
2022-07-30 15:30:32 +02:00
Thomas Waldmann
e7bd9e8442 update CHANGES 2022-07-29 11:48:18 +02:00
Thomas Waldmann
e81f6f34cd 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:09:00 +02:00
Thomas Waldmann
ea4c47ec7a 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 09:08:03 +02:00
Thomas Waldmann
f8e33cfdf1 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-28 19:15:23 +02:00
TW
3d94c595b0
Merge pull request #6896 from ThomasWaldmann/ci-macos-1.2
CI: test on macOS 12 without fuse / fuse tests
2022-07-28 00:09:59 +02:00
Thomas Waldmann
9fb9508f4b CI: test on macOS 12 without fuse / fuse tests
too troublesome on github CI due to kernel extensions needed by macFUSE.
2022-07-27 23:10:10 +02:00
remyabel2
c56025000b
docs: add info on man page installation (#6894) 2022-07-27 13:46:48 +02:00
TW
4c3da429fb
Merge pull request #6890 from ThomasWaldmann/archive-progress-json-docs-1.2
docs: update archive_progress json description about "finished"
2022-07-27 12:46:59 +02:00
Thomas Waldmann
404fe33a8d docs: update archive_progress json description about "finished", see #6570 2022-07-25 13:06:06 +02:00
TW
a4a2530a29
Merge pull request #6877 from LocutusOfBorg/fix-template-1.2
Fix pyproject.toml to create a fixed _version.py file, compatible wi…
2022-07-19 16:41:41 +02:00
Gianfranco Costamagna
ad8555e921 Fix pyproject.toml to create a fixed _version.py file, compatible with both old and new setuptools_scm version (see: #6875) 2022-07-18 19:51:04 +02:00
TW
907764e018
Merge pull request #6850 from ThomasWaldmann/deprecated-prefix-option-1.2
deprecate --prefix, use -a / --glob-archives, see #6806
2022-07-09 16:57:58 +02:00
Thomas Waldmann
c265370cff deprecate --prefix, use -a / --glob-archives, see #6806 2022-07-09 16:12:34 +02:00
TW
a8c556b5e9
Merge pull request #6843 from ThomasWaldmann/expect-1.2
Automate asciinema screencasts (1.2-maint)
2022-07-07 00:36:59 +02:00
TW
8a42d88120 Merge pull request #6197 from hexagonrecursion/expect
Automate asciinema screencasts
2022-07-07 00:01:28 +02:00
TW
1fba67efee
Merge pull request #6824 from ThomasWaldmann/fix-progress-percent-docs-1.2
docs: json progress_percent: some values are optional, fixes #4074
2022-07-02 20:21:36 +02:00
Thomas Waldmann
bfae252593 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:31:23 +02:00
TW
9c463dc46b
Merge pull request #6816 from ThomasWaldmann/fix-hashindex-compact-1.2
hashindex_compact: fix eval order (check idx before use), fixes #5899
2022-06-30 20:57:38 +02:00
Thomas Waldmann
3f517b019a hashindex_compact: fix eval order (check idx before use), fixes #5899
also: fix "off by one" comment
2022-06-29 18:58:26 +02:00
TW
25c9826456
Merge pull request #6814 from fantasya-pbem/docs/5960_FAQ-quota-size_1.2-maint
[DOCS] #5960 - FAQ: Full quota / full disk
2022-06-29 18:55:36 +02:00
Thalian
6990aca7ac [DOCS] #5960 - FAQ: Full quota / full disk
Backport from master.
2022-06-29 17:56:23 +02:00
TW
0cac871b34
Merge pull request #6787 from ThomasWaldmann/chmod-optional-1.2
SaveFile: the chmod is optional, fixes #6786
2022-06-23 18:07:02 +02:00
Thomas Waldmann
89e24847b9 SaveFile: the chmod is optional, fixes #6786
some filesystems do not support chmod, just ignore if it is failing.
2022-06-23 17:43:21 +02:00
TW
7ee4b7035b
Merge pull request #6779 from ThomasWaldmann/paths-from-normpath-1.2
create --paths-from-(stdin|command): normalize paths, fixes #6778
2022-06-22 00:20:20 +02:00
Thomas Waldmann
ec2bf8e45d create --paths-from-(stdin|command): normalize paths, fixes #6778 2022-06-20 13:44:35 +02:00
TW
97c5c54a0c
Merge pull request #6775 from wizeman/fix-obfuscate-1.2
fix test_obfuscate byte accounting (backport #6773 to 1.2-maint)
2022-06-14 17:29:24 +02:00
Ricardo M. Correia
333320ad56 fix test_obfuscate byte accounting 2022-06-14 16:06:49 +02:00
TW
bab00fb47b
Merge pull request #6769 from ThomasWaldmann/safe-secure-erase-1.2
secure_erase: avoid collateral damage, fixes #6768
2022-06-13 19:41:38 +02:00
Thomas Waldmann
afcebf32f7 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:47:50 +02:00
TW
73b97f339b
Merge pull request #6765 from targhs/doc/correct-installation-shell-syntax
Correct shell syntax for installation using git
2022-06-12 19:48:03 +02:00
targhs
08629e4d83 Commit shell syntax for installation using git 2022-06-12 22:37:37 +05:30
TW
7f8a5bb9c3
Merge pull request #6753 from ThomasWaldmann/rel121
Release 1.2.1
2022-06-05 23:43:32 +02:00
Thomas Waldmann
9fad4ba1cb build_man 2022-06-05 20:14:26 +02:00
Thomas Waldmann
a7c1c1cb16 build_usage 2022-06-05 20:13:46 +02:00
Thomas Waldmann
6c0842ec42 update CHANGES 2022-06-05 20:09:06 +02:00
TW
b0c726abae
Merge pull request #6752 from ThomasWaldmann/vagrant-updates
Vagrant updates (1.2)
2022-06-05 20:03:03 +02:00
Thomas Waldmann
d8102774b6 vagrant: increase VMCPUS and xdistn from 4 to 16
esp. the darwin64 box based tests take ages, let's see
if they get faster with this.
2022-06-05 19:56:29 +02:00
TW
7475e661bf
Merge pull request #6751 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2)
2022-06-05 18:36:37 +02:00
TW
eeb55c10c4
Merge pull request #6749 from fantasya-pbem/docs/4776_FAQ_swapped-targets_main
[DOCS] #4776 - FAQ: How to swap backup media
2022-06-05 18:33:50 +02:00
Thalian
cfcf99ccb5 [DOCS] #4776 - FAQ: How to swap backup media
Backport from master.
2022-06-05 18:22:23 +02:00
Thomas Waldmann
4ae08ee972 update CHANGES 2022-06-05 18:18:49 +02:00
TW
cfc623e250
Merge pull request #6748 from ThomasWaldmann/update-changes-rel1118-1.2
update CHANGES with 1.1.18 changelog
2022-06-05 18:08:52 +02:00
Thomas Waldmann
677db66e9d update CHANGES with 1.1.18 changelog 2022-06-05 17:45:48 +02:00
Thomas Waldmann
96c748c1d2 vagrant: add ubuntu "jammy" 22.04 box 2022-06-05 17:35:05 +02:00
TW
7ab36ceb76
Merge pull request #6742 from ThomasWaldmann/msgpack104-1.2
msgpack 1.0.4 / py 3.11 (1.2-maint)
2022-06-03 10:37:31 +02:00
Thomas Waldmann
6d024961aa add python 3.11 to pypi metadata 2022-06-03 10:05:56 +02:00
Thomas Waldmann
d1ef35b4f0 CI: also test on python 3.11-dev 2022-06-03 10:05:56 +02:00
Thomas Waldmann
de61d4953b allow msgpack 1.0.4, fixes #6716 2022-06-03 10:05:44 +02:00
TW
03827bc684
Merge pull request #6738 from ThomasWaldmann/vagrant-updates-1.2
Vagrant updates (1.2-maint)
2022-06-01 20:19:55 +02:00
Thomas Waldmann
354b014b19 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:51:55 +02:00
Thomas Waldmann
6b9a66b5fa vagrant: use pyinstaller 4.10
when installed via pip, this automatically build the bootloader now.
2022-06-01 19:49:37 +02:00
Thomas Waldmann
6063c21bd9 vagrant: use python 3.9.13 for binary build 2022-06-01 19:48:10 +02:00
TW
8370eea9e0
Merge pull request #6731 from KN4CK3R/backport-6724-1.2
Backport make constants for files cache mode more clear (#6724, 1.2)
2022-05-30 16:02:53 +02:00
Elmar Hoffmann
bf31030d05 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 15:31:26 +02:00
TW
5679eb16df
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 00:33:49 +02:00
Thomas Waldmann
49f191bc4c borg debug dump-repo-objs: new --segment=S --offset=O options
the new options limit processing to segment S (and, optionally, also
to offset O), so you do not need to dump your complete repo to only
look at 1 segment (or 1 object).

note: there is no rpc api for scan_low_level, so this only works locally.
2022-05-27 23:29:45 +02:00
TW
1b231e79e2
Merge pull request #6720 from ThomasWaldmann/update-changes-1.2
update CHANGES (1.2)
2022-05-27 21:54:23 +02:00
Thomas Waldmann
b55bb4694d update CHANGES 2022-05-27 17:12:56 +02:00
TW
7d14302b12
Merge pull request #6718 from fantasya-pbem/task/6407_document-pattern-changes-backport
#6407 - Document Borg 1.2 pattern behavior change
2022-05-27 15:41:51 +02:00
Thalian
2694652e37 #6407 - Document Borg 1.2 pattern behavior change
Backport from master: Make clear that absolute paths always go into the matcher as if they are relative (without leading slash). Adapt all examples accordingly.
2022-05-27 15:14:01 +02:00
TW
371bb06dd1
Merge pull request #6700 from KN4CK3R/backport-6688-1.2
Backport Fix typos (#6688)
2022-05-16 00:08:41 +02:00
Andrea Gelmini
f4d7c32058 Fix typos (#6688)
fix typos

Co-authored-by: Thomas Waldmann <tw@waldmann-edv.de>
2022-05-15 23:43:50 +02:00
TW
39708849a2
Merge pull request #6695 from ThomasWaldmann/versions-mount-1archive-error-1.2
mount -o versions: give clear error msg instead of crashing
2022-05-15 19:52:43 +02:00
Thomas Waldmann
99ccd4f792 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:40:53 +02:00
Christopher Klooz
c3bbb5e57a
docs: authentication primitives: improved security and performance infos (1.2) (#6692)
docs: authentication primitives: improved security and performance infos
2022-05-14 22:56:39 +02:00
TW
fd4503cd30
Merge pull request #6683 from ThomasWaldmann/fix-archive-progress-json-1.2
show_progress: add finished=true/false to archive_progress json
2022-05-08 19:45:53 +02:00
TW
247b3d9b55
Merge pull request #6686 from ThomasWaldmann/fix-create-filter-1.2
fix create_filter_process exception handler, fixes #6681
2022-05-08 19:15:59 +02:00
Thomas Waldmann
b846ae9659 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:42 +02:00
Thomas Waldmann
9dff959f16 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:38:10 +02:00
TW
ae417cccf6
Merge pull request #6679 from KN4CK3R/backport-6670-1.2
Backport check that borg does not require pytest for normal usage (#6670, 1.2)
2022-05-07 19:59:22 +02:00
TW
d72eb3b1cf
Merge pull request #6678 from KN4CK3R/backport-6659-1.2
Backport mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL (#6659)
2022-05-07 19:57:52 +02:00
Thomas Waldmann
c7390383a0 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 18:56:36 +02:00
Thomas Waldmann
6d6711768e docs: mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, fixes #5602 2022-05-07 18:47:41 +02:00
TW
bcac974df7
Merge pull request #6648 from ThomasWaldmann/key-algo-error-msg-1.2
give a more helpful error msg for unsupported encrypted key format
2022-04-27 11:03:15 +02:00
Thomas Waldmann
25390de2c7 give a more helpful error msg for unsupported key format, fixes #6561 2022-04-24 22:03:28 +02:00
Thomas Waldmann
05d7ee9ed8 give a more helpful error msg for unsupported encrypted key format, fixes #6561 2022-04-24 21:55:41 +02:00
TW
1311a7d7a7
Merge pull request #6645 from hexagonrecursion/1.2-faq
[1.2] Add a troubleshooting note to the FAQ
2022-04-24 13:57:02 +02:00
Andrey Bienkowski
622ec1a181 Add a troubleshooting note to the FAQ 2022-04-24 11:27:37 +03:00
TW
65e371999d
Merge pull request #6636 from ThomasWaldmann/docs-files-cache-1.2
FAQ: add a hint about --debug-topic=files_cache
2022-04-20 13:01:56 +02:00
Thomas Waldmann
56262b57bd FAQ: add a hint about --debug-topic=files_cache 2022-04-20 13:00:34 +02:00
TW
26b46dd1f4
Merge pull request #6629 from ThomasWaldmann/fix-iec-1.2
fix --iec mode output for borg delete and prune
2022-04-19 23:39:26 +02:00
TW
b2d0af9487
Merge pull request #6632 from ThomasWaldmann/fix-info-authenticated-1.2
info: fix authenticated mode repo to show "Encrypted: No", fixes #6462
2022-04-19 23:38:54 +02:00
Thomas Waldmann
c5f3214d8a info: fix authenticated mode repo to show "Encrypted: No", fixes #6462 2022-04-19 22:10:44 +02:00
TW
890b627860
Merge pull request #6627 from ThomasWaldmann/fix-files-cache-6353-1.2
fix transaction rollback: use files cache filename as found in txn.active
2022-04-19 21:57:55 +02:00
Thomas Waldmann
cc04253afd prune: fix --stats --iec output to use binary units, see #6606 2022-04-19 21:51:55 +02:00
Thomas Waldmann
0ddb1fa194 delete: fix --stats --iec output to use binary units, see #6606 2022-04-19 21:50:26 +02:00
Thomas Waldmann
8d160b6a8e fix transaction rollback: use files cache filename as found in txn.active, fixes #6353 2022-04-19 21:17:50 +02:00
TW
55f9028611
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:47:08 +02:00
TW
5619b5e2bd
Merge pull request #6620 from ThomasWaldmann/secure-erase-msg-1.2
remove stray punctuation from secure-erase message
2022-04-18 10:01:40 +02:00
TW
390b3127d0
Merge pull request #6618 from ThomasWaldmann/invalid-repo-msg-1.2
better error msg for defect or unsupported repo configs, fixes #6566
2022-04-18 09:52:52 +02:00
Jakub Wilk
291901717d remove stray punctuation from secure-erase message 2022-04-18 09:33:26 +02:00
Thomas Waldmann
e32760ee47 better error msg for defect or unsupported repo configs, fixes #6566 2022-04-18 09:28:30 +02:00
TW
9dec811077
Merge pull request #6613 from ThomasWaldmann/fix-pre12-meta-1.2
pre12-meta cache: do not use the cache if want_unique is True, fixes #6612
2022-04-18 09:27:02 +02:00
TW
638184ae6f
Merge pull request #6614 from ThomasWaldmann/require-setuptools-scm-via-pyproject-1.2
setuptools_scm: also require it via pyproject.toml
2022-04-18 08:03:02 +02:00
Thomas Waldmann
6ab17ee4e1 setuptools_scm: also require it via pyproject.toml
we have this in setup_requires in setup.py, but i also added it to
pyproject.toml - so we can be sure it is installed no matter what.

**configuration** of setuptools_scm is done the old way in setup.py
here in 1.2-maint, in master we have switched that over to pyproject.toml.
2022-04-18 05:00:17 +02:00
Thomas Waldmann
2a15ccf5ac pre12-meta cache: do not use the cache if want_unique is True, fixes #6612
we can't cache usize, it needs to get dynamically calculated.
2022-04-18 04:37:00 +02:00
TW
6eb0bee328
Merge pull request #6591 from ThomasWaldmann/fix-md-chunks-processing-1.2
metadata stream can produce all-zero chunks, fixes #6587
2022-04-14 03:53:52 +02:00
Thomas Waldmann
e1fbe1782f 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:09:53 +02:00
TW
d6f7056d9d
Merge pull request #6589 from ThomasWaldmann/docs-virt-1.2
virtualisation speed tips
2022-04-13 23:24:59 +02:00
Thomas Waldmann
08ed786f6d virtualisation speed tips 2022-04-13 23:08:39 +02:00
TW
7a3056092e
Merge pull request #6582 from ThomasWaldmann/deleted-key-1.2
load_key: no key is same as empty key, fixes #6441
2022-04-12 20:09:10 +02:00
Thomas Waldmann
7fc1d75cd3 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-12 19:43:48 +02:00
TW
fddd0c93fa
Merge pull request #6581 from ThomasWaldmann/docs-max-duration-1.2
docs: improve borg check --max-duration description
2022-04-12 19:40:51 +02:00
TW
063adc1799
Merge pull request #6579 from ThomasWaldmann/compact-docs-1.2
docs: borg compact --cleanup-commits also runs a normal compaction
2022-04-12 18:53:53 +02:00
Thomas Waldmann
ec90a065fb docs: improve borg check --max-duration description 2022-04-12 18:45:03 +02:00
TW
8d632c0fcc
Merge pull request #6574 from ThomasWaldmann/more-robust-iterator-1.2
borg check improvements (1.2)
2022-04-12 18:13:36 +02:00
TW
19f9247f65
Merge pull request #6576 from ThomasWaldmann/repo-tags-docs-1.2
docs: fix values of TAG bytes, fixes #6515
2022-04-12 18:13:05 +02:00
Thomas Waldmann
3bacf4ac39 docs: borg compact --cleanup-commits also runs a normal compaction, fixes #6324 2022-04-12 18:11:38 +02:00
Thomas Waldmann
bb6188da49 docs: fix values of TAG bytes, fixes #6515 2022-04-12 17:58:13 +02:00
Thomas Waldmann
c8f160068e 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:45:48 +02:00
Thomas Waldmann
151fe5f348 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:45:17 +02:00
TW
70e30dea4d
Merge pull request #6558 from bcat/1.2-maint
(docs) 1.2: Recommend umask for passphrase file perms
2022-04-10 14:00:37 +02:00
Jonathan Rascher
4b58dafd31 (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-09 23:58:45 -05:00
TW
b602352d34
Merge pull request #6545 from ThomasWaldmann/add-pyproject.toml-1.2
add pyproject.toml, fix sys.path, fixes #6466
2022-04-07 21:27:07 +02:00
TW
aa55aef2b9
Merge pull request #6543 from ThomasWaldmann/fix-progress-archivename-1.2
escape % chars in archive name, fixes #6500
2022-04-07 20:22:06 +02:00
Thomas Waldmann
82a80bf760 add pyproject.toml, fix sys.path, fixes #6466
setup.py: add parent to sys.path

When using pyproject.toml the parent of setup.py is not on sys.path by default.

See <pypa/setuptools#3134>.
2022-04-07 18:48:48 +02:00
Thomas Waldmann
a4f7eeb179 escape % chars in archive name, fixes #6500
also: fix percentage format for float value.
2022-04-07 18:03:25 +02:00
TW
a7328edd58
Merge pull request #6532 from bket/1.2_fix_#2055
1.2 - fix OpenBSD symlink mode test failure (#2055)
2022-04-04 21:41:07 +02:00
TW
f5927b6b49
Merge pull request #6528 from ThomasWaldmann/fix-ipv6-url-parsing-1.2
fix scp repo url parsing for ip v6 addrs, fixes #6526
2022-04-04 20:39:28 +02:00
Björn Ketelaars
b467d50c35 1.2 - 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 19:24:28 +02:00
Thomas Waldmann
40f1f9ddee 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 21:33:26 +02:00
Thomas Waldmann
e332acb334 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 21:30:28 +02:00
TW
e5e360d5b6
Merge pull request #6507 from ThomasWaldmann/update-security-support-1.2
borg 1.2 is security supported
2022-03-30 00:11:57 +02:00
Thomas Waldmann
017f9b2102 borg 1.2 is security supported 2022-03-29 23:55:25 +02:00
TW
28c7494455
Merge pull request #6503 from aspargas2/1.2-maint
1.2-maint backport: delete: add repository id and location to prompt
2022-03-28 18:42:36 +02:00
Thomas Deutschmann
821d814af3 delete: add repository id and location to prompt
Closes: https://github.com/borgbackup/borg/issues/6453
2022-03-28 10:16:53 -04:00
TW
b5443da6cb
Merge pull request #6493 from ThomasWaldmann/use-compare_digest-1.2
use hmac.compare_digest instead of ==, fixes #6470
2022-03-26 19:48:05 +01:00
TW
4ecf0d4d78
Merge pull request #6491 from ThomasWaldmann/crypto-fixes-1.2
avoid losing the key (old crypto)
2022-03-26 19:05:54 +01:00
Thomas Waldmann
b75079c0f8 use hmac.compare_digest instead of ==, fixes #6470 2022-03-26 18:52:41 +01:00
Thomas Waldmann
3e91694a0a 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 18:32:44 +01:00
TW
2e45e19e02
Merge pull request #6488 from ThomasWaldmann/update-ubuntu-link-1.2
docs: update link to ubuntu packages, fixes #6485
2022-03-26 18:20:54 +01:00
Thomas Waldmann
c14bc52189 docs: update link to ubuntu packages, fixes #6485 2022-03-26 18:07:03 +01:00
TW
df9322c4a9
Merge pull request #6475 from bket/unused-code-1.2
1.2 - Remove unused code
2022-03-21 19:51:09 +01:00
Björn Ketelaars
71fa056c47 1.2 - Remove unused code
#6473 Removed AEAD ciphers AES-OCB and CHACHA20-POLY1305 from 1.2. As a
result some additional code can be removed.

Passes regression tests.
2022-03-21 18:54:50 +01:00
TW
87f0b9803b
Merge pull request #6473 from ThomasWaldmann/remove-aead-1.2
remove AEAD ciphers AES-OCB and CHACHA20-POLY1305, fixes #6472
2022-03-20 23:44:40 +01:00
Thomas Waldmann
aa57a3cb57 remove AEAD ciphers AES-OCB and CHACHA20-POLY1305, fixes #6472
not used in 1.2.x, we'll start using them in 1.3.
2022-03-20 23:05:30 +01:00
TW
d41908166f
Merge pull request #6435 from hexagonrecursion/1-2-fallthrough
1.2: Make switch fallthrough explicit
2022-03-10 12:04:12 +01:00
TW
e25d6c8c4b
Merge pull request #6436 from hexagonrecursion/1-2-numeric
1.2: use --numeric-ids in pull doc
2022-03-10 11:55:42 +01:00
Michael Bauer
1345f06f2b use --numeric-ids in pull doc
replace flag --numeric-owner with --numeric-ids
2022-03-10 08:34:27 +03:00
Andrey Bienkowski
a58fd3db5c 1.2: Make switch fallthrough explicit 2022-03-10 08:24:23 +03:00
TW
791720407b
Merge pull request #6432 from hexagonrecursion/1-2-cflags
1.2: Allow extra compiler flags for every extension build
2022-03-10 00:13:44 +01:00
James Buren
793d543328 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.

Conflicts:
	setup.py
2022-03-10 00:50:59 +03:00
TW
f698c12129
Merge pull request #6403 from ThomasWaldmann/fix-savefile-mode-1.2
respect umask for files / dirs (1.2)
2022-03-09 16:53:35 +01:00
braewoods
8b4c501d8d
[1.2-maint] Backport implicit warning patches from master (#6427)
* 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-03-09 16:10:21 +01:00
TW
450610b168
Merge pull request #6423 from ThomasWaldmann/fix-cython-warnings-1.2
fix "useless trailing comma" cython warnings
2022-03-08 22:19:47 +01:00
Thomas Waldmann
dc811bda6f fix "'HMAC_CTX' already defined" cython warning 2022-03-08 21:47:14 +01:00
Thomas Waldmann
cd629d32cb fix "useless trailing comma" cython warnings 2022-03-08 21:27:20 +01:00
TW
7a1d12d007
Merge pull request #6418 from hexagonrecursion/bp12-unicode
1.2-maint: ‘PyUnicode_AsUnicode’ is deprecated
2022-03-07 20:14:15 +01:00
Andrey Bienkowski
f05036cbcb ‘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 21:40:39 +03:00
TW
20a9df18f7
Merge pull request #6413 from aspargas2/1.2-maint
Backport: fix codeql complaining about missing headers needed by borg
2022-03-07 17:59:53 +01:00
aspargas2
2425f54bdb tweak what is backported, as requested
- don't backport `pyproject.toml` or related changes
- install some additional -dev packages with `apt-get` for CodeQL
- run CodeQL in a python venv
2022-03-07 10:14:22 -05:00
TW
bb76dca114
Merge pull request #6414 from hexagonrecursion/bp-blake
1.2-maint: hmac and blake2b minor optimizations and cleanups
2022-03-06 14:39:51 +01:00
Thomas Waldmann
ce72a87f2d fixup: fix SELFTEST_COUNT 2022-03-06 11:31:05 +03:00
Thomas Waldmann
65ccbc2c69 fixup: remove now unused import 2022-03-06 11:31:05 +03:00
Thomas Waldmann
8dd2612fc6 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-06 11:31:05 +03:00
Thomas Waldmann
45ef108d46 remove our blake2b_128/256 tests
as we're just calling python stdlib there,
we can assume that they have tests for it.

 Conflicts:
	src/borg/testsuite/crypto.py
2022-03-06 11:30:58 +03:00
Thomas Waldmann
c2211a7ef9 remove our hmac_sha256 tests
as we're just calling python stdlib there,
we can assume that they have tests for it.

 Conflicts:
	src/borg/testsuite/crypto.py
2022-03-06 11:28:27 +03:00
Thomas Waldmann
72ccafb4b8 hmac.digest: some more minor optimizations
also some cosmetic changes:
- import hmac module
- use hmac.compare_digest
2022-03-06 11:26:04 +03:00
Thomas Waldmann
bcd1d49d3b 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-06 11:26:04 +03:00
Thomas Waldmann
4fb6df813a fix codeql complaining about missing headers needed by borg
thus:
- install requirements first
- codeql init
- build borg
- codeql analyzse
2022-03-05 23:28:37 -05:00
aspargas2
aa27294927 fix codeql complaining about missing cython
backports commits 6cbb7d6, 142bb0e, 4df8255, and 30c145e
2022-03-05 23:21:20 -05:00
TW
d0fb234f46
Merge pull request #6404 from ThomasWaldmann/import-tar-fixes-1.2
import-tar fixes
2022-03-05 14:26:59 +01:00
TW
8abb0aa7ab
Merge pull request #6375 from ThomasWaldmann/fix-6374-1.2
create: skip with warning if opening the parent dir of recursion root fails, fixes #6374
2022-03-05 14:18:40 +01:00
Thomas Waldmann
7dc800fecd 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-04 23:33:53 +01:00
Thomas Waldmann
33192e5e5d 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-04 23:33:53 +01:00
TW
ea668417c9
Merge pull request #6405 from ThomasWaldmann/fix-ci
fix wrong branch name in github actions
2022-03-04 23:32:47 +01:00
Thomas Waldmann
412e39b898 fix wrong branch name in github actions 2022-03-04 22:50:23 +01:00
Thomas Waldmann
f5a47d86e3 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-04 21:24:42 +01:00
Thomas Waldmann
9ea1d2a7d6 SaveFile: respect umask for final file mode, fixes #6400 2022-03-04 20:53:10 +01:00
TW
057ae69537
Merge pull request #6384 from ThomasWaldmann/pyupgrade-38-1.2
run pyupgrade (1.2-maint)
2022-02-27 22:52:43 +01:00
Thomas Waldmann
8edb1dc085 manual formatting fixes (cosmetic / pep8) 2022-02-27 21:13:04 +01:00
Thomas Waldmann
c4ed840c7b pyupgrade --py38-plus ./**/*.py 2022-02-27 21:12:44 +01:00
TW
6c243b2c28
Merge pull request #6381 from ThomasWaldmann/remove-blake2-docs-1.2
remove blake2 docs, blake2 code not bundled any more, fixes #6371
2022-02-27 14:44:11 +01:00
Thomas Waldmann
51a676cc6f remove blake2 docs, blake2 code not bundled any more, fixes #6371 2022-02-27 14:43:27 +01:00
TW
97de7e1fe2
Merge pull request #6380 from ThomasWaldmann/fix-zstd-include-1.2
fix zstd.h include for bundled zstd, fixes #6369
2022-02-27 14:39:09 +01:00
Thomas Waldmann
9390d2712b fix zstd.h include for bundled zstd, fixes #6369 2022-02-27 14:35:19 +01:00
Thomas Waldmann
da0ddacc54 create: skip with warning if opening the parent dir of recursion root fails, fixes #6374 2022-02-27 02:40:15 +01:00
TW
c2b76adb19
Merge pull request #6373 from braewoods/warnings
[1.2-maint] fix multiple warnings related to _hashindex.c
2022-02-26 23:42:22 +01:00
James Buren
1618c98975 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 16:13:07 -06:00
James Buren
4427c16d31 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 16:13:02 -06:00
TW
d88d1674b7
Merge pull request #6367 from braewoods/warnings
[1.2-maint] src/borg/compress.pyx: fix compiler warning, closes #6365
2022-02-26 20:42:04 +01:00
James Buren
8e640ae0f3 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-26 13:20:39 -06:00
TW
c6f284d43c
Merge pull request #6364 from braewoods/warnings
[1.2-maint] src/borg/crypto/low_level.pyx: fix compiler warning
2022-02-26 00:40:55 +01:00
James Buren
067dd10027 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 17:36:48 -06:00
Thomas Waldmann
f81c62f894 vagrant: darwin64: remove fakeroot, fixes #6314
deprecated / unsupported / 404.
2022-02-25 23:48:03 +01:00
TW
0fb546978a
Merge pull request #6358 from hexagonrecursion/apt-get-1.2
s/apt/apt-get/ (1.2)
2022-02-25 21:02:39 +01:00
TW
04712a76dc
Merge pull request #6359 from hexagonrecursion/order-1.2
docs: Clarify on-disk order and size of log entry fields (1.2)
2022-02-25 20:50:59 +01:00
Julian Picht
e49a1b5d9b 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 15:03:21 +03:00
Andrey Bienkowski
29ce1fc818 s/apt/apt-get/
> WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2022-02-25 14:44:11 +03:00
TW
6f18167873
Merge pull request #6348 from ThomasWaldmann/nodashes-1.2
docs: do not transform --/--- to unicode dashes
2022-02-23 20:58:44 +01:00
Thomas Waldmann
f5116a7e67 docs: do not transform --/--- to unicode dashes 2022-02-23 20:08:27 +01:00
175 changed files with 12438 additions and 16796 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

@ -4,7 +4,7 @@ name: CI
on:
push:
branches: [ master ]
branches: [ 1.2-maint ]
paths:
- '**.py'
- '**.pyx'
@ -16,7 +16,7 @@ on:
- 'requirements.d/*'
- '!docs/**'
pull_request:
branches: [ master ]
branches: [ 1.2-maint ]
paths:
- '**.py'
- '**.pyx'
@ -31,13 +31,13 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Lint with flake8
@ -49,6 +49,7 @@ jobs:
needs: lint
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
@ -60,29 +61,35 @@ jobs:
- 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
- os: ubuntu-20.04
python-version: '3.11'
toxenv: py311-fuse2
- os: ubuntu-22.04
python-version: '3.12'
toxenv: py312-fuse3
- os: macos-12
python-version: '3.8'
toxenv: py38-fuse2
toxenv: py38-none # note: no fuse testing, due to #6099, see also #6196.
env:
# Configure pkg-config to use OpenSSL from Homebrew
PKG_CONFIG_PATH: /usr/local/opt/openssl@1.1/lib/pkgconfig
PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
TOXENV: ${{ matrix.toxenv }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
@ -107,17 +114,24 @@ jobs:
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
- name: Install Python requirements
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.d/development.txt
- name: Install borgbackup
env:
# we already have that in the global env, but something is broken and overwrites that.
# so, set it here, again.
PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
run: |
# pip install -e .
python setup.py -v develop
- name: run pytest via tox
env:
# we already have that in the global env, but something is broken and overwrites that.
# so, set it here, again.
PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
run: |
# do not use fakeroot, but run as root. avoids the dreaded EISDIR sporadic failures. see #2482.
#sudo -E bash -c "tox -e py"

View file

@ -4,17 +4,17 @@ name: "CodeQL"
on:
push:
branches: [ master ]
branches: [ 1.2-maint ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ 1.2-maint ]
schedule:
- cron: '39 2 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
@ -29,38 +29,41 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# just fetching 1 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@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
python-version: 3.8
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
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@v2
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 -e .
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

27
.github/workflows/windows.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: Windows CI
on: [push, pull_request]
jobs:
msys2-ucrt64:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
- name: Install dependencies
run: ./scripts/msys2-install-deps
- name: Build
run: ./scripts/msys2-build
- name: Test
run: ./dist/borg.exe -V
- uses: actions/upload-artifact@v3
with:
name: borg-windows
path: dist/borg.exe

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

@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
files: '(src|scripts|conftest.py)'

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

View file

@ -1,4 +1,4 @@
Copyright (C) 2015-2022 The Borg Collective (see AUTHORS file)
Copyright (C) 2015-2023 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
# 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
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

@ -171,11 +171,7 @@ see ``docs/support.rst`` in the source distribution).
.. start-badges
|doc| |build| |coverage| |bestpractices| |bounties|
.. |bounties| image:: https://api.bountysource.com/badge/team?team_id=78284&style=bounties_posted
:alt: Bounty Source
:target: https://www.bountysource.com/teams/borgbackup
|doc| |build| |coverage| |bestpractices|
.. |doc| image:: https://readthedocs.org/projects/borgbackup/badge/?version=stable
:alt: Documentation

View file

@ -5,8 +5,9 @@
These borg releases are currently supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 1.1.x | :white_check_mark: |
|---------|--------------------|
| 1.2.x | :white_check_mark: |
| 1.1.x | :x: |
| < 1.1 | :x: |
## Reporting a Vulnerability

76
Vagrantfile vendored
View file

@ -3,8 +3,8 @@
# Automated creation of testing environments / binaries on misc. 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', '16')) # create VMs with that many cpus
$xdistn = Integer(ENV.fetch('XDISTN', '16')) # dispatch tests to that many pytest workers
$wmem = $xdistn * 256 # give the VM additional memory for workers [MB]
def packages_debianoid(user)
@ -42,9 +42,11 @@ def packages_freebsd
pkg install -y fusefs-libs3 || true
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
pkg install -y python38 py38-sqlite3
# make sure there is a python3 command
ln -sf /usr/local/bin/python3.8 /usr/local/bin/python3
python3 -m ensurepip
pip3 install virtualenv
# make bash default / work:
chsh -s bash vagrant
mount -t fdescfs fdesc /dev/fd
@ -52,7 +54,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
@ -68,9 +70,11 @@ def packages_openbsd
return <<-EOF
pkg_add bash
chsh -s bash vagrant
pkg_add xxhash
pkg_add lz4
pkg_add zstd
pkg_add git # no fakeroot
pkg_add openssl%1.1
pkg_add py3-pip
pkg_add py3-virtualenv
EOF
@ -78,8 +82,7 @@ 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 'http://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
@ -91,15 +94,14 @@ def packages_netbsd
# 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
pkg_add py310-sqlite3 py310-pip py310-virtualenv py310-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.
EOF
end
@ -113,7 +115,7 @@ def packages_darwin
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 pkg-config readline openssl@1.1 zstd lz4 xz
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
@ -156,9 +158,10 @@ 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
pyenv install 3.12.0 # tests, version supporting openssl 1.1
pyenv install 3.11.1 # tests, version supporting openssl 1.1
pyenv install 3.10.2 # tests, version supporting openssl 1.1
pyenv install 3.9.18 # tests, version supporting openssl 1.1, binary build
pyenv rehash
EOF
end
@ -176,8 +179,8 @@ def build_pyenv_venv(boxname)
. ~/.bash_profile
cd /vagrant/borg
# use the latest 3.9 release
pyenv global 3.9.10
pyenv virtualenv 3.9.10 borg-env
pyenv global 3.9.18
pyenv virtualenv 3.9.18 borg-env
ln -s ~/.pyenv/versions/borg-env .
EOF
end
@ -201,10 +204,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 'pyinstaller==4.10'
EOF
end
@ -227,10 +227,12 @@ 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.9.18 3.10.2 3.11.1 3.12.0
pyenv local 3.9.18 3.10.2 3.11.1 3.12.0
fi
# otherwise: just use the system python
# avoid that git complains about dubious ownership if we use fakeroot:
git config --global --add safe.directory /vagrant/borg/borg
# some OSes can only run specific test envs, e.g. because they miss FUSE support:
export TOX_SKIP_ENV='#{skip_env}'
if which fakeroot 2> /dev/null; then
@ -281,6 +283,34 @@ Vagrant.configure(2) do |config|
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("focal64", ".*none.*")
end
config.vm.define "jammy64" 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("jammy64")
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("jammy64", ".*none.*")
end
config.vm.define "bookworm64" 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("bookworm64")
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bookworm64")
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bookworm64")
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("bookworm64")
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bookworm64", ".*none.*")
end
config.vm.define "bullseye64" do |b|
b.vm.box = "debian/bullseye64"
b.vm.provider :virtualbox do |v|
@ -314,7 +344,7 @@ Vagrant.configure(2) do |config|
end
config.vm.define "stretch64" do |b|
b.vm.box = "debian/stretch64"
b.vm.box = "generic/debian9"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
@ -330,7 +360,7 @@ Vagrant.configure(2) do |config|
end
config.vm.define "freebsd64" do |b|
b.vm.box = "freebsd121-64"
b.vm.box = "generic/freebsd13"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
@ -347,7 +377,7 @@ Vagrant.configure(2) do |config|
end
config.vm.define "openbsd64" do |b|
b.vm.box = "generic/openbsd6"
b.vm.box = "openbsd71-64"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end

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

@ -5,6 +5,83 @@ Important notes
This section provides information about security and corruption issues.
.. _archives_tam_vuln:
Pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811)
----------------------------------------------------------
A flaw in the cryptographic authentication scheme in Borg allowed an attacker to
fake archives and potentially indirectly cause backup data loss in the repository.
The attack requires an attacker to be able to
1. insert files (with no additional headers) into backups
2. gain write access to the repository
This vulnerability does not disclose plaintext to the attacker, nor does it
affect the authenticity of existing archives.
Creating plausible fake archives may be feasible for empty or small archives,
but is unlikely for large archives.
The fix enforces checking the TAM authentication tag of archives at critical
places. Borg now considers archives without TAM as garbage or an attack.
We are not aware of others having discovered, disclosed or exploited this vulnerability.
Below, if we speak of borg 1.2.6, we mean a borg version >= 1.2.6 **or** a
borg version that has the relevant security patches for this vulnerability applied
(could be also an older version in that case).
Steps you must take to upgrade a repository (this applies to all kinds of repos
no matter what encryption mode they use, including "none"):
1. Upgrade all clients using this repository to borg 1.2.6.
Note: it is not required to upgrade a server, except if the server-side borg
is also used as a client (and not just for "borg serve").
Do **not** run ``borg check`` with borg 1.2.6 before completing the upgrade steps:
- ``borg check`` would complain about archives without a valid archive TAM.
- ``borg check --repair`` would remove such archives!
2. Run: ``BORG_WORKAROUNDS=ignore_invalid_archive_tam borg info --debug <repo> 2>&1 | grep TAM | grep -i manifest``
a) If you get "TAM-verified manifest", continue with 3.
b) If you get "Manifest TAM not found and not required", run
``borg upgrade --tam --force <repository>`` *on every client*.
3. Run: ``BORG_WORKAROUNDS=ignore_invalid_archive_tam borg list --consider-checkpoints --format='{name} {time} tam:{tam}{NL}' <repo>``
"tam:verified" means that the archive has a valid TAM authentication.
"tam:none" is expected as output for archives created by borg <1.0.9.
"tam:none" is also expected for archives resulting from a borg rename
or borg recreate operation (see #7791).
"tam:none" could also come from archives created by an attacker.
You should verify that "tam:none" archives are authentic and not malicious
(== have good content, have correct timestamp, can be extracted successfully).
In case you find crappy/malicious archives, you must delete them before proceeding.
In low-risk, trusted environments, you may decide on your own risk to skip step 3
and just trust in everything being OK.
4. If there are no tam:none archives left at this point, you can skip this step.
Run ``BORG_WORKAROUNDS=ignore_invalid_archive_tam borg upgrade --archives-tam <repo>``.
This will unconditionally add a correct archive TAM to all archives not having one.
``borg check`` would consider TAM-less or invalid-TAM archives as garbage or a potential attack.
To see that all archives now are "tam:verified" run: ``borg list --consider-checkpoints --format='{name} {time} tam:{tam}{NL}' <repo>``
5. Please note that you should never use BORG_WORKAROUNDS=ignore_invalid_archive_tam
for normal production operations - it is only needed once to get the archives in a
repository into a good state. All archives have a valid TAM now.
Vulnerability time line:
* 2023-06-13: Vulnerability discovered during code review by Thomas Waldmann
* 2023-06-13...: Work on fixing the issue, upgrade procedure, docs.
* 2023-06-30: CVE was assigned via Github CNA
* 2023-06-30 .. 2023-08-29: Fixed issue, code review, docs, testing.
* 2023-08-30: Released fixed version 1.2.5 (broken upgrade procedure for some repos)
* 2023-08-31: Released fixed version 1.2.6 (fixes upgrade procedure)
.. _hashindex_set_bug:
Pre-1.1.11 potential index corruption / data loss issue
@ -212,26 +289,17 @@ The best check that everything is ok is to run a dry-run extraction::
borg extract -v --dry-run REPO::ARCHIVE
.. _changelog:
.. _upgradenotes:
Change Log
==========
Upgrade Notes
=============
borg 1.1.x to 1.2.x
-------------------
Version 1.2.0 (2022-02-22 22:02:22 :-)
--------------------------------------
Some things can be recommended for the upgrade process from borg 1.1.x
(please also read the important compatibility notes below):
Please note:
This is the first borg 1.2 release, so be careful and read the notes below.
Upgrade notes:
Strictly taken, nothing special is required for upgrading to 1.2, but some
things can be recommended:
- do you already want to upgrade? 1.1.x also will get fixes for a while.
- be careful, first upgrade your less critical / smaller repos.
- first upgrade to a recent 1.1.x release - especially if you run some older
1.1.* or even 1.0.* borg release.
- using that, run at least one `borg create` (your normal backup), `prune`
@ -239,10 +307,12 @@ things can be recommended:
- check the output of `borg check` - if there is anything special, consider
a `borg check --repair` followed by another `borg check`.
- if everything is fine so far (borg check reports no issues), you can consider
upgrading to 1.2.0. if not, please first fix any already existing issue.
upgrading to 1.2.x. if not, please first fix any already existing issue.
- if you want to play safer, first **create a backup of your borg repository**.
- upgrade to latest borg 1.2.x release (you could use the fat binary from
github releases page)
- borg 1.2.6 has a security fix for the pre-1.2.5 archives spoofing vulnerability
(CVE-2023-36811), see details and necessary upgrade procedure described above.
- run `borg compact --cleanup-commits` to clean up a ton of 17 bytes long files
in your repo caused by a borg 1.1 bug
- run `borg check` again (now with borg 1.2.x) and check if there is anything
@ -260,6 +330,10 @@ and maybe just were not noticed.
Compatibility notes:
- matching of path patterns has been aligned with borg storing relative paths.
Borg archives file paths without leading slashes. Previously, include/exclude
patterns could contain leading slashes. You should check your patterns and
remove leading slashes.
- dropped support / testing for older Pythons, minimum requirement is 3.8.
In case your OS does not provide Python >= 3.8, consider using our binary,
which does not need an external Python interpreter. Or continue using
@ -268,6 +342,7 @@ Compatibility notes:
- mount: the default for --numeric-ids is False now (same as borg extract)
- borg create --noatime is deprecated. Not storing atime is the default behaviour
now (use --atime if you want to store the atime).
- --prefix is deprecated, use -a / --glob-archives, see #6806
- list: corrected mix-up of "isomtime" and "mtime" formats.
Previously, "isomtime" was the default but produced a verbose human format,
while "mtime" produced a ISO-8601-like format.
@ -297,6 +372,356 @@ Compatibility notes:
if you have scripts expecting rc == 2 for a signal exit, you need to update
them to check for >= 128.
.. _changelog:
Change Log
==========
Version 1.2.7 (2023-12-02)
--------------------------
For upgrade and compatibility hints, please also read the section "Upgrade Notes"
above.
Fixes:
- docs: CVE-2023-36811 upgrade steps: consider checkpoint archives, #7802
- check/compact: fix spurious reappearance of orphan chunks since borg 1.2, #6687 -
this consists of 2 fixes:
- for existing chunks: check --repair: recreate shadow index, #6687
- for newly created chunks: update shadow index when doing a double-put, #5661
- LockRoster.modify: no KeyError if element was already gone, #7937
- create --X-from-command: run subcommands with a clean environment, #7916
- list --sort-by: support "archive" as alias of "name", #7873
- fix rc and msg if arg parsing throws an exception, #7885
Other changes:
- support and test on Python 3.12
- include unistd.h in _chunker.c (fix for Python 3.13)
- allow msgpack 1.0.6 and 1.0.7
- TAM issues: show tracebacks, improve borg check logging, #7797
- replace "datetime.utcfromtimestamp" with custom helper to avoid
deprecation warnings when using Python 3.12
- vagrant:
- use generic/debian9 box, fixes #7579
- add VM with debian bookworm / test on OpenSSL 3.0.x.
- docs:
- not only attack/unsafe, can also be a fs issue, #7853
- point to CVE-2023-36811 upgrade steps from borg 1.1 to 1.2 upgrade steps, #7899
- upgrade steps needed for all kinds of repos (including "none" encryption mode), #7813
- upgrade steps: talk about consequences of borg check, #7816
- upgrade steps: remove period that could be interpreted as part of the command
- automated-local.rst: use GPT UUID for consistent udev rule
- create disk/partition sector backup by disk serial number, #7934
- update macOS hint about full disk access
- clarify borg prune -a option description, #7871
- readthedocs: also build offline docs (HTMLzip), #7835
- frontends: add "check.rebuild_refcounts" message
Version 1.2.6 (2023-08-31)
--------------------------
Fixes:
- The upgrade procedure docs as published with borg 1.2.5 did not work, if the
repository had archives resulting from a borg rename or borg recreate operation.
The updated docs now use BORG_WORKAROUNDS=ignore_invalid_archive_tam at some
places to avoid that issue, #7791.
See: fix pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811),
details and necessary upgrade procedure described above.
Other changes:
- updated 1.2.5 changelog entry: 1.2.5 already has the fix for rename/recreate.
- remove cython restrictions. recommended is to build with cython 0.29.latest,
because borg 1.2.x uses this since years and it is very stable.
you can also try to build with cython 3.0.x, there is a good chance that it works.
as a 3rd option, we also bundle the `*.c` files cython outputs in the release
pypi package, so you can also just use these and not need cython at all.
Version 1.2.5 (2023-08-30)
--------------------------
Fixes:
- Security: fix pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811),
see details and necessary upgrade procedure described above.
- rename/recreate: correctly update resulting archive's TAM, see #7791
- create: do not try to read parent dir of recursion root, #7746
- extract: fix false warning about pattern never matching, #4110
- diff: remove surrogates before output, #7535
- compact: clear empty directories at end of compact process, #6823
- create --files-cache=size: fix crash, #7658
- keyfiles: improve key sanity check, #7561
- only warn about "invalid" chunker params, #7590
- ProgressIndicatorPercent: fix space computation for wide chars, #3027
- improve argparse validator error messages
New features:
- mount: make up volname if not given (macOS), #7690.
macFUSE supports a volname mount option to give what finder displays on the
desktop / in the directory view. if the user did not specify it, we make
something up, because otherwise it would be "macFUSE Volume 0 (Python)" and
hide the mountpoint directory name.
- BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos
without key, #7700
Other changes:
- add `utcnow()` helper function to avoid deprecated `datetime.utcnow()`
- stay on latest Cython 0.29 (0.29.36) for borg 1.2.x (do not use Cython 3.0 yet)
- docs:
- move upgrade notes to own section, see #7546
- mount -olocal: how to show mount in finder's sidebar, #5321
- list: fix --pattern examples, #7611
- improve patterns help
- incl./excl. options, path-from-stdin exclusiveness
- obfuscation docs: markup fix, note about MAX_DATA_SIZE
- --one-file-system: add macOS apfs notes, #4876
- improve --one-file-system help string, #5618
- rewrite borg check docs
- improve the docs for --keep-within, #7687
- fix borg init command in environment.rst.inc
- 1.1.x upgrade notes: more precise borg upgrade instructions, #3396
- tests:
- fix repo reopen
- avoid long ids in pytest output
- check buzhash chunksize distribution, see #7586
Version 1.2.4 (2023-03-24)
--------------------------
New features:
- import-tar: add --ignore-zeros to process concatenated tars, #7432.
- debug id-hash: computes file/chunk content id-hash, #7406
- diff: --content-only does not show mode/ctime/mtime changes, #7248
- diff: JSON strings in diff output are now sorted alphabetically
Bug fixes:
- xattrs: fix namespace processing on FreeBSD, #6997
- diff: fix path related bug seen when addressing deferred items.
- debug get-obj/put-obj: always give chunkid as cli param, see #7290
(this is an incompatible change, see also borg debug id-hash)
- extract: fix mtime when ResourceFork xattr is set (macOS specific), #7234
- recreate: without --chunker-params, do not re-chunk, #7337
- 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, #7254.
- set .hardlink_master for ALL hardlinkable items, #7175
- locking: fix host, pid, tid order.
tid (thread id) must be parsed as hex from lock file name.
- update development.lock.txt, including a setuptools security fix, #7227
Other changes:
- requirements: allow msgpack 1.0.5 also
- upgrade Cython to 0.29.33
- hashindex minor fixes, refactor, tweaks, tests
- use os.replace not os.rename
- remove BORG_LIBB2_PREFIX (not used any more)
- docs:
- BORG_KEY_FILE: clarify docs, #7444
- update FAQ about locale/unicode issues, #6999
- improve mount options rendering, #7359
- make timestamps in manual pages reproducible
- installation: update Fedora in distribution list, #7357
- tests:
- fix test_size_on_disk_accurate for large st_blksize, #7250
- add same_ts_ns function and use it for relaxed timestamp comparisons
- "auto" compressor tests: don't assume a specific size,
do not assume zlib is better than lz4, #7363
- add test for extracted directory mtime
- vagrant:
- upgrade local freebsd 12.1 box -> generic/freebsd13 box (13.1)
- use pythons > 3.8 which work on freebsd 13.1
- pyenv: also install python 3.11.1 for testing
- pyenv: use python 3.10.1, 3.10.0 build is broken on freebsd
Version 1.2.3 (2022-12-24)
--------------------------
Fixes:
- create: fix --list --dry-run output for directories, #7209
- diff/recreate: normalize chunker params before comparing them, #7079
- check: fix uninitialised variable if repo is completely empty, #7034
- xattrs: improve error handling, #6988
- fix args.paths related argparsing, #6994
- archive.save(): always use metadata from stats (e.g. nfiles, size, ...), #7072
- tar_filter: recognize .tar.zst as zstd, #7093
- get_chunker: fix missing sparse=False argument, #7056
- file_integrity.py: make sure file_fd is always closed on exit
- repository: cleanup(): close segment before unlinking
- repository: use os.replace instead of os.rename
Other changes:
- remove python < 3.7 compatibility code
- do not use version_tuple placeholder in setuptools_scm template
- CI: fix tox4 passenv issue, #7199
- vagrant: update to python 3.9.16, use the openbsd 7.1 box
- misc. test suite and docs fixes / improvements
- remove deprecated --prefix from docs, #7109
- Windows: use MSYS2 for Github CI, remove Appveyor CI
Version 1.2.2 (2022-08-20)
--------------------------
New features:
- prune/delete --checkpoint-interval=1800 and ctrl-c/SIGINT support, #6284
Fixes:
- SaveFile: use a custom mkstemp with mode support, #6933, #6400, #6786.
This fixes umask/mode/ACL issues (and also "chmod not supported" exceptions
seen in 1.2.1) of files updated using SaveFile, e.g. the repo config.
- hashindex_compact: fix eval order (check idx before use), #5899
- create --paths-from-(stdin|command): normalize paths, #6778
- secure_erase: avoid collateral damage, #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.
- list: fix {flags:<WIDTH>} formatting, #6081
- check: try harder to create the key, #5719
- misc commands: ctrl-c must not kill other subprocesses, #6912
- borg create with a remote repo via ssh
- borg create --content-from-command
- borg create --paths-from-command
- (de)compression filter process of import-tar / export-tar
Other changes:
- deprecate --prefix, use -a / --glob-archives, see #6806
- make setuptools happy ("package would be ignored"), #6874
- fix pyproject.toml to create a fixed _version.py file, compatible with both
old and new setuptools_scm version, #6875
- automate asciinema screencasts
- CI: test on macOS 12 without fuse / fuse tests
(too troublesome on github CI due to kernel extensions needed by macFUSE)
- tests: fix test_obfuscate byte accounting
- repository: add debug logging for issue #6687
- _chunker.c: fix warnings on macOS
- requirements.lock.txt: use the latest cython 0.29.32
- docs:
- add info on man page installation, #6894
- update archive_progress json description about "finished", #6570
- json progress_percent: some values are optional, #4074
- FAQ: full quota / full disk, #5960
- correct shell syntax for installation using git
Version 1.2.1 (2022-06-06)
--------------------------
Fixes:
- create: skip with warning if opening the parent dir of recursion root fails, #6374
- create: fix crash. metadata stream can produce all-zero chunks, #6587
- fix crash when computing stats, escape % chars in archive name, #6500
- fix transaction rollback: use files cache filename as found in txn.active/, #6353
- import-tar: kill filter process in case of borg exceptions, #6401 #6681
- import-tar: fix mtime type bug
- ensure_dir: respect umask for created directory modes, #6400
- SaveFile: respect umask for final file mode, #6400
- check archive: improve error handling for corrupt archive metadata block, make
robust_iterator more robust, #4777
- pre12-meta cache: do not use the cache if want_unique is True, #6612
- fix scp-style repo url parsing for ip v6 address, #6526
- 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.
- show_progress: add finished=true/false to archive_progress json, #6570
- delete/prune: fix --iec mode output (decimal vs. binary units), #6606
- info: fix authenticated mode repo to show "Encrypted: No", #6462
- diff: support presence change for blkdev, chrdev and fifo items, #6615
New features:
- delete: add repository id and location to prompt, #6453
- borg debug dump-repo-objs --ghost: new --segment=S --offset=O options
Other changes:
- support python 3.11
- allow msgpack 1.0.4, #6716
- load_key: no key is same as empty key, #6441
- give a more helpful error msg for unsupported key formats, #6561
- better error msg for defect or unsupported repo configs, #6566
- docs:
- document borg 1.2 pattern matching behavior change, #6407
Make clear that absolute paths always go into the matcher as if they are
relative (without leading slash). Adapt all examples accordingly.
- authentication primitives: improved security and performance infos
- mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, #5602
- FAQ: add a hint about --debug-topic=files_cache
- improve borg check --max-duration description
- fix values of TAG bytes, #6515
- borg compact --cleanup-commits also runs a normal compaction, #6324
- virtualization speed tips
- recommend umask for passphrase file perms
- borg 1.2 is security supported
- update link to ubuntu packages, #6485
- use --numeric-ids in pull mode docs
- remove blake2 docs, blake2 code not bundled any more, #6371
- clarify on-disk order and size of segment file log entry fields, #6357
- docs building: do not transform --/--- to unicode dashes
- tests:
- check that borg does not require pytest for normal usage, fixes #6563
- fix OpenBSD symlink mode test failure, #2055
- vagrant:
- darwin64: remove fakeroot, #6314
- update development.lock.txt
- use pyinstaller 4.10 and python 3.9.13 for binary build
- upgrade VMCPUS and xdistn from 4 to 16, maybe this speeds up the tests
- crypto:
- use hmac.compare_digest instead of ==, #6470
- hmac_sha256: replace own cython wrapper code by hmac.digest python stdlib (since py38)
- hmac and blake2b minor optimizations and cleanups
- removed some unused crypto related code, #6472
- avoid losing the key (potential use-after-free). this never could happen in
1.2 due to the way we use the code. The issue was discovered in master after
other changes, so we also "fixed" it here before it bites us.
- setup / build:
- add pyproject.toml, fix sys.path, #6466
- setuptools_scm: also require it via pyproject.toml
- allow extra compiler flags for every extension build
- fix misc. C / Cython compiler warnings, deprecation warnings
- fix zstd.h include for bundled zstd, #6369
- source using python 3.8 features: ``pyupgrade --py38-plus ./**/*.py``
Version 1.2.0 (2022-02-22 22:02:22 :-)
--------------------------------------
Fixes:
- diff: reduce memory consumption, fix is_hardlink_master, #6295
@ -543,7 +968,7 @@ Other changes:
- add examples for --paths-from-stdin, --paths-from-command, --paths-separator, #5644
- fix typos/grammar
- update docs for dev environment installation instructions
- recomend running tests only on installed versions for setup
- recommend running tests only on installed versions for setup
- add badge with current status of package
- vagrant:
@ -1036,6 +1461,156 @@ Other changes:
Version 1.1.18 (2022-06-05)
---------------------------
Compatibility notes:
- When upgrading from borg 1.0.x to 1.1.x, please note:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
There is one exception though:
If you upgrade from an unpatched borg < 1.0.9, please read that section
above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)"
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
about a unknown unencrypted repository one time.
- your first backup with 1.1.x might be significantly slower (it might
completely read, chunk, hash a lot files) - this is due to the
--files-cache mode change (and happens every time you change mode).
You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible
mode (but that is less safe for detecting changed files than the default).
See the --files-cache docs for details.
- 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux).
If WSL still has a problem with sync_file_range, you need to set
BORG_WORKAROUNDS=basesyncfile in the borg process environment to
work around the WSL issue.
- 1.1.14 changes return codes due to a bug fix:
In case you have scripts expecting rc == 2 for a signal exit, you need to
update them to check for >= 128 (as documented since long).
- 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now.
- 1.1.17 install_requires the "packaging" pypi package now.
New features:
- check --repair: significantly speed up search for next valid object in segment, #6022
- create: add retry_erofs workaround for O_NOATIME issue on volume shadow copies in WSL1, #6024
- key export: display key if path is '-' or not given, #6092
- list --format: add command_line to format keys, #6108
Fixes:
- check: improve error handling for corrupt archive metadata block,
make robust_iterator more robust, #4777
- diff: support presence change for blkdev, chrdev and fifo items, #6483
- diff: reduce memory consumption, fix is_hardlink_master
- init: disallow overwriting of existing keyfiles
- info: fix authenticated mode repo to show "Encrypted: No", #6462
- info: emit repo info even if repo has 0 archives, #6120
- list: remove placeholders for shake_* hashes, #6082
- mount -o versions: give clear error msg instead of crashing
- show_progress: add finished=true/false to archive_progress json, #6570
- fix hardlinkable file type check, #6037
- do not show archive name in error msgs referring to the repository, #6023
- prettier error msg (no stacktrace) if exclude file is missing, #5734
- do not require BORG_CONFIG_DIR if BORG_{SECURITY,KEYS}_DIR are set, #5979
- atomically create the CACHE_TAG file, #6028
- deal with the SaveFile/SyncFile race, docs, see #6176 5c5b59bc9
- avoid expanding path into LHS of formatting operation + tests, #6064 #6063
- repository: quota / compactable computation fixes, #6119.
This is mainly to keep the repo code in sync with borg 1.2. As borg 1.1
compacts immediately, there was not really an issue with this in 1.1.
- fix transaction rollback: use files cache filename as found in txn.active, #6353
- do not load files cache for commands not using it, fixes #5673
- fix scp repo url parsing for ip v6 addrs, #6526
- repo::archive location placeholder expansion fixes, #5826, #5998
- use expanded location for log output
- support placeholder expansion for BORG_REPO env var
- respect umask for created directory and file modes, #6400
- safer truncate_and_unlink implementation
Other changes:
- upgrade bundled xxhash code to 0.8.1
- fix xxh64 related build (setup.py and post-0.8.1 patch for static_assert).
The patch was required to build the bundled xxhash code on FreeBSD, see
https://github.com/Cyan4973/xxHash/pull/670
- msgpack build: remove endianness macro, #6105
- update and fix shell completions
- fuse: remove unneeded version check and compat code
- delete --force: do not ask when deleting a repo, #5941
- delete: don't commit if nothing was deleted, avoid cache sync, #6060
- delete: add repository id and location to prompt
- compact segments: improve freeable / freed space log output, #5679
- if ensure_dir() fails, give more informative error message, #5952
- load_key: no key is same as empty key, #6441
- better error msg for defect or unsupported repo configs, #6566
- use hmac.compare_digest instead of ==, #6470
- implement more standard hashindex.setdefault behaviour
- remove stray punctuation from secure-erase message
- add development.lock.txt, use a real python 3.5 to generate frozen reqs
- setuptools 60.7.0 breaks pyinstaller, #6246
- setup.py clean2 was added to work around some setuptools customizability limitation.
- allow extra compiler flags for every extension build
- C code: make switch fallthrough explicit
- Cython code: fix "useless trailing comma" cython warnings
- requirements.lock.txt: use the latest cython 0.29.30
- fix compilation warnings: PyUnicode_AsUnicode is deprecated
- docs:
- ~/.config/borg/keys is not used for repokey keys, #6107
- excluded parent dir's metadata can't restore, #6062
- permissions note rewritten to make it less confusing, #5490
- add note about grandfather-father-son backup retention policy / rotation scheme
- clarify who starts the remote agent (borg serve)
- test/improve pull backup docs, #5903
- document the socat pull mode described in #900 #515ß
- borg serve: improve ssh forced commands docs, #6083
- improve docs for borg list --format, #6080
- fix the broken link to .nix file
- clarify pattern usage with commands, #5176
- clarify user_id vs uid for fuse, #5723
- fix binary build freebsd/macOS version, #5942
- FAQ: fix manifest-timestamp path, #6016
- remove duplicate faq entries, #5926
- fix sphinx warnings, #5919
- virtualisation speed tips
- fix values of TAG bytes, #6515
- recommend umask for passphrase file perms
- update link to ubuntu packages, #6485
- clarify on-disk order and size of log entry fields, #6357
- do not transform --/--- to unicode dashes
- improve linking inside docs, link to borg_placeholders, link to borg_patterns
- use same phrasing in misc. help texts
- borg init: explain the encryption modes better
- explain the difference between a path that ends with or without a slash, #6297
- clarify usage of patternfile roots, #6242
- borg key export: add examples
- updates about features not experimental any more: FUSE "versions" view, --pattern*, #6134
- fix/update cygwin package requirements
- impact of deleting path/to/repo/nonce, #5858
- warn about tampered server nonce
- mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, #5602
- add a troubleshooting note about "is not a valid repository" to the FAQ
- vagrant / CI / testing:
- misc. fixes and updates, new python versions
- macOS on github: re-enable fuse2 testing by downgrading to older macOS, #6099
- fix OpenBSD symlink mode test failure, #2055
- use the generic/openbsd6 box
- strengthen the test: we can read data w/o nonces
- add tests for path/to/repo/nonce deletion
- darwin64: backport some tunings from master
- darwin64: remove fakeroot, #6314
- darwin64: fix vagrant scp, #5921
- darwin64: use macfuse instead of osxfuse
- add ubuntu "jammy" 22.04 LTS VM
- adapt memory for openindiana64 and darwin64
Version 1.1.17 (2021-07-12)
---------------------------
@ -1045,6 +1620,9 @@ Compatibility notes:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
There is one exception though:
If you upgrade from an unpatched borg < 1.0.9, please read that section
above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)"
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
@ -1172,7 +1750,7 @@ Other changes:
- use macFUSE (not osxfuse) for Apple M1 compatibility
- update docs for dev environment installation instructions, #5643
- fix grammar in faq
- recomend running tests only on installed versions for setup
- recommend running tests only on installed versions for setup
- add link back to git-installation
- remove /var/cache exclusion in example commands, #5625.
This is generally a poor idea and shouldn't be promoted through examples.
@ -1315,6 +1893,9 @@ Compatibility notes:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
There is one exception though:
If you upgrade from an unpatched borg < 1.0.9, please read that section
above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)"
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
@ -1387,6 +1968,9 @@ Compatibility notes:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
There is one exception though:
If you upgrade from an unpatched borg < 1.0.9, please read that section
above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)"
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
@ -1570,6 +2154,9 @@ Compatibility notes:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
There is one exception though:
If you upgrade from an unpatched borg < 1.0.9, please read that section
above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)"
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
@ -1863,6 +2450,9 @@ Compatibility notes:
- read all the compatibility notes for 1.1.0*, starting from 1.1.0b1.
- borg upgrade: you do not need to and you also should not run it.
There is one exception though:
If you upgrade from an unpatched borg < 1.0.9, please read that section
above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)"
- borg might ask some security-related questions once after upgrading.
You can answer them either manually or via environment variable.
One known case is if you use unencrypted repositories, then it will ask
@ -3185,7 +3775,7 @@ Other changes:
cryptohash for dedupe, so people don't worry, #2390
- add hint about chunker params to borg upgrade docs, #2421
- clarify borg upgrade docs, #2436
- quickstart: delete problematic BORG_PASSPRHASE use, #2623
- quickstart: delete problematic BORG_PASSPHRASE use, #2623
- faq: specify "using inline shell scripts"
- document pattern denial of service, #2624
- tests:
@ -3925,7 +4515,7 @@ Bug fixes:
Makes --cache-only idempotent: it won't fail if the cache is already deleted.
- fixed borg create --one-file-system erroneously traversing into other
filesystems (if starting fs device number was 0), #873
- workround a bug in Linux fadvise FADV_DONTNEED, #907
- workaround a bug in Linux fadvise FADV_DONTNEED, #907
Other changes:

View file

@ -40,7 +40,7 @@ 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)'
copyright = '2010-2014 Jonas Borgström, 2015-2023 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
@ -154,6 +154,7 @@ 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 = {
@ -258,6 +259,6 @@ extensions = [
]
extlinks = {
'issue': ('https://github.com/borgbackup/borg/issues/%s', '#'),
'issue': ('https://github.com/borgbackup/borg/issues/%s', '#%s'),
'targz_url': ('https://pypi.python.org/packages/source/b/borgbackup/%%s-%s.tar.gz' % version, None),
}

View file

@ -29,26 +29,12 @@ Configuring the system
First, create the ``/etc/backups`` directory (as root).
All configuration goes into this directory.
Find out the ID of the partition table of your backup disk (here assumed to be /dev/sdz):
lsblk --fs -o +PTUUID /dev/sdz
Then, create ``/etc/backups/40-backup.rules`` with the following content (all on one line)::
ACTION=="add", SUBSYSTEM=="bdi", DEVPATH=="/devices/virtual/bdi/*",
TAG+="systemd", ENV{SYSTEMD_WANTS}="automatic-backup.service"
.. topic:: Finding a more precise udev rule
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
@ -110,7 +96,7 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
# 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
# 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"
@ -136,8 +122,8 @@ 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
@ -145,7 +131,7 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
# Even if it isn't (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/

View file

@ -8,6 +8,38 @@ Backing up disk images can still be efficient with Borg because its `deduplicati
technique makes sure only the modified parts of the file are stored. Borg also has
optional simple sparse file support for extract.
It is of utmost importancy to pin down the disk you want to backup.
You need to use the 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
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 /path/to/repo::{now} "$DISK_ID"
# Use the following to perform a borg backup for all partitions of the disk
# borg create --read-special /path/to/repo::{now} "${PARTITIONS[@]}"
# Example output:
# Partitions of /dev/nvme1n1:
# /dev/nvme1n1p1
# /dev/nvme1n1p2
# /dev/nvme1n1p3
# Disk Identifier: /dev/nvme1n1
# borg create --read-special /path/to/repo::{now} /dev/nvme1n1
# borg create --read-special /path/to/repo::{now} /dev/nvme1n1p1 /dev/nvme1n1p2 /dev/nvme1n1p3
Decreasing the size of image backups
------------------------------------
@ -116,4 +148,4 @@ way to create application-consistent backups.
Borg doesn't 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

@ -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 /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
@ -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 /path/to/repo::archive
cd ~
umount /mnt/sshfs

View file

@ -131,12 +131,9 @@ you run the tests.
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 +161,13 @@ virtual env and run::
pip install -r requirements.d/development.txt
This project utilizes pre-commit to 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
-----------------
@ -195,26 +199,6 @@ Important notes:
- When using ``--`` to give options to py.test, you MUST also give ``borg.testsuite[.module]``.
Running more checks using coala
-------------------------------
First install coala and some checkers ("bears"):
::
pip install -r requirements.d/coala.txt
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.
Adding a compression algorithm
------------------------------
@ -349,6 +333,9 @@ Checklist:
scripts/sdist-sign X.Y.Z
scripts/upload-pypi X.Y.Z test
scripts/upload-pypi X.Y.Z
Note: the signature is not uploaded to PyPi any more, but we upload it to
github releases.
- Put binaries into dist/borg-OSNAME and sign them:
::
@ -366,9 +353,10 @@ Checklist:
- Create a GitHub release, include:
* 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
+ For macOS, 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``.

View file

@ -45,6 +45,12 @@ repository is only modified from one place. Also keep in mind that
Borg will keep an exclusive lock on the repository while creating
or deleting archives, which may make *simultaneous* backups fail.
Can I back up to multiple, swapped backup targets?
--------------------------------------------------
It is possible to swap your backup disks if each backup medium is assigned its
own repository by creating a new one with :ref:`borg_init`.
Can I copy or synchronize my repo to another location?
------------------------------------------------------
@ -107,6 +113,9 @@ run into this by yourself by restoring an older copy of your repository.
"attack": maybe an attacker has replaced your repo by an older copy, trying to
trick you into AES counter reuse, trying to break your repo encryption.
Borg users have also reported that fs issues (like hw issues / I/O errors causing
the fs to become read-only) can cause this warning, see :issue:`7853`.
If you'ld decide to ignore this and accept unsafe operation for this repository,
you could delete the manifest-timestamp and the local cache:
@ -429,18 +438,19 @@ How do I configure different prune policies for different directories?
Say you want to prune ``/var/log`` faster than the rest of
``/``. How do we implement that? The answer is to backup to different
archive *names* and then implement different prune policies for
different prefixes. For example, you could have a script that does::
different --glob-archives matching patterns.
borg create --exclude /var/log $REPOSITORY:main-$(date +%Y-%m-%d) /
For example, you could have a script that does::
borg create --exclude var/log $REPOSITORY:main-$(date +%Y-%m-%d) /
borg create $REPOSITORY:logs-$(date +%Y-%m-%d) /var/log
Then you would have two different prune calls with different policies::
borg prune --verbose --list -d 30 --prefix main- "$REPOSITORY"
borg prune --verbose --list -d 7 --prefix logs- "$REPOSITORY"
borg prune --verbose --list -d 30 --glob-archives 'main-*' "$REPOSITORY"
borg prune --verbose --list -d 7 --glob-archives 'logs-*' "$REPOSITORY"
This will keep 7 days of logs and 30 days of everything else. Borg 1.1
also supports the ``--glob-archives`` parameter.
This will keep 7 days of logs and 30 days of everything else.
How do I remove files from an existing backup?
----------------------------------------------
@ -564,8 +574,7 @@ Using ``BORG_PASSCOMMAND`` with a properly permissioned file
directory and use permissions to keep anyone else from reading it. For
example, first create a key::
head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase
chmod 400 ~/.borg-passphrase
(umask 0077; head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase)
Then in an automated script one can put::
@ -727,7 +736,7 @@ Since the nonce is not necessary to read the data that is already encrypted,
``borg info``, ``borg list``, ``borg extract`` and ``borg mount`` should work
just fine without it.
If the the nonce file stored in the repo is lost, but you still have your local copy,
If the nonce file stored in the repo is lost, but you still have your local copy,
borg will recreate the repository nonce file the next time you run ``borg create``.
This should be safe for repositories that are only used from one user account
on one machine.
@ -739,6 +748,15 @@ the nonce is deleted or if you suspect it may have been tampered with. See :ref:
Common issues
#############
/path/to/repo is not a valid repository. Check repo config.
-----------------------------------------------------------
There can be many causes of this error. E.g. you have incorrectly specified the repository path.
You will also get this error if you try to access a repository that uses the argon2 key algorithm using an old version of borg.
We recommend upgrading to the latest stable version and trying again. We are sorry. We should have thought abount forward
compatibility and implemented a more helpful error message.
Why does Borg extract hang after some time?
-------------------------------------------
@ -863,6 +881,12 @@ Check if your encoding is set correctly. For most POSIX-like systems, try::
export LANG=en_US.UTF-8 # or similar, important is correct charset
If that does not help:
- check for typos, check if you really used ``export``.
- check if you have set ``LC_ALL`` - if so, try not setting it.
- check if you generated the respective locale via ``locale-gen``.
I can't extract non-ascii filenames by giving them on the commandline!?
-----------------------------------------------------------------------
@ -933,6 +957,24 @@ Then you do the backup and look at the log output:
details and potential issues).
You can use the ``stat`` command on files to manually look at fs metadata to debug if
there is any unexpected change triggering the ``M`` status.
Also, the ``--debug-topic=files_cache`` option of ``borg create`` provides a lot of debug
output helping to analyse why the files cache does not give its expected high performance.
When borg runs inside a virtual machine, there are some more things to look at:
Some hypervisors (e.g. kvm on proxmox) give some broadly compatible CPU type to the
VM (usually to ease migration between VM hosts of potentially different hardware CPUs).
It is broadly compatible because they leave away modern CPU features that could be
not present in older or other CPUs, e.g. hardware acceleration for AES crypto, for
sha2 hashes, for (P)CLMUL(QDQ) computations useful for crc32.
So, basically you pay for compatibility with bad performance. If you prefer better
performance, you should try to expose the host CPU's misc. hw acceleration features
to the VM which runs borg.
On Linux, check ``/proc/cpuinfo`` for the CPU flags inside the VM.
For kvm check the docs about "Host model" and "Host passthrough".
See also the next few FAQ entries for more details.
@ -1007,6 +1049,10 @@ will be slow because it would chunk all the files each time. If you set
BORG_FILES_CACHE_TTL to at least 26 (or maybe even a small multiple of that),
it would be much faster.
Besides using a higher BORG_FILES_CACHE_TTL (which also increases memory usage),
there is also BORG_FILES_CACHE_SUFFIX which can be used to have separate (smaller)
files caches for each backup set instead of the default one (big) unified files cache.
Another possible reason is that files don't always have the same path, for
example if you mount a filesystem without stable mount points for each backup
or if you are running the backup from a filesystem snapshot whose name is not
@ -1178,10 +1224,58 @@ It may be useful to set ``BORG_RELOCATED_REPO_ACCESS_IS_OK=yes`` to avoid the
prompts when renaming multiple repositories or in a non-interactive context
such as a script. See :doc:`deployment` for an example.
The repository quota size is reached, what can I do?
----------------------------------------------------
The simplest solution is to increase or disable the quota and resume the backup:
::
borg config /path/to/repo storage_quota 0
If you are bound to the quota, you have to free repository space. The first to
try is running :ref:`borg_compact` to free unused backup space (see also
:ref:`separate_compaction`):
::
borg compact /path/to/repo
If your repository is already compacted, run :ref:`borg_prune` or
:ref:`borg_delete` to delete archives that you do not need anymore, and then run
``borg compact`` again.
My backup disk is full, what can I do?
--------------------------------------
Borg cannot work if you really have zero free space on the backup disk, so the
first thing you must do is deleting some files to regain free disk space. See
:ref:`about_free_space` for further details.
Some Borg commands that do not change the repository might work under disk-full
conditions, but generally this should be avoided. If your backup disk is already
full when Borg starts a write command like `borg create`, it will abort
immediately and the repository will stay as-is.
If you run a backup that stops due to a disk running full, Borg will roll back,
delete the new new segment file and thus freeing disk space automatically. There
may be a checkpoint archive left that has been saved before the disk got full.
You can keep it to speed up the next backup or delete it to get back more disk
space.
Miscellaneous
#############
macOS: borg mounts not shown in Finder's side bar
-------------------------------------------------
https://github.com/osxfuse/osxfuse/wiki/Mount-options#local
Read the above first and use this on your own risk::
borg mount -olocal REPO MOUNTPOINT
Requirements for the borg single-file binary, esp. (g)libc?
-----------------------------------------------------------

View file

@ -65,7 +65,7 @@ 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
.. _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
@ -78,7 +78,7 @@ 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 /
@ -266,7 +266,7 @@ 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.
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::
@ -326,6 +326,8 @@ Use the Cygwin installer to install the dependencies::
Using pip
~~~~~~~~~
Ensure to install the dependencies as described within :ref:`source-install`.
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.
@ -358,11 +360,26 @@ 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
~~~~~~~~~
Ensure to install the dependencies as described within :ref:`source-install`.
This uses latest, unreleased development code from git.
While we try not to break master, there are no guarantees on anything.
@ -372,7 +389,7 @@ While we try not to break master, there are no guarantees on anything.
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

View file

@ -94,13 +94,13 @@ this value in a non-empty repository, you may also need to relocate the segment
files manually.
A segment starts with a magic number (``BORG_SEG`` as an eight byte ASCII string),
followed by a number of log entries. Each log entry consists of:
followed by a number of log entries. Each log entry consists of: (in this order)
* 32-bit size of the entry
* CRC32 of the entire entry (for a PUT this includes the data)
* entry tag: PUT, DELETE or COMMIT
* PUT and DELETE follow this with the 32 byte key
* PUT follow the key with the data
* First, unsigned 32-bit number, the CRC32 of the entire entry (for a PUT including the DATA) excluding the CRC32 field
* Second, unsigned 32-bit size of the entry (including the whole header)
* Third, unsigned 8-bit entry tag: PUT(0), DELETE(1) or COMMIT(2)
* Fourth, on PUT or DELETE, 32 byte key
* Fifth, PUT only, (size - 41) bytes of data (length = size - sizeof(CRC32) - sizeof(size) - sizeof(entry tag) - sizeof(key))
Those files are strictly append-only and modified only once.
@ -121,6 +121,14 @@ partial/uncommitted transaction.
The size of individual segments is limited to 4 GiB, since the offset of entries
within segments is stored in a 32-bit unsigned integer in the repository index.
Objects
~~~~~~~
All objects (the manifest, archives, archive item streams chunks and file data
chunks) are encrypted and/or compressed. See :ref:`data-encryption` for a
graphic outlining the anatomy of an object in Borg. The `type` for compression
is explained in :ref:`data-compression`.
Index, hints and integrity
~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -860,6 +868,8 @@ HashIndex is implemented in C and wrapped with Cython in a class-based interface
The Cython wrapper checks every passed value against these reserved values and
raises an AssertionError if they are used.
.. _data-encryption:
Encryption
----------
@ -961,18 +971,23 @@ key file, wrapped using the standard ``textwrap`` module with a header.
The header is a single line with a MAGIC string, a space and a hexadecimal
representation of the repository id.
.. _data-compression:
Compression
-----------
Borg supports the following compression methods:
Borg supports the following compression methods, each identified by two bytes:
- none (no compression, pass through data 1:1)
- lz4 (low compression, but super fast)
- none (no compression, pass through data 1:1), identified by ``\x00\x00``
- lz4 (low compression, but super fast), identified by ``\x01\x00``
- zstd (level 1-22 offering a wide range: level 1 is lower compression and high
speed, level 22 is higher compression and lower speed) - since borg 1.1.4
speed, level 22 is higher compression and lower speed) - since borg 1.1.4,
identified by ``\x03\x00``
- zlib (level 0-9, level 0 is no compression [but still adding zlib overhead],
level 1 is low, level 9 is high compression)
- lzma (level 0-9, level 0 is low, level 9 is high compression).
level 1 is low, level 9 is high compression), identified by a zlib header
(``\x.8\x..``)
- lzma (level 0-9, level 0 is low, level 9 is high compression), identified
by ``\x02\x00``.
Speed: none > lz4 > zlib > lzma, lz4 > zstd
Compression: lzma > zlib > lz4 > none, zstd > lz4

View file

@ -10,7 +10,7 @@ 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
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 just invoke :ref:`borg_create`, give commandline parameters/options
as needed and parse JSON output from borg.
@ -50,17 +50,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 +93,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)
@ -465,13 +470,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 +500,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``::
@ -632,6 +637,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.

View file

@ -142,14 +142,17 @@ Depending on the chosen mode (see :ref:`borg_init`) different primitives are use
and is also tracked locally on the client to avoid counter reuse.
- 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.
in a keyed mode.
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.
Both HMAC-SHA-256 and BLAKE2b have undergone extensive cryptanalysis
and have proven secure against known attacks. The known vulnerability
of SHA-256 against length extension attacks does not apply to HMAC-SHA-256.
The authentication primitive should be chosen based upon SHA hardware support:
all AMD Ryzen, Intel 10th+ generation mobile and Intel 11th+ generation
desktop processors, Apple M1+ and most current ARM64 architectures support
SHA extensions and are likely to perform best with HMAC-SHA-256.
64-bit CPUs without SHA extensions are likely to perform best with BLAKE2b.
- The primitive used for authentication is always the same primitive
that is used for deriving the chunk ID, but they are always

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-BENCHMARK-CRUD" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-BENCHMARK-CRUD" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-benchmark-crud \- Benchmark Create, Read, Update, Delete for archives.
.SH SYNOPSIS

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-BENCHMARK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-BENCHMARK" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-benchmark \- benchmark command
.SH SYNOPSIS

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-BREAK-LOCK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-BREAK-LOCK" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-break-lock \- Break the repository lock (e.g. in case it was left by a dead borg.
.SH SYNOPSIS

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-CHECK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-CHECK" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-check \- Check repository consistency
.SH SYNOPSIS
@ -35,91 +35,123 @@ borg-check \- Check repository consistency
borg [common options] check [options] [REPOSITORY_OR_ARCHIVE]
.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 segment magic headers, and both the metadata and data of all objects in
the segments. The read data is checked by size and CRC. 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 a 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 cryptographically verify
the file (content) data integrity pass \fB\-\-verify\-data\fP, but keep in mind
that this requires reading all data and is hence very time consuming. 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
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!
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 it with
\fB\-\-max\-duration\fP) can only perform non\-cryptographic checksum checks on the
segment files. A full repository check (i.e. without \fB\-\-max\-duration\fP) can
also do a repository index check. Enabling partial repository checks excepts
archive checks for the same reason. Therefore partial checks may be useful with
very large repositories only 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 the CRC32 of the segment) 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 can
not use \fB\-\-verify\-data\fP with \fB\-\-repository\-only\fP\&.
.SS About repair mode
.sp
The check command is a readonly 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 can not 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 will try to recover
as many objects from segments with integrity errors as possible, and ensure
that the index is consistent with the data stored in the segments.
.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. On a chunk level (i.e. the contents of files), repair mode
will replace corrupt or lost chunks with a same\-size replacement chunk of
zeroes. If a previously zeroed chunk reappears, repair mode will restore
this lost chunk using the new chunk. Lastly, repair mode will also delete
orphaned chunks (e.g. caused by read errors while creating the archive).
.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
Most steps taken by repair mode have a one\-time effect on the repository, like
removing a lost archive from the repository. However, replacing a corrupt or
lost chunk with an all\-zero replacement will have an ongoing effect on the
repository: When attempting to extract a file referencing an all\-zero chunk,
the \fBextract\fP command will distinctly warn about it. The FUSE filesystem
created by the \fBmount\fP command will reject reading such a \(dqzero\-patched\(dq
file unless a special mount option is given.
.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.
As mentioned earlier, Borg might be able to \(dqheal\(dq a \(dqzero\-patched\(dq file in
repair mode, if all its previously lost chunks reappear (e.g. via a later
backup). This is achieved by Borg not only keeping track of the all\-zero
replacement chunks, but also by keeping metadata about the lost chunks. In
repair mode Borg will check whether a previously lost chunk reappeared and will
replace the all\-zero replacement chunk by the reappeared chunk. If all lost
chunks of a \(dqzero\-patched\(dq file reappear, this effectively \(dqheals\(dq the file.
Consequently, if lost chunks were repaired earlier, it is advised to run
\fB\-\-repair\fP a second time after creating some new backups.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
@ -129,7 +161,7 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.B REPOSITORY_OR_ARCHIVE
repository or archive to check consistency of
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-repository\-only
@ -154,13 +186,13 @@ do only a partial repo check for max. SECONDS seconds (Default: unlimited)
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(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; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied

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 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-common \- Common options of Borg commands
.SH SYNOPSIS
@ -79,7 +79,7 @@ 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")
use PATH as borg executable on the remote (default: \(dqborg\(dq)
.TP
.BI \-\-remote\-ratelimit \ RATE
deprecated, use \fB\-\-upload\-ratelimit\fP instead
@ -97,7 +97,7 @@ set network upload buffer size in MiB. (default: 0=no buffer)
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)

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-COMPACT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-COMPACT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-compact \- compact segment files in the repository
.SH SYNOPSIS
@ -53,7 +53,8 @@ When using \fB\-\-verbose\fP, borg will output an estimate of the freed space.
.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.
due to a bug. It is enough to do that once per repository. After cleaning up the
commits, borg will also do a normal compaction.
.sp
See \fIseparate_compaction\fP in Additional Notes for more details.
.SH OPTIONS
@ -65,7 +66,7 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.B REPOSITORY
repository to compact
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-cleanup\-commits

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-COMPRESSION" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-COMPRESSION" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-compression \- Details regarding compression
.SH DESCRIPTION
@ -53,20 +53,20 @@ 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,35 +76,76 @@ 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.
.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
.nf
.ft C
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
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example probabilities for SPEC \fB1\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
90 % 0.01 .. 0.1
9 % 0.1 .. 1
0.9 % 1 .. 10
0.09% 10 .. 100
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fIRandomly sized padding up to the given size\fP (additive)
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
110: 1kiB (2 ^ (SPEC \- 100))
\&...
120: 1MiB
\&...
123: 8MiB (max.)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Examples:
@ -120,7 +161,7 @@ borg create \-\-compression zlib REPO::ARCHIVE data
borg create \-\-compression zlib,1 REPO::ARCHIVE data
borg create \-\-compression auto,lzma,6 REPO::ARCHIVE data
borg create \-\-compression auto,lzma ...
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

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-CONFIG" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-CONFIG" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-config \- get, set, and delete values in a repository or cache config file
.SH SYNOPSIS
@ -41,8 +41,8 @@ For security reasons, this command only works on local repositories.
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
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
@ -62,7 +62,7 @@ name of config key
.B VALUE
new value for key
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-c\fP,\fB \-\-cache

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-CREATE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-CREATE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-create \- Create new archive
.SH SYNOPSIS
@ -112,8 +112,8 @@ The \fB\-\-progress\fP option shows (from left to right) Original, Compressed an
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
@ -132,7 +132,7 @@ name of archive to create (must be also a valid directory name)
.B PATH
paths to archive
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
@ -169,15 +169,15 @@ set mode to M in archive for stdin data (default: 0660)
interpret PATH as command and store its stdout. See also section Reading from stdin 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 backup 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
@ -208,7 +208,7 @@ exclude files flagged NODUMP
.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.
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\-owner
deprecated, use \fB\-\-numeric\-ids\fP instead
@ -265,7 +265,7 @@ write checkpoint every SECONDS seconds (Default: 1800)
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
@ -273,7 +273,7 @@ select compression algorithm, see the output of the "borg help compression" comm
.sp
.nf
.ft C
# Backup ~/Documents into an archive named "my\-documents"
# Backup ~/Documents into an archive named \(dqmy\-documents\(dq
$ borg create /path/to/repo::my\-documents ~/Documents
# same, but list all files as we process them
@ -288,17 +288,17 @@ $ borg create /path/to/repo::my\-files \e
# 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
\-\-exclude \(aqsh:home/*/.thumbnails\(aq
# Backup the root filesystem into an archive named "root\-YYYY\-MM\-DD"
# Backup the root filesystem into an archive named \(dqroot\-YYYY\-MM\-DD\(dq
# use zlib compression (good, but slow) \- default is lz4 (fast, low compression ratio)
$ borg create \-C zlib,6 \-\-one\-file\-system /path/to/repo::root\-{now:%Y\-%m\-%d} /
# Backup onto a remote host ("push" style) via ssh to port 2222,
# logging in as user "borg" and storing into /path/to/repo
# Backup onto a remote host (\(dqpush\(dq style) via ssh to port 2222,
# logging in as user \(dqborg\(dq and storing into /path/to/repo
$ borg create ssh://borg@backup.example.org:2222/path/to/repo::{fqdn}\-root\-{now} /
# Backup a remote host locally ("pull" style) using sshfs
# Backup a remote host locally (\(dqpull\(dq style) using sshfs
$ mkdir sshfs\-mount
$ sshfs root@example.com:/ sshfs\-mount
$ cd sshfs\-mount
@ -341,7 +341,7 @@ $ borg create /path/to/repo::{hostname}\-{user}\-{now:%Y\-%m\-%dT%H:%M:%S.%f} ~
# Backing up relative paths by moving into the correct directory first
$ cd /home/user/Documents
# The root directory of the archive will be "projectA"
# The root directory of the archive will be \(dqprojectA\(dq
$ borg create /path/to/repo::daily\-projectA\-{now:%Y\-%m\-%d} projectA
# Use external command to determine files to archive
@ -352,7 +352,7 @@ $ borg create \-\-paths\-from\-command /path/to/repo::joes\-files \-\- find /srv
# 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
\-\-paths\-delimiter \(dq\e0\(dq \e
/path/to/repo::smallfiles\-handle\-newline
.ft P
.fi
@ -376,13 +376,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 +395,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

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-DELETE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-DELETE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-delete \- Delete an existing repository or archives
.SH SYNOPSIS
@ -48,15 +48,13 @@ with the \fB\-\-cache\-only\fP option, or keep the security info with the
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
deleted \- the \(dqDeleted data\(dq 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.
Please note that the \(dqAll archives\(dq 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.
You can delete multiple archives by specifying 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).
.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
@ -73,7 +71,7 @@ repository or archive to delete
.B ARCHIVE
archives to delete
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
@ -96,18 +94,21 @@ keep the local security info when deleting a repository
.TP
.B \-\-save\-space
work slower, but using less space
.TP
.BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
write checkpoint every SECONDS seconds (Default: 1800)
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(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; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
@ -126,10 +127,10 @@ $ borg delete /path/to/repo::Monday
# actually free disk space:
$ borg compact /path/to/repo
# delete all archives whose names begin with the machine\(aqs hostname followed by "\-"
$ borg delete \-\-prefix \(aq{hostname}\-\(aq /path/to/repo
# delete all archives whose names begin with the machine\(aqs hostname followed by \(dq\-\(dq
$ borg delete \-\-glob\-archives \(aq{hostname}\-*\(aq /path/to/repo
# delete all archives whose names contain "\-2012\-"
# delete all archives whose names contain \(dq\-2012\-\(dq
$ borg delete \-\-glob\-archives \(aq*\-2012\-*\(aq /path/to/repo
# see what would be deleted if delete was run without \-\-dry\-run

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-DIFF" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-DIFF" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-diff \- Diff contents of two archives
.SH SYNOPSIS
@ -66,7 +66,7 @@ ARCHIVE2 name (no repository location allowed)
.B PATH
paths of items inside the archives to compare; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-numeric\-owner
@ -81,10 +81,13 @@ Override check of chunker parameters.
.B \-\-sort
Sort the output lines by file path.
.TP
.B \-\-content\-only
Only compare differences in content (exclude metadata differences)
.TP
.B \-\-json\-lines
Format output as JSON Lines.
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -114,10 +117,10 @@ $ touch file3
$ borg create ../testrepo::archive1 .
$ chmod a+x file1
$ echo "something" >> file2
$ echo \(dqsomething\(dq >> file2
$ borg create ../testrepo::archive2 .
$ echo "testing 123" >> file1
$ echo \(dqtesting 123\(dq >> file1
$ rm file3
$ touch file4
$ borg create ../testrepo::archive3 .
@ -139,10 +142,10 @@ 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}]
{\(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}]
.ft P
.fi
.UNINDENT

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-EXPORT-TAR" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-EXPORT-TAR" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-export-tar \- Export archive contents as a tarball
.SH SYNOPSIS
@ -50,7 +50,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
@ -86,12 +86,12 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
archive to export
.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
@ -100,7 +100,7 @@ filter program to pipe data through
.B \-\-list
output verbose list of items (files, dirs, ...)
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -131,14 +131,14 @@ $ borg export\-tar /path/to/repo::Monday Monday.tar
$ 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
$ borg export\-tar \-\-tar\-filter=\(dqgzip \-9\(dq 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"
# remote extraction via \(dqtarpipe\(dq
$ borg export\-tar /path/to/repo::Monday \- | ssh somewhere \(dqcd extracted; tar x\(dq
.ft P
.fi
.UNINDENT

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-EXTRACT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-EXTRACT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-extract \- Extract archive contents
.SH SYNOPSIS
@ -52,7 +52,7 @@ 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
@ -72,7 +72,7 @@ archive to extract
.B PATH
paths to extract; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-list
@ -105,7 +105,7 @@ write all extracted data to stdout
.B \-\-sparse
create holes in output sparse file from all\-zero chunks
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -138,10 +138,10 @@ $ borg extract \-\-list /path/to/repo::my\-files
# Verify whether an archive could be successfully extracted, but do not write files to disk
$ borg extract \-\-dry\-run /path/to/repo::my\-files
# Extract the "src" directory
# Extract the \(dqsrc\(dq directory
$ borg extract /path/to/repo::my\-files home/USERNAME/src
# Extract the "src" directory but exclude object files
# Extract the \(dqsrc\(dq directory but exclude object files
$ borg extract /path/to/repo::my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq
# Restore a raw device (must not be active/in use/mounted at that time)

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-IMPORT-TAR" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-IMPORT-TAR" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-import-tar \- Create a backup archive from a tarball
.SH SYNOPSIS
@ -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
@ -70,6 +70,10 @@ 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.
.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.
@ -80,9 +84,9 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
name of archive to create (must be also a valid directory 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 +103,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
@ -116,7 +123,7 @@ write checkpoint every SECONDS seconds (Default: 1800)
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 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-INFO" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-INFO" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-info \- Show archive details such as disk space used
.SH SYNOPSIS
@ -38,7 +38,7 @@ borg [common options] info [options] [REPOSITORY_OR_ARCHIVE]
This command displays detailed information about the specified archive or repository.
.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
up to the deduplicated size of the repository (\(dqall archives\(dq), because the two
are meaning different things:
.sp
This archive / deduplicated size = amount of data stored ONLY for this archive
@ -59,7 +59,7 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.B REPOSITORY_OR_ARCHIVE
repository or archive to display information about
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-json
@ -69,13 +69,13 @@ format output as JSON
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(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; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied

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-INIT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-INIT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-init \- Initialize an empty repository
.SH SYNOPSIS
@ -82,7 +82,7 @@ This is why it is essential to use a secure passphrase.
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).
\(dqleaving your keys inside your car\(dq (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
@ -119,11 +119,13 @@ 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\&.
If you want \(dqpassphrase and having\-the\-key\(dq 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\&.
To normally work with \fBauthenticated\fP repos, you will need the passphrase, but
there is an emergency workaround, see \fBBORG_WORKAROUNDS=authenticated_no_key\fP docs.
.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
@ -223,7 +225,7 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.B REPOSITORY
repository to create
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE

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-KEY-CHANGE-PASSPHRASE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-CHANGE-PASSPHRASE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-key-change-passphrase \- Change repository key file passphrase
.SH SYNOPSIS
@ -56,11 +56,11 @@ REPOSITORY
.ft C
# Create a key file protected repository
$ borg init \-\-encryption=keyfile \-v /path/to/repo
Initializing repository at "/path/to/repo"
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.
@ -90,9 +90,9 @@ Fully automated using environment variables:
.nf
.ft C
$ BORG_NEW_PASSPHRASE=old borg init \-e=repokey repo
# now "old" is the current passphrase.
# now \(dqold\(dq is the current passphrase.
$ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change\-passphrase repo
# now "new" is the current passphrase.
# now \(dqnew\(dq is the current passphrase.
.ft P
.fi
.UNINDENT

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-KEY-EXPORT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-EXPORT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-key-export \- Export the repository key for backup
.SH SYNOPSIS
@ -85,7 +85,7 @@ REPOSITORY
.B PATH
where to store the backup
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-paper

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-KEY-IMPORT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-IMPORT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-key-import \- Import the repository key from backup
.SH SYNOPSIS
@ -60,7 +60,7 @@ REPOSITORY
.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,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-KEY-MIGRATE-TO-REPOKEY" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY-MIGRATE-TO-REPOKEY" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-key-migrate-to-repokey \- Migrate passphrase -> repokey
.SH SYNOPSIS

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-KEY" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-KEY" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-key \- Manage a keyfile or repokey of a repository
.SH SYNOPSIS

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-LIST" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-LIST" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-list \- List archive or repository contents
.SH SYNOPSIS
@ -50,7 +50,7 @@ repository or archive to list contents of
.B PATH
paths to list; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-consider\-checkpoints
@ -60,25 +60,25 @@ Show checkpoint archives in the repository contents list (default: hidden).
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}")
specify format for file or archive listing (default for files: \(dq{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}\(dq; for archives: \(dq{archive:<36} {time} [{id}]{NL}\(dq)
.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.
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 \(dqbarchive\(dq key is therefore not available.
.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.
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 \(dqbpath\(dq key is therefore not available.
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(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; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
@ -86,7 +86,7 @@ consider first N archives after other filters were applied
.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
@ -122,14 +122,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 /path/to/repo::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 /path/to/repo::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,11 +137,11 @@ 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 /path/to/repo/::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 /path/to/repo/::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
\&...
@ -207,7 +207,7 @@ Keys available only when listing archives in a repository:
.IP \(bu 2
archive: archive name interpreted as text (might be missing non\-text characters, see barchive)
.IP \(bu 2
name: alias of "archive"
name: alias of \(dqarchive\(dq
.IP \(bu 2
barchive: verbatim archive name, can contain any character except NUL
.IP \(bu 2
@ -217,9 +217,11 @@ bcomment: verbatim archive comment, can contain any character except NUL
.IP \(bu 2
id: internal ID of the archive
.IP \(bu 2
tam: TAM authentication state of this archive
.IP \(bu 2
start: time (start) of creation of the archive
.IP \(bu 2
time: alias of "start"
time: alias of \(dqstart\(dq
.IP \(bu 2
end: time (end) of creation of the archive
.IP \(bu 2
@ -309,9 +311,9 @@ archiveid
.IP \(bu 2
archivename
.IP \(bu 2
extra: prepends {source} with " \-> " for soft links and " link to " for hard links
extra: prepends {source} with \(dq \-> \(dq for soft links and \(dq link to \(dq for hard links
.IP \(bu 2
health: either "healthy" (file ok) or "broken" (if file has all\-zero replacement chunks)
health: either \(dqhealthy\(dq (file ok) or \(dqbroken\(dq (if file has all\-zero replacement chunks)
.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-MOUNT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-MOUNT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-mount \- Mount archive or an entire repository as a FUSE filesystem
.SH SYNOPSIS
@ -69,16 +69,16 @@ manually. Unlike the \fBuid\fP and \fBgid\fP mount options which affect all file
Additional mount options supported by borg:
.INDENT 0.0
.IP \(bu 2
versions: when used with a repository mount, this gives a merged, versioned
\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 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
\fBallow_damaged_files\fP: by default damaged files (where missing chunks were
replaced with runs of zeros by \fBborg check \-\-repair\fP) are not readable and
return EIO (I/O error). Set this option to read such files.
.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
@ -107,7 +107,7 @@ where to mount filesystem
.B PATH
paths to extract; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-consider\-checkpoints
@ -129,13 +129,13 @@ use numeric user and group identifiers from archive(s)
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(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; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
@ -143,7 +143,7 @@ consider first N archives after other filters were applied
.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

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-PATTERNS" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-PATTERNS" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-patterns \- Details regarding patterns
.SH DESCRIPTION
@ -36,36 +36,20 @@ The path/filenames used as input for the pattern matching start from the
currently active recursion root. You usually give the recursion root(s)
when invoking borg and these can be either relative or absolute paths.
.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\&.
.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\&.
Starting with Borg 1.2, paths that are matched against patterns always
appear relative. If you give \fB/absolute/\fP as root, the paths going
into the matcher will start with \fBabsolute/\fP\&.
If you give \fB\&../../relative\fP as root, the paths will be normalized
as \fBrelative/\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).
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).
.INDENT 0.0
.TP
.B \fI\%Fnmatch\fP, selector \fIfm:\fP
@ -159,26 +143,26 @@ $ borg create \-e \(aq*.o\(aq backup /
# 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 backup /
# 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
$ 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 backup /
# 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
@ -188,12 +172,37 @@ $ borg create \-\-exclude\-from exclude.txt backup /
.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
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 will use this style until another style
is specified.
.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
\fBNOTE:\fP
.INDENT 0.0
@ -204,11 +213,37 @@ of files using pattern prefixes \fB+\fP and \fB\-\fP\&. With \fB\-\-exclude\fP a
.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.
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
.nf
.ft C
# 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.
\- **
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
@ -250,22 +285,22 @@ The patterns.lst file could look like that:
.sp
.nf
.ft C
# "sh:" pattern style is the default, so the following line is not needed:
# \(dqsh:\(dq pattern style is the default, so the following line is not needed:
P sh
R /
# can be rebuild
\- /home/*/.cache
\- home/*/.cache
# they\(aqre downloads for a reason
\- /home/*/Downloads
\- home/*/Downloads
# susan is a nice person
# include susans home
+ /home/susan
+ home/susan
# also back up this exact file
+ pf:/home/bobby/specialfile.txt
+ pf:home/bobby/specialfile.txt
# don\(aqt backup the other home directories
\- /home/*
\- home/*
# don\(aqt even look in /proc
! /proc
! proc
.ft P
.fi
.UNINDENT
@ -278,7 +313,7 @@ You can specify recursion roots either on the command line or in a patternfile:
.nf
.ft C
# these two commands do the same thing
borg create \-\-exclude /home/bobby/junk repo::arch /home/bobby /home/susan
borg create \-\-exclude home/bobby/junk repo::arch /home/bobby /home/susan
borg create \-\-patterns\-from patternfile.lst repo::arch
.ft P
.fi
@ -297,7 +332,7 @@ P fm
R /home/bobby
R /home/susan
\- /home/bobby/junk
\- home/bobby/junk
.ft P
.fi
.UNINDENT

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-PLACEHOLDERS" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-PLACEHOLDERS" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-placeholders \- Details regarding placeholders
.SH DESCRIPTION
@ -92,7 +92,7 @@ Examples:
.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 ...
borg prune \-\-glob\-archives \(aq{hostname}\-*\(aq ...
.ft P
.fi
.UNINDENT

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-PRUNE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-PRUNE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-prune \- Prune repository archives according to specified rules
.SH SYNOPSIS
@ -61,10 +61,10 @@ If you have multiple sequences of archives with different data sets (e.g.
from different machines) in one shared repository, use one prune call per
data set that matches only the respective archives using the \-P option.
.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
The \fB\-\-keep\-within\fP option takes an argument of the form \(dq<int><char>\(dq,
where char is \(dqH\(dq, \(dqd\(dq, \(dqw\(dq, \(dqm\(dq, \(dqy\(dq. 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
\(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.
@ -85,9 +85,9 @@ keep the last N archives under the assumption that you do not create more than o
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
deleted \- the \(dqDeleted data\(dq 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.
Please note that the \(dqAll archives\(dq stats refer to the state after pruning.
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
@ -97,7 +97,7 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.B REPOSITORY
repository to prune
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
@ -138,15 +138,18 @@ number of yearly archives to keep
.TP
.B \-\-save\-space
work slower, but using less space
.TP
.BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
write checkpoint every SECONDS seconds (Default: 1800)
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq.
.UNINDENT
.SH EXAMPLES
.sp
@ -154,9 +157,9 @@ Be careful, prune is a potentially dangerous command, it will remove 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".
you restrict its operation to a subset of the archives using \fB\-\-glob\-archives\fP\&.
When using \fB\-\-glob\-archives\fP, be careful to choose a good matching pattern \-
e.g. do not use \(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.
@ -170,8 +173,8 @@ first so you will see what it would do without it actually doing anything.
$ borg prune \-v \-\-list \-\-dry\-run \-\-keep\-daily=7 \-\-keep\-weekly=4 /path/to/repo
# Same as above but only apply to archive names starting with the hostname
# of the machine followed by a "\-" character:
$ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \-\-prefix=\(aq{hostname}\-\(aq /path/to/repo
# of the machine followed by a \(dq\-\(dq character:
$ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \-\-glob\-archives=\(aq{hostname}\-*\(aq /path/to/repo
# actually free disk space:
$ borg compact /path/to/repo

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-RECREATE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-RECREATE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-recreate \- Re-create archives
.SH SYNOPSIS
@ -43,7 +43,7 @@ recreate is a potentially dangerous function and might lead to data loss
Important: Repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&.
.sp
\fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, \fB\-\-exclude\-if\-present\fP, \fB\-\-keep\-exclude\-tags\fP
and PATH have the exact same semantics as in "borg create", but they only check
and PATH have the exact same semantics as in \(dqborg create\(dq, but they only check
for files in the archives and not in the local file system. If PATHs are specified,
the resulting archives will only contain files from these PATHs.
.sp
@ -67,7 +67,7 @@ interpreted. See \fIlist_item_flags\fP in \fBborg create\fP for details.
.sp
The archive being recreated is only removed after the operation completes. The
archive that is built during the operation exists at the same time at
"<ARCHIVE>.recreate". The new archive will have a different archive ID.
\(dq<ARCHIVE>.recreate\(dq. The new archive will have a different archive ID.
.sp
With \fB\-\-target\fP the original archive is not replaced, instead a new archive is created.
.sp
@ -97,7 +97,7 @@ repository or archive to recreate
.B PATH
paths to recreate; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-\-list
@ -112,7 +112,7 @@ do not change anything
.B \-s\fP,\fB \-\-stats
print statistics at end
.UNINDENT
.SS Exclusion options
.SS Include/Exclude options
.INDENT 0.0
.TP
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
@ -152,13 +152,13 @@ add a comment text to the archive
manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory.
.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.
.TP
.BI \-\-recompress \ MODE
recompress data chunks according to \fIMODE\fP and \fB\-\-compression\fP\&. Possible modes are \fIif\-different\fP: recompress if current compression is with a different compression algorithm (the level is not considered); \fIalways\fP: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and \fInever\fP: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, \fIif\-different\fP will be used. Not passing \-\-recompress is equivalent to "\-\-recompress never".
recompress data chunks according to \fIMODE\fP and \fB\-\-compression\fP\&. Possible modes are \fIif\-different\fP: recompress if current compression is with a different compression algorithm (the level is not considered); \fIalways\fP: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and \fInever\fP: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, \fIif\-different\fP will be used. Not passing \-\-recompress is equivalent to \(dq\-\-recompress never\(dq.
.TP
.BI \-\-chunker\-params \ PARAMS
specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or \fIdefault\fP to use the current defaults. default: buzhash,19,23,21,4095
rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or \fIdefault\fP to use the chunker defaults. default: do not rechunk
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
@ -182,13 +182,13 @@ $ borg recreate /mnt/backup::archive \-\-recompress \-\-compression zlib,9
$ borg recreate /mnt/backup \-\-exclude home/icke/Pictures/drunk_photos
# Change archive comment
$ borg create \-\-comment "This is a comment" /mnt/backup::archivename ~
$ borg create \-\-comment \(dqThis is a comment\(dq /mnt/backup::archivename ~
$ borg info /mnt/backup::archivename
Name: archivename
Fingerprint: ...
Comment: This is a comment
\&...
$ borg recreate \-\-comment "This is a better comment" /mnt/backup::archivename
$ borg recreate \-\-comment \(dqThis is a better comment\(dq /mnt/backup::archivename
$ borg info /mnt/backup::archivename
Name: archivename
Fingerprint: ...

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-RENAME" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-RENAME" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-rename \- Rename an existing archive
.SH SYNOPSIS

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-SERVE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-SERVE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-serve \- Start in server mode. This command is usually not used manually.
.SH SYNOPSIS
@ -39,7 +39,7 @@ This command starts a repository server process. This command is usually not use
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.BI \-\-restrict\-to\-path \ PATH
@ -83,11 +83,11 @@ locations like \fB/etc/environment\fP or in the forced command itself (example b
# Use key options to disable unneeded and potentially dangerous SSH functionality.
# This will help to secure an automated remote backup system.
$ cat ~/.ssh/authorized_keys
command="borg serve \-\-restrict\-to\-path /path/to/repo",restrict ssh\-rsa AAAAB3[...]
command=\(dqborg serve \-\-restrict\-to\-path /path/to/repo\(dq,restrict ssh\-rsa AAAAB3[...]
# Set a BORG_XXX environment variable on the "borg serve" side
# Set a BORG_XXX environment variable on the \(dqborg serve\(dq side
$ cat ~/.ssh/authorized_keys
command="export BORG_XXX=value; borg serve [...]",restrict ssh\-rsa [...]
command=\(dqexport BORG_XXX=value; borg serve [...]\(dq,restrict ssh\-rsa [...]
.ft P
.fi
.UNINDENT

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-UMOUNT" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-UMOUNT" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-umount \- un-mount the FUSE filesystem
.SH SYNOPSIS
@ -69,7 +69,7 @@ bin boot etc home lib lib64 lost+found media mnt opt
root sbin srv tmp usr var
$ borg umount /tmp/mymountpoint
# The "versions view" merges all archives in the repository
# The \(dqversions view\(dq merges all archives in the repository
# and provides a versioned view on files.
$ borg mount \-o versions /path/to/repo /tmp/mymountpoint
$ ls \-l /tmp/mymountpoint/home/user/doc.txt/
@ -79,7 +79,7 @@ total 24
$ borg umount /tmp/mymountpoint
# Archive filters are supported.
# These are especially handy for the "versions view",
# These are especially handy for the \(dqversions view\(dq,
# which does not support lazy processing of archives.
$ borg mount \-o versions \-\-glob\-archives \(aq*\-my\-home\(aq \-\-last 10 /path/to/repo /tmp/mymountpoint

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-UPGRADE" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-UPGRADE" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-upgrade \- upgrade a repository from a previous version
.SH SYNOPSIS
@ -53,6 +53,23 @@ except when noted otherwise in the changelog
.UNINDENT
.SS Borg 1.x.y upgrades
.sp
Archive TAM authentication:
.sp
Use \fBborg upgrade \-\-archives\-tam REPO\fP to add archive TAMs to all
archives that are not TAM authenticated yet.
This is a convenient method to just trust all archives present \- if
an archive does not have TAM authentication yet, a TAM will be added.
Archives created by old borg versions < 1.0.9 do not have TAMs.
Archives created by newer borg version should have TAMs already.
If you have a high risk environment, you should not just run this,
but first verify that the archives are authentic and not malicious
(== have good content, have a good timestamp).
Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons.
.sp
This upgrade needs to be done once per repository.
.sp
Manifest TAM authentication:
.sp
Use \fBborg upgrade \-\-tam REPO\fP to require manifest authentication
introduced with Borg 1.0.9 to address security issues. This means
that modifying the repository after doing this with a version prior
@ -131,7 +148,7 @@ See \fIborg\-common(1)\fP for common options of Borg commands.
.B REPOSITORY
path to the repository to be upgraded
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
@ -148,6 +165,9 @@ Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).
.TP
.B \-\-disable\-tam
Disable manifest authentication (in key and cache).
.TP
.B \-\-archives\-tam
add TAM authentication for all archives.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
@ -170,11 +190,11 @@ no key file found for repository
.UNINDENT
.SS Upgrading a passphrase encrypted attic repo
.sp
attic offered a "passphrase" encryption mode, but this was removed in borg 1.0
and replaced by the "repokey" mode (which stores the passphrase\-protected
attic offered a \(dqpassphrase\(dq encryption mode, but this was removed in borg 1.0
and replaced by the \(dqrepokey\(dq mode (which stores the passphrase\-protected
encryption key into the repository config).
.sp
Thus, to upgrade a "passphrase" attic repo to a "repokey" borg repo, 2 steps
Thus, to upgrade a \(dqpassphrase\(dq attic repo to a \(dqrepokey\(dq borg repo, 2 steps
are needed, in this order:
.INDENT 0.0
.IP \(bu 2

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-WITH-LOCK" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG-WITH-LOCK" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg-with-lock \- run a user specified command with the repository lock held
.SH SYNOPSIS
@ -47,7 +47,7 @@ code as borg\(aqs return code.
.INDENT 3.5
If you copy a repository with the lock held, the lock will be present in
the copy. Thus, before using borg on the copy from a different host,
you need to use "borg break\-lock" on the copied repository, because
you need to use \(dqborg break\-lock\(dq on the copied repository, because
Borg is cautious and does not automatically remove stale locks made by a different host.
.UNINDENT
.UNINDENT

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" 1 "2022-02-19" "" "borg backup tool"
.TH "BORG" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borg \- deduplicating and encrypting backup tool
.SH SYNOPSIS
@ -162,7 +162,7 @@ $ borg extract /path/to/repo::Monday
.UNINDENT
.UNINDENT
.IP 7. 3
Recover disk space by manually deleting the \fIMonday\fP archive:
Delete the \fIMonday\fP archive (please note that this does \fBnot\fP free repo disk space):
.INDENT 3.0
.INDENT 3.5
.sp
@ -173,6 +173,18 @@ $ borg delete /path/to/repo::Monday
.fi
.UNINDENT
.UNINDENT
.IP 8. 3
Recover disk space by compacting the segment files in the repo:
.INDENT 3.0
.INDENT 3.5
.sp
.nf
.ft C
$ borg compact /path/to/repo
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
@ -413,7 +425,7 @@ be checked.
Main usecase for this is to fully automate \fBborg change\-passphrase\fP\&.
.TP
.B BORG_DISPLAY_PASSPHRASE
When set, use the value to answer the "display the passphrase for verification" question when defining a new passphrase for encrypted repositories.
When set, use the value to answer the \(dqdisplay the passphrase for verification\(dq question when defining a new passphrase for encrypted repositories.
.TP
.B BORG_HOST_ID
Borg usually computes a host id from the FQDN plus the results of \fBuuid.getnode()\fP (which usually returns
@ -433,7 +445,7 @@ a custom identity file \fBssh \-i /path/to/private/key\fP\&. See \fBman ssh\fP f
the \fB\-\-rsh CMD\fP commandline option overrides the environment variable.
.TP
.B BORG_REMOTE_PATH
When set, use the given path as borg executable on the remote (defaults to "borg" if unset).
When set, use the given path as borg executable on the remote (defaults to \(dqborg\(dq if unset).
Using \fB\-\-remote\-path PATH\fP commandline option overrides the environment variable.
.TP
.B BORG_FILES_CACHE_SUFFIX
@ -442,7 +454,7 @@ When set to a value at least one character long, instructs borg to use a specifi
cache entries for backup sources other than the current sources.
.TP
.B BORG_FILES_CACHE_TTL
When set to a numeric value, this determines the maximum "time to live" for the files cache
When set to a numeric value, this determines the maximum \(dqtime to live\(dq for the files cache
entries (default: 20). The files cache is used to quickly determine whether a file is unchanged.
The FAQ explains this more detailed in: \fIalways_chunking\fP
.TP
@ -495,23 +507,63 @@ write to disk behaviour (not continuously streaming to disk).
Retry opening a file without O_NOATIME if opening a file with O_NOATIME
caused EROFS. You will need this to make archives from volume shadow copies
in WSL1 (Windows Subsystem for Linux 1).
.TP
.B authenticated_no_key
Work around a lost passphrase or key for an \fBauthenticated\fP mode repository
(these are only authenticated, but not encrypted).
If the key is missing in the repository config, add \fBkey = anything\fP there.
.sp
This workaround is \fBonly\fP for emergencies and \fBonly\fP to extract data
from an affected repository (read\-only access):
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
BORG_WORKAROUNDS=authenticated_no_key borg extract repo::archive
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
After you have extracted all data you need, you MUST delete the repository:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
BORG_WORKAROUNDS=authenticated_no_key borg delete repo
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Now you can init a fresh repo. Make sure you do not use the workaround any more.
.TP
.B ignore_invalid_archive_tam
Work around invalid archive TAMs created by borg < 1.2.5, see #7791\&.
.sp
This workaround likely needs to get used only once when following the upgrade
instructions for CVE\-2023\-36811, see \fIarchives_tam_vuln\fP\&.
.sp
In normal production operations, this workaround should never be used.
.UNINDENT
.UNINDENT
.TP
.B Some automatic "answerers" (if set, they automatically answer confirmation questions):
.B Some automatic \(dqanswerers\(dq (if set, they automatically answer confirmation questions):
.INDENT 7.0
.TP
.B BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes)
For "Warning: Attempting to access a previously unknown unencrypted repository"
For \(dqWarning: Attempting to access a previously unknown unencrypted repository\(dq
.TP
.B BORG_RELOCATED_REPO_ACCESS_IS_OK=no (or =yes)
For "Warning: The repository at location ... was previously located at ..."
For \(dqWarning: The repository at location ... was previously located at ...\(dq
.TP
.B BORG_CHECK_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
For "This is a potentially dangerous function..." (check \-\-repair)
For \(dqThis is a potentially dangerous function...\(dq (check \-\-repair)
.TP
.B BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
For "You requested to completely DELETE the repository \fIincluding\fP all archives it contains:"
For \(dqYou requested to completely DELETE the repository \fIincluding\fP all archives it contains:\(dq
.UNINDENT
.sp
Note: answers are case sensitive. setting an invalid answer value might either give the default
@ -544,15 +596,32 @@ for a security advisory about the data in this directory: \fIhome_config_borg\fP
.TP
.B BORG_SECURITY_DIR
Defaults to \fB$BORG_CONFIG_DIR/security\fP\&.
This directory contains information borg uses to track its usage of NONCES ("numbers used
once" \- usually in encryption context) and other security relevant data.
This directory contains information borg uses to track its usage of NONCES (\(dqnumbers used
once\(dq \- usually in encryption context) and other security relevant data.
.TP
.B BORG_KEYS_DIR
Defaults to \fB$BORG_CONFIG_DIR/keys\fP\&.
This directory contains keys for encrypted repositories.
.TP
.B BORG_KEY_FILE
When set, use the given filename as repository key file.
When set, use the given path as repository key file. Please note that this is only
for rather special applications that externally fully manage the key files:
.INDENT 7.0
.IP \(bu 2
this setting only applies to the keyfile modes (not to the repokey modes).
.IP \(bu 2
using a full, absolute path to the key file is recommended.
.IP \(bu 2
all directories in the given path must exist.
.IP \(bu 2
this setting forces borg to use the key file at the given location.
.IP \(bu 2
the key file must either exist (for most commands) or will be created (\fBborg init\fP).
.IP \(bu 2
you need to give a different path for different repositories.
.IP \(bu 2
you need to point to the correct key file matching the repository the command will operate on.
.UNINDENT
.TP
.B TMPDIR
This is where temporary files are stored (might need a lot of temporary space for some
@ -569,10 +638,6 @@ Adds given OpenSSL header file directory to the default locations (setup.py).
Adds given prefix directory to the default locations. If a \(aqinclude/lz4.h\(aq is found Borg
will be linked against the system liblz4 instead of a bundled implementation. (setup.py)
.TP
.B BORG_LIBB2_PREFIX
Adds given prefix directory to the default locations. If a \(aqinclude/blake2.h\(aq is found Borg
will be linked against the system libb2 instead of a bundled implementation. (setup.py)
.TP
.B BORG_LIBZSTD_PREFIX
Adds given prefix directory to the default locations. If a \(aqinclude/zstd.h\(aq is found Borg
will be linked against the system libzstd instead of a bundled implementation. (setup.py)
@ -582,7 +647,7 @@ will be linked against the system libzstd instead of a bundled implementation. (
Please note:
.INDENT 0.0
.IP \(bu 2
Be very careful when using the "yes" sayers, the warnings with prompt exist for your / your data\(aqs security/safety.
Be very careful when using the \(dqyes\(dq sayers, the warnings with prompt exist for your / your data\(aqs security/safety.
.IP \(bu 2
Also be very careful when putting your passphrase into a script, make sure it has appropriate file permissions (e.g.
mode 600, root:root).
@ -612,7 +677,7 @@ At least three directory levels with short names
Typically, file sizes up to a few hundred MB.
Large repositories may require large files (>2 GB).
.IP \(bu 2
Up to 1000 files per directory (10000 for repositories initialized with Borg 1.0)
Up to 1000 files per directory.
.IP \(bu 2
rename(2) / MoveFile(Ex) should work as specified, i.e. on the same file system
it should be a move (not a copy) operation, and in case of a directory
@ -727,7 +792,7 @@ process.
For some OSes, this can be done just by setting the correct value in the
\&.bashrc (or equivalent login config file for other shells), however in
other cases it may be necessary to first enable \fBPermitUserEnvironment yes\fP
in your \fBsshd_config\fP file, then add \fBenvironment="TMPDIR=/my/big/tmpdir"\fP
in your \fBsshd_config\fP file, then add \fBenvironment=\(dqTMPDIR=/my/big/tmpdir\(dq\fP
at the start of the public key to be used in the \fBauthorized_hosts\fP file.
.TP
.B Cache files (client only):
@ -755,7 +820,7 @@ special files:
.IP \(bu 2
character and block device files (restored via mknod)
.IP \(bu 2
FIFOs ("named pipes")
FIFOs (\(dqnamed pipes\(dq)
.IP \(bu 2
special file \fIcontents\fP can be backed up in \fB\-\-read\-special\fP mode.
By default the metadata to create them with mknod(2), mkfifo(2) etc. is stored.
@ -809,7 +874,7 @@ Yes [1]
T}
_
T{
Mac OS X
macOS
T} T{
Yes
T} T{
@ -875,7 +940,7 @@ Other Unix\-like operating systems may work as well, but have not been tested at
Note that most of the platform\-dependent features also depend on the file system.
For example, ntfs\-3g on Linux isn\(aqt able to convey NTFS ACLs.
.IP [1] 5
Only "nodump", "immutable", "compressed" and "append" are supported.
Only \(dqnodump\(dq, \(dqimmutable\(dq, \(dqcompressed\(dq and \(dqappend\(dq are supported.
Feature request #618 for more flags.
.IP [2] 5
Feature request #1332

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 "BORGFS" 1 "2022-02-19" "" "borg backup tool"
.TH "BORGFS" 1 "2023-12-02" "" "borg backup tool"
.SH NAME
borgfs \- Mount archive or an entire repository as a FUSE filesystem
.SH SYNOPSIS
@ -69,16 +69,16 @@ manually. Unlike the \fBuid\fP and \fBgid\fP mount options which affect all file
Additional mount options supported by borg:
.INDENT 0.0
.IP \(bu 2
versions: when used with a repository mount, this gives a merged, versioned
\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 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
\fBallow_damaged_files\fP: by default damaged files (where missing chunks were
replaced with runs of zeros by \fBborg check \-\-repair\fP) are not readable and
return EIO (I/O error). Set this option to read such files.
.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
@ -107,7 +107,7 @@ where to mount filesystem
.B PATH
paths to extract; patterns are supported
.UNINDENT
.SS optional arguments
.SS options
.INDENT 0.0
.TP
.B \-V\fP,\fB \-\-version
@ -132,13 +132,13 @@ use numeric user and group identifiers from archive(s)
.INDENT 0.0
.TP
.BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
only consider archive names starting with this prefix.
only consider archive names starting with this prefix. (deprecated)
.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.
only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(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; default is: timestamp
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
@ -146,7 +146,7 @@ consider first N archives after other filters were applied
.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

View file

@ -0,0 +1,4 @@
Do NOT run the examples without isolation (e.g Vagrant) or
this code may make undesirable changes to your host.
Running `vagrant up` in this directory will update the screencasts.

75
docs/misc/asciinema/Vagrantfile vendored Normal file
View file

@ -0,0 +1,75 @@
Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.vm.provision "install dependencies", type: "shell", inline: <<-SHELL
apt-get update
apt-get install -y wget expect gpg asciinema ssh adduser fuse
mkdir -p /wallpaper
wget \
--user-agent="borgbackup demo screencast" \
--input-file=/vagrant/sample-wallpapers.txt \
--directory-prefix=/wallpaper
SHELL
config.vm.provision "record install", type: "shell", inline: <<-SHELL
gpg --recv-keys "6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393"
asciinema rec -c 'expect /vagrant/install.tcl' --overwrite /vagrant/install.json < /dev/null
SHELL
config.vm.provision "record basic usage", type: "shell", inline: <<-SHELL
# `rm` below allows quick re-exec via:
# vagrant vagrant provision --provision-with "record basic usage"
# this is useful when testing changes
rm -r /media/backup/borgdemo || true
rm -r ~/.ssh/ || true
rm -r Wallpaper || true
deluser --remove-home borgdemo || true
# In case we have skipped "record install"
if [ ! -e /usr/local/bin/borg ] ; then
wget https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64
install --owner root --group root --mode 755 borg-linux64 /usr/local/bin/borg
fi
mkdir -p /media/backup/borgdemo
mkdir Wallpaper
cp -r /wallpaper Wallpaper/bigcollection
cp /wallpaper/Trapper_cabin.jpg Wallpaper/deer.jpg
adduser --disabled-password borgdemo
echo '127.0.0.1 remoteserver.example' >> /etc/hosts
ssh-keygen -f ~/.ssh/id_rsa -N ''
ssh-keyscan remoteserver.example > ~/.ssh/known_hosts
runuser -u borgdemo mkdir ~borgdemo/.ssh
runuser -u borgdemo tee ~borgdemo/.ssh/authorized_keys < ~/.ssh/id_rsa.pub
asciinema rec -c 'expect /vagrant/basic.tcl' --overwrite /vagrant/basic.json < /dev/null
SHELL
config.vm.provision "record advanced usage", type: "shell", inline: <<-SHELL
rm -r /media/backup/borgdemo || true
rm -r Wallpaper || true
# In case we have skipped "record install"
if [ ! -e /usr/local/bin/borg ] ; then
wget https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64
install --owner root --group root --mode 755 borg-linux64 /usr/local/bin/borg
fi
mkdir -p /media/backup/borgdemo
mkdir Wallpaper
cp -r /wallpaper Wallpaper/bigcollection
cp /wallpaper/Trapper_cabin.jpg Wallpaper/deer.jpg
mkdir -p ~/Downloads/big
dd if=/dev/zero of=loopbackfile.img bs=100M count=4
losetup /dev/loop0 loopbackfile.img
# Make it look as if the adv. usage screencast was recorded after basic usage
export BORG_PASSPHRASE='1234'
borg init --encryption=repokey /media/backup/borgdemo
borg create --compression lz4 /media/backup/borgdemo::backup1 Wallpaper
echo "new nice file" > Wallpaper/newfile.txt
borg create --compression lz4 /media/backup/borgdemo::backup2 Wallpaper
mv Wallpaper/bigcollection Wallpaper/bigcollection_NEW
borg create --compression lz4 /media/backup/borgdemo::backup3 Wallpaper
unset BORG_PASSPHRASE
asciinema rec -c 'expect /vagrant/advanced.tcl' --overwrite /vagrant/advanced.json < /dev/null
SHELL
end

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,11 @@
# Configuration for send -h
# Tries to emulate a human typing
# Tweak this if typing is too fast or too slow
set send_human {.05 .1 1 .01 .2}
set script {
# For the pro users, here are some advanced features of borg, so you can impress your friends. ;)
# Note: This screencast was made with borg version 1.1.0 older or newer borg versions may behave differently.
# Note: This screencast was made with __BORG_VERSION__ older or newer borg versions may behave differently.
# First of all, we can use several environment variables for borg.
# E.g. we do not want to type in our repo path and password again and again
@ -27,13 +33,12 @@ borg info :: --last 1
# So let's rename our last archive:
borg rename ::specialbackup backup-block-device
<up>
borg info :: --last 1
# A very important step if you choose keyfile mode (where the keyfile is only saved locally) is to export your keyfile and possibly print it, etc.
borg key export :: --qr-code file.html # this creates a nice HTML, but when you want something simpler
< remove comment >
< let there: borg check > --paper # this is a "manual input"-only backup (but it is also included in the --qr-code option)
borg key export --qr-html :: file.html # this creates a nice HTML, but when you want something simpler
borg key export --paper :: # this is a "manual input"-only backup (but it is also included in the --qr-code option)
## MAINTENANCE ##
# Sometimes backups get broken or we want a regular "checkup" that everything is okay
@ -63,3 +68,18 @@ ls -la /tmp/mount
borg umount /tmp/mount
# That's it, but of course there is more to explore, so have a look at the docs.
}
set script [string trim $script]
set script [string map [list __BORG_VERSION__ [exec borg -V]] $script]
set script [split $script \n]
set ::env(PS1) "$ "
set stty_init -echo
spawn -noecho /bin/sh
foreach line $script {
expect "$ "
send_user -h $line\n
send $line\n
}
expect "$ "

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,11 @@
# Configuration for send -h
# Tries to emulate a human typing
# Tweak this if typing is too fast or too slow
set send_human {.05 .1 1 .01 .2}
set script {
# Here you'll see some basic commands to start working with borg.
# Note: This teaser screencast was made with borg version 1.1.0 older or newer borg versions may behave differently.
# Note: This teaser screencast was made with __BORG_VERSION__ older or newer borg versions may behave differently.
# But let's start.
# First of all, you can always get help:
@ -16,7 +22,6 @@ borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup1
# So let's add a new file
echo "new nice file" > Wallpaper/newfile.txt
<up>
borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup2 Wallpaper
# Wow, this was a lot faster!
@ -24,7 +29,7 @@ borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup2
# Borg recognized that most files did not change and deduplicated them.
# But what happens, when we move a dir and create a new backup?
mv
mv Wallpaper/bigcollection Wallpaper/bigcollection_NEW
borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup3 Wallpaper
@ -40,7 +45,8 @@ borg list /media/backup/borgdemo::backup3 | grep 'deer.jpg'
# Oh, we found our picture. Now extract it
mv Wallpaper Wallpaper.orig
borg extract /media/backup/borgdemo::backup3 <copy>
borg extract /media/backup/borgdemo::backup3 Wallpaper/deer.jpg
# And check that it's the same:
diff -s Wallpaper/deer.jpg Wallpaper.orig/deer.jpg
@ -51,3 +57,33 @@ borg init --encryption=repokey borgdemo@remoteserver.example:./demo
# Easy, isn't it? That's all you need to know for basic usage.
# If you want to see more, have a look at the screencast showing the "advanced usage".
# In any case, enjoy using borg!
}
set script [string trim $script]
set script [string map [list __BORG_VERSION__ [exec borg -V]] $script]
set script [split $script \n]
foreach line $script {
send_user "$ "
send_user -h $line\n
spawn -noecho /bin/sh -c $line
expect {
"Enter new passphrase: " {
send -h "correct horse battery staple\n"
exp_continue
}
"Enter same passphrase again: " {
send -h "correct horse battery staple\n"
exp_continue
}
"Enter passphrase for key /media/backup/borgdemo: " {
send -h "correct horse battery staple\n"
exp_continue
}
-ex {Do you want your passphrase to be displayed for verification? [yN]: } {
send \n
exp_continue
}
eof
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,15 @@
# Configuration for send -h
# Tries to emulate a human typing
# Tweak this if typing is too fast or too slow
set send_human {.05 .1 1 .01 .2}
set script [string trim {
# This asciinema will show you the installation of borg as a standalone binary. Usually you only need this if you want to have an up-to-date version of borg or no package is available for your distro/OS.
# First, we need to download the version, we'd like to install
wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.1.0b6/borg-linux64
wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64
# and do not forget the GPG signature!
wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.1.0b6/borg-linux64.asc
wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64.asc
# In this case, we have already imported the public key of a borg developer. So we only need to verify it:
gpg --verify borg-linux64.asc
@ -19,3 +25,14 @@ sudo chmod 755 /usr/local/bin/borg
borg -V
# That's it! Check out the other screencasts to see how to actually use borgbackup.
}]
# wget may be slow
set timeout -1
foreach line [split $script \n] {
send_user "$ "
send_user -h $line\n
spawn -noecho /bin/sh -c $line
expect eof
}

View file

@ -0,0 +1,30 @@
https://upload.wikimedia.org/wikipedia/commons/2/22/Pseudo_kleinian_001_OpenCL_45154214_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/d/da/Mengerschwamm_Iteration_5_x_Mandelbulb_OpenCL_528814521414_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/e/eb/Blixos_logon_screen.jpg
https://upload.wikimedia.org/wikipedia/commons/9/90/Great_smokey_mountains_national_park_with_woman_sitting_under_tree_in_foreground.jpg
https://upload.wikimedia.org/wikipedia/commons/d/d2/Mengerschwamm_x_Generalized_Fold_Box_OpenCL_18915424_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/3/3d/Red_interesting_background.jpg
https://upload.wikimedia.org/wikipedia/commons/4/43/KIFS_OpenCL_54815_5K.jpg
https://upload.wikimedia.org/wikipedia/commons/a/a1/ProjectStealth.png
https://upload.wikimedia.org/wikipedia/commons/8/8d/KIFS_OpenCL_5434735835_5K.jpg
https://upload.wikimedia.org/wikipedia/commons/d/db/Harvett_Fox_-_Wallpaper_%2816x9_ratio%2C_without_character_logo%2C_transparent_variant%29_%28vector_version%29.svg
https://upload.wikimedia.org/wikipedia/commons/7/7f/Generalized_Fold_Box_OpenCL_4258952414_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/5/58/Mandelbox_Vary_Scale_4D_OpenCL_9648145412_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/6/62/Trapper_cabin.jpg
https://upload.wikimedia.org/wikipedia/commons/f/fd/Openarch.png
https://upload.wikimedia.org/wikipedia/commons/a/a5/Mandelbox_-_Variable_8K_6595424.jpg
https://upload.wikimedia.org/wikipedia/commons/d/d6/Mengerschwamm_Iteration_6_x_Generalized_Fold_Box_OpenCL_14048152404910_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/c/cf/Sierp_Oktaeder_x_Menger_4D_OpenCL_51241841541_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/5/59/Airbus_Wing_01798_changed.jpg
https://upload.wikimedia.org/wikipedia/commons/8/8a/Holytrinfruitlandpark1b.jpg
https://upload.wikimedia.org/wikipedia/commons/5/5c/Abox_-_Mod_12_OpenCL_45184521485_5K.jpg
https://upload.wikimedia.org/wikipedia/commons/d/d2/Menger_4D_x_Quaternion_OpenCL_644289452_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/3/3e/Gabrielsond.jpg
https://upload.wikimedia.org/wikipedia/commons/8/80/Mix_Pinski_4D_x_Mengerschwamm_OpenCL_461481542_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/8/84/Belinda_Vixen_-_Wallpaper_%28without_character_wordmark_and_hair_variant%29_%2816x9_ratio%29.jpg
https://upload.wikimedia.org/wikipedia/commons/0/00/Sierp_Oktaeder_Iteration_7_x_Menger_4D_OpenCL_2154188450481_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/2/24/Abox_4D_OpenCL_545185481_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/0/08/Sierpinski_4D_OpenCL_485274854_5K.jpg
https://upload.wikimedia.org/wikipedia/commons/0/09/Vereinigung_Sierpinski_4D_und_Mengerschwamm_OpenCl_6184524.jpg
https://upload.wikimedia.org/wikipedia/commons/a/ae/Mengerschwamm_OpenCL_955141845_8K.jpg
https://upload.wikimedia.org/wikipedia/commons/6/64/Free_high-resolution_pictures_you_can_use_on_your_personal_and_commercial_projects._%2814168975789%29.jpg

View file

@ -26,6 +26,8 @@ repositories contain data blocks and a manifest tracking which blocks are in eac
archive. If some data hasn't changed from one backup to another, Borg can simply
reference an already uploaded data chunk (deduplication).
.. _about_free_space:
Important note about free space
-------------------------------
@ -182,31 +184,31 @@ backed up and that the ``prune`` command is keeping and deleting the correct bac
--show-rc \
--compression lz4 \
--exclude-caches \
--exclude '/home/*/.cache/*' \
--exclude '/var/tmp/*' \
--exclude 'home/*/.cache/*' \
--exclude 'var/tmp/*' \
\
::'{hostname}-{now}' \
/etc \
/home \
/root \
/var \
/var
backup_exit=$?
info "Pruning repository"
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
# archives of THIS machine. The '{hostname}-' prefix is very important to
# archives of THIS machine. The '{hostname}-*' matching is very important to
# limit prune's operation to this machine's archives and not apply to
# other machines' archives also:
borg prune \
--list \
--prefix '{hostname}-' \
--glob-archives '{hostname}-*' \
--show-rc \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 6 \
--keep-monthly 6
prune_exit=$?

View file

@ -12,41 +12,41 @@ borg check
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to check consistency of |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--repository-only`` | only perform repository checks |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--archives-only`` | only perform archives checks |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--verify-data`` | perform cryptographic archive data integrity verification (conflicts with ``--repository-only``) |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--repair`` | attempt to repair any inconsistencies found |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--max-duration SECONDS`` | do only a partial repo check for max. SECONDS seconds (Default: unlimited) |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to check consistency of |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **options** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--repository-only`` | only perform repository checks |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--archives-only`` | only perform archives checks |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--verify-data`` | perform cryptographic archive data integrity verification (conflicts with ``--repository-only``) |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--repair`` | attempt to repair any inconsistencies found |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--max-duration SECONDS`` | do only a partial repo check for max. SECONDS seconds (Default: unlimited) |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -62,7 +62,7 @@ borg check
repository or archive to check consistency of
optional arguments
options
--repository-only only perform repository checks
--archives-only only perform archives checks
--verify-data perform cryptographic archive data integrity verification (conflicts with ``--repository-only``)
@ -75,9 +75,9 @@ borg check
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated)
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
@ -85,72 +85,115 @@ borg check
Description
~~~~~~~~~~~
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:
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!
1. Checking the consistency of the repository itself. This includes checking
the segment magic headers, and both the metadata and data of all objects in
the segments. The read data is checked by size and CRC. 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 ``--max-duration``.
When checking a remote repository, please note that the checks run on the
server and do not cause significant network traffic.
2. Checking consistency and correctness of the archive metadata and optionally
archive data (requires ``--verify-data``). 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 cryptographically verify
the file (content) data integrity pass ``--verify-data``, but keep in mind
that this requires reading all data and is hence very time consuming. When
checking archives of a remote repository, archive checks run on the client
machine because they require decrypting data and therefore the encryption
key.
Both steps can also be run independently. Pass ``--repository-only`` to run the
repository checks only, or pass ``--archives-only`` to run the archive checks
only.
The ``--max-duration`` 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 ``--max-duration=3600``
(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
``--max-duration`` you must also pass ``--repository-only``, and must not pass
``--archives-only``, nor ``--repair``.
**Warning:** Please note that partial repository checks (i.e. running it with
``--max-duration``) can only perform non-cryptographic checksum checks on the
segment files. A full repository check (i.e. without ``--max-duration``) can
also do a repository index check. Enabling partial repository checks excepts
archive checks for the same reason. Therefore partial checks may be useful with
very large repositories only where a full check would take too long.
The ``--verify-data`` option will perform a full integrity verification (as
opposed to checking the CRC32 of the segment) of data, which means reading the
data from the repository, decrypting and decompressing it. 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 can
not use ``--verify-data`` with ``--repository-only``.
About repair mode
+++++++++++++++++
The check command is a readonly task by default. If any corruption is found,
Borg will report the issue and proceed with checking. To actually repair the
issues found, pass ``--repair``.
.. note::
``--repair`` is a **POTENTIALLY DANGEROUS FEATURE** 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. **BE VERY CAREFUL!**
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.
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 ``--repair``).
- For all segments, the segment magic header is checked.
- For all objects stored in the segments, all metadata (e.g. CRC and size) and
all data is read. The read data is checked by size and CRC. Bit rot and other
types of accidental damage can be detected this way.
- In repair mode, if an integrity error is detected in a segment, try to recover
as many objects from the segment as possible.
- In repair mode, make sure that the index is consistent with the data stored in
the segments.
- If checking a remote repo via ``ssh:``, the repo check is executed on the server
without causing significant network traffic.
- The repository check can be skipped using the ``--archives-only`` option.
- A repository check can be time consuming. Partial checks are possible with the
``--max-duration`` option.
Repair mode will attempt to fix any corruptions found. Fixing corruptions does
not mean recovering lost data: Borg can not 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.
Second, the consistency and correctness of the archive metadata is verified:
In practice, repair mode hooks into both the repository and archive checks:
- Is the repo manifest present? If not, it is rebuilt from archive metadata
chunks (this requires reading and decrypting of all metadata and data).
- Check if archive metadata chunk is present; if not, remove archive from manifest.
- For all files (items) in the archive, for all chunks referenced by these
files, check if chunk is present. In repair mode, if a chunk is not present,
replace it with a same-size replacement chunk of zeroes. If a previously lost
chunk reappears (e.g. via a later backup), in repair mode the all-zero replacement
chunk will be replaced by the correct chunk. This requires reading of archive and
file metadata, but not data.
- In repair mode, when all the archives were checked, orphaned chunks are deleted
from the repo. One cause of orphaned chunks are input file related errors (like
read errors) in the archive creation process.
- In verify-data mode, a complete cryptographic verification of the archive data
integrity is performed. This conflicts with ``--repository-only`` as this mode
only makes sense if the archive checks are enabled. The full details of this mode
are documented below.
- If checking a remote repo via ``ssh:``, the archive check is executed on the
client machine because it requires decryption, and this is always done client-side
as key access is needed.
- The archive checks can be time consuming; they can be skipped using the
``--repository-only`` option.
1. When checking the repository's consistency, repair mode will try to recover
as many objects from segments with integrity errors as possible, and ensure
that the index is consistent with the data stored in the segments.
The ``--max-duration`` 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.
2. 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. On a chunk level (i.e. the contents of files), repair mode
will replace corrupt or lost chunks with a same-size replacement chunk of
zeroes. If a previously zeroed chunk reappears, repair mode will restore
this lost chunk using the new chunk. Lastly, repair mode will also delete
orphaned chunks (e.g. caused by read errors while creating the archive).
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
``--repair`` 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.
Most steps taken by repair mode have a one-time effect on the repository, like
removing a lost archive from the repository. However, replacing a corrupt or
lost chunk with an all-zero replacement will have an ongoing effect on the
repository: When attempting to extract a file referencing an all-zero chunk,
the ``extract`` command will distinctly warn about it. The FUSE filesystem
created by the ``mount`` command will reject reading such a "zero-patched"
file unless a special mount option is given.
The ``--verify-data`` option will perform a full integrity verification (as opposed to
checking the CRC32 of the segment) of data, which means reading the data from the
repository, decrypting and decompressing it. This is a cryptographic verification,
which will detect (accidental) corruption. For encrypted repositories it is
tamper-resistant as well, unless the attacker has access to the keys. It is also very
slow.
As mentioned earlier, Borg might be able to "heal" a "zero-patched" file in
repair mode, if all its previously lost chunks reappear (e.g. via a later
backup). This is achieved by Borg not only keeping track of the all-zero
replacement chunks, but also by keeping metadata about the lost chunks. In
repair mode Borg will check whether a previously lost chunk reappeared and will
replace the all-zero replacement chunk by the reappeared chunk. If all lost
chunks of a "zero-patched" file reappear, this effectively "heals" the file.
Consequently, if lost chunks were repaired earlier, it is advised to run
``--repair`` a second time after creating some new backups.

View file

@ -17,7 +17,7 @@ borg compact
+-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
| | ``REPOSITORY`` | repository to compact |
+-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
| | ``--cleanup-commits`` | cleanup commit-only 17-byte segment files |
+-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
@ -42,7 +42,7 @@ borg compact
repository to compact
optional arguments
options
--cleanup-commits cleanup commit-only 17-byte segment files
--threshold PERCENT set minimum threshold for saved space in PERCENT (Default: 10)
@ -71,6 +71,7 @@ When using ``--verbose``, borg will output an estimate of the freed space.
After upgrading borg (server) to 1.2+, you can use ``borg compact --cleanup-commits``
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.
due to a bug. It is enough to do that once per repository. After cleaning up the
commits, borg will also do a normal compaction.
See :ref:`separate_compaction` in Additional Notes for more details.

View file

@ -21,7 +21,7 @@ borg config
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``VALUE`` | new value for key |
+-------------------------------------------------------+----------------------+----------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+----------------------+----------------------------------------+
| | ``-c``, ``--cache`` | get and set values from the repo cache |
+-------------------------------------------------------+----------------------+----------------------------------------+
@ -52,7 +52,7 @@ borg config
new value for key
optional arguments
options
-c, --cache get and set values from the repo cache
-d, --delete delete the key from the config file
-l, --list list the configuration of the repo

View file

@ -19,7 +19,7 @@ Examples
# 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 \
--exclude 'sh:/home/*/.thumbnails'
--exclude 'sh:home/*/.thumbnails'
# Backup the root filesystem into an archive named "root-YYYY-MM-DD"
# use zlib compression (good, but slow) - default is lz4 (fast, low compression ratio)

View file

@ -12,107 +12,107 @@ borg create
.. class:: borg-options-table
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | name of archive to create (must be also a valid directory name) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not create a backup archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the created archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--filter STATUSCHARS`` | only display items with the given status characters (see description) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | output stats as JSON. Implies ``--stats``. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--no-cache-sync`` | experimental: do not synchronize the cache. Implies not using the files cache. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-name NAME`` | use NAME in archive for stdin data (default: 'stdin') |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-user USER`` | set user USER in archive for stdin data (default: 'root') |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-group GROUP`` | set group GROUP in archive for stdin data (default: 'wheel') |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-mode M`` | set mode to M in archive for stdin data (default: 0660) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--content-from-command`` | interpret PATH as command and store its stdout. See also section Reading from stdin below. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--paths-from-stdin`` | read DELIM-separated list of paths to backup from stdin. Will not recurse into directories. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--paths-from-command`` | interpret PATH as command and treat its output as ``--paths-from-stdin`` |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--paths-delimiter DELIM`` | set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: \n) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-nodump`` | exclude files flagged NODUMP |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Filesystem options** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-x``, ``--one-file-system`` | stay in the same file system and do not store mount points of other file systems. This might behave different from your expectations, see the docs. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-ids`` | only store numeric user and group identifiers |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noatime`` | do not store atime into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--atime`` | do store atime into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noctime`` | do not store ctime into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--nobirthtime`` | do not store birthtime (creation date) into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--nobsdflags`` | deprecated, use ``--noflags`` instead |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noflags`` | do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noacls`` | do not read and store ACLs into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noxattrs`` | do not read and store xattrs into archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sparse`` | detect sparse holes in input (supported only by fixed chunker) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--files-cache MODE`` | operate files cache in MODE. default: ctime,size,inode |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--read-special`` | open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive options** |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--comment COMMENT`` | add a comment text to the archive |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). Alternatively, give a reference file/directory. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--chunker-params PARAMS`` | specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
+-------------------------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | name of archive to create (must be also a valid directory name) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **options** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not create a backup archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the created archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--filter STATUSCHARS`` | only display items with the given status characters (see description) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | output stats as JSON. Implies ``--stats``. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--no-cache-sync`` | experimental: do not synchronize the cache. Implies not using the files cache. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-name NAME`` | use NAME in archive for stdin data (default: 'stdin') |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-user USER`` | set user USER in archive for stdin data (default: 'root') |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-group GROUP`` | set group GROUP in archive for stdin data (default: 'wheel') |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--stdin-mode M`` | set mode to M in archive for stdin data (default: 0660) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--content-from-command`` | interpret PATH as command and store its stdout. See also section Reading from stdin below. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--paths-from-stdin`` | read DELIM-separated list of paths to backup from stdin. All control is external: it will back up all files given - no more, no less. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--paths-from-command`` | interpret PATH as command and treat its output as ``--paths-from-stdin`` |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--paths-delimiter DELIM`` | set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: ``\n``) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Include/Exclude options** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-nodump`` | exclude files flagged NODUMP |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Filesystem options** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-x``, ``--one-file-system`` | stay in the same file system and do not store mount points of other file systems - this might behave different from your expectations, see the description below. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-ids`` | only store numeric user and group identifiers |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noatime`` | do not store atime into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--atime`` | do store atime into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noctime`` | do not store ctime into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--nobirthtime`` | do not store birthtime (creation date) into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--nobsdflags`` | deprecated, use ``--noflags`` instead |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noflags`` | do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noacls`` | do not read and store ACLs into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--noxattrs`` | do not read and store xattrs into archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sparse`` | detect sparse holes in input (supported only by fixed chunker) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--files-cache MODE`` | operate files cache in MODE. default: ctime,size,inode |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--read-special`` | open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive options** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--comment COMMENT`` | add a comment text to the archive |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). Alternatively, give a reference file/directory. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--chunker-params PARAMS`` | specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -130,7 +130,7 @@ borg create
paths to archive
optional arguments
options
-n, --dry-run do not create a backup archive
-s, --stats print statistics for the created archive
--list output verbose list of items (files, dirs, ...)
@ -142,15 +142,15 @@ borg create
--stdin-group GROUP set group GROUP in archive for stdin data (default: 'wheel')
--stdin-mode M set mode to M in archive for stdin data (default: 0660)
--content-from-command interpret PATH as command and store its stdout. See also section Reading from stdin below.
--paths-from-stdin read DELIM-separated list of paths to backup from stdin. Will not recurse into directories.
--paths-from-stdin read DELIM-separated list of paths to backup from stdin. All control is external: it will back up all files given - no more, no less.
--paths-from-command interpret PATH as command and treat its output as ``--paths-from-stdin``
--paths-delimiter DELIM set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: \n)
--paths-delimiter DELIM set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: ``\n``)
:ref:`common_options`
|
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN
@ -162,7 +162,7 @@ borg create
Filesystem options
-x, --one-file-system stay in the same file system and do not store mount points of other file systems. This might behave different from your expectations, see the docs.
-x, --one-file-system stay in the same file system and do not store mount points of other file systems - this might behave different from your expectations, see the description below.
--numeric-owner deprecated, use ``--numeric-ids`` instead
--numeric-ids only store numeric user and group identifiers
--noatime do not store atime into archive
@ -282,13 +282,13 @@ through using the ``--keep-exclude-tags`` option.
The ``-x`` or ``--one-file-system`` option excludes directories, that are mountpoints (and everything in them).
It detects mountpoints by comparing the device number from the output of ``stat()`` of the directory and its
parent directory. Specifically, it excludes directories for which ``stat()`` reports a device number different
from the device number of their parent. Be aware that in Linux (and possibly elsewhere) there are directories
with device number different from their parent, which the kernel does not consider a mountpoint and also the
other way around. Examples are bind mounts (possibly same device number, but always a mountpoint) and ALL
subvolumes of a btrfs (different device number from parent but not necessarily a mountpoint). Therefore when
using ``--one-file-system``, one should make doubly sure that the backup works as intended especially when using
btrfs. This is even more important, if the btrfs layout was created by someone else, e.g. a distribution
installer.
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 ``--one-file-system``, you should double-check that the backup works as intended.
.. _list_item_flags:

View file

@ -10,7 +10,7 @@ Examples
$ borg compact /path/to/repo
# delete all archives whose names begin with the machine's hostname followed by "-"
$ borg delete --prefix '{hostname}-' /path/to/repo
$ borg delete --glob-archives '{hostname}-*' /path/to/repo
# delete all archives whose names contain "-2012-"
$ borg delete --glob-archives '*-2012-*' /path/to/repo

View file

@ -12,45 +12,47 @@ borg delete
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to delete |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | archives to delete |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of archives |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the deleted archive |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--cache-only`` | delete only the local cache for the given repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--force`` | force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-security-info`` | keep the local security info when deleting a repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to delete |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``ARCHIVE`` | archives to delete |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **options** |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of archives |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the deleted archive |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--cache-only`` | delete only the local cache for the given repository |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--force`` | force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work. |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-security-info`` | keep the local security info when deleting a repository |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -68,7 +70,7 @@ borg delete
archives to delete
optional arguments
options
-n, --dry-run do not change repository
--list output verbose list of archives
-s, --stats print statistics for the deleted archive
@ -76,15 +78,16 @@ borg delete
--force force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work.
--keep-security-info keep the local security info when deleting a repository
--save-space work slower, but using less space
-c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800)
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated)
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
@ -109,11 +112,9 @@ 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.
You can delete multiple archives by specifying their common prefix, if they
have one, using the ``--prefix PREFIX`` option. You can also specify a shell
pattern to match multiple archives using the ``--glob-archives GLOB`` option
(for more info on these patterns, see :ref:`borg_patterns`). Note that these
two options are mutually exclusive.
You can delete multiple archives by specifying a shell pattern to match
multiple archives using the ``--glob-archives GLOB`` option (for more info on
these patterns, see :ref:`borg_patterns`).
To avoid accidentally deleting archives, especially when using glob patterns,
it might be helpful to use the ``--dry-run`` to test out the command without

View file

@ -21,7 +21,7 @@ borg diff
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| | ``PATH`` | paths of items inside the archives to compare; patterns are supported |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
@ -31,13 +31,15 @@ borg diff
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| | ``--sort`` | Sort the output lines by file path. |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| | ``--content-only`` | Only compare differences in content (exclude metadata differences) |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| | ``--json-lines`` | Format output as JSON Lines. |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| **Exclusion options** |
| **Include/Exclude options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+
@ -66,18 +68,19 @@ borg diff
paths of items inside the archives to compare; patterns are supported
optional arguments
options
--numeric-owner deprecated, use ``--numeric-ids`` instead
--numeric-ids only consider numeric user and group identifiers
--same-chunker-params Override check of chunker parameters.
--sort Sort the output lines by file path.
--content-only Only compare differences in content (exclude metadata differences)
--json-lines Format output as JSON Lines.
:ref:`common_options`
|
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN

View file

@ -21,7 +21,7 @@ borg export-tar
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--tar-filter`` | filter program to pipe data through |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
@ -31,7 +31,7 @@ borg export-tar
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
| **Include/Exclude options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
@ -62,7 +62,7 @@ borg export-tar
paths to extract; patterns are supported
optional arguments
options
--tar-filter filter program to pipe data through
--list output verbose list of items (files, dirs, ...)
@ -70,7 +70,7 @@ borg export-tar
:ref:`common_options`
|
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN
@ -92,7 +92,7 @@ before writing it to FILE:
- .tar.gz or .tgz: gzip
- .tar.bz2 or .tbz: bzip2
- .tar.xz or .txz: xz
- .tar.zstd: zstd
- .tar.zstd or .tar.zst: zstd
- .tar.lz4: lz4
Alternatively, a ``--tar-filter`` program may be explicitly specified. It should

View file

@ -19,7 +19,7 @@ borg extract
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
@ -45,7 +45,7 @@ borg extract
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
| **Include/Exclude options** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
@ -74,7 +74,7 @@ borg extract
paths to extract; patterns are supported
optional arguments
options
--list output verbose list of items (files, dirs, ...)
-n, --dry-run do not actually change any files
--numeric-owner deprecated, use ``--numeric-ids`` instead
@ -90,7 +90,7 @@ borg extract
:ref:`common_options`
|
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN

View file

@ -100,6 +100,30 @@ General:
caused EROFS. You will need this to make archives from volume shadow copies
in WSL1 (Windows Subsystem for Linux 1).
authenticated_no_key
Work around a lost passphrase or key for an ``authenticated`` mode repository
(these are only authenticated, but not encrypted).
If the key is missing in the repository config, add ``key = anything`` there.
This workaround is **only** for emergencies and **only** to extract data
from an affected repository (read-only access)::
BORG_WORKAROUNDS=authenticated_no_key borg extract repo::archive
After you have extracted all data you need, you MUST delete the repository::
BORG_WORKAROUNDS=authenticated_no_key borg delete repo
Now you can init a fresh repo. Make sure you do not use the workaround any more.
ignore_invalid_archive_tam
Work around invalid archive TAMs created by borg < 1.2.5, see :issue:`7791`.
This workaround likely needs to get used only once when following the upgrade
instructions for CVE-2023-36811, see :ref:`archives_tam_vuln`.
In normal production operations, this workaround should never be used.
Some automatic "answerers" (if set, they automatically answer confirmation questions):
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes)
For "Warning: Attempting to access a previously unknown unencrypted repository"
@ -141,7 +165,16 @@ Directories and files:
Defaults to ``$BORG_CONFIG_DIR/keys``.
This directory contains keys for encrypted repositories.
BORG_KEY_FILE
When set, use the given filename as repository key file.
When set, use the given path as repository key file. Please note that this is only
for rather special applications that externally fully manage the key files:
- this setting only applies to the keyfile modes (not to the repokey modes).
- using a full, absolute path to the key file is recommended.
- all directories in the given path must exist.
- this setting forces borg to use the key file at the given location.
- the key file must either exist (for most commands) or will be created (``borg init``).
- you need to give a different path for different repositories.
- you need to point to the correct key file matching the repository the command will operate on.
TMPDIR
This is where temporary files are stored (might need a lot of temporary space for some
operations), see tempfile_ for details.
@ -152,9 +185,6 @@ Building:
BORG_LIBLZ4_PREFIX
Adds given prefix directory to the default locations. If a 'include/lz4.h' is found Borg
will be linked against the system liblz4 instead of a bundled implementation. (setup.py)
BORG_LIBB2_PREFIX
Adds given prefix directory to the default locations. If a 'include/blake2.h' is found Borg
will be linked against the system libb2 instead of a bundled implementation. (setup.py)
BORG_LIBZSTD_PREFIX
Adds given prefix directory to the default locations. If a 'include/zstd.h' is found Borg
will be linked against the system libzstd instead of a bundled implementation. (setup.py)

View file

@ -29,7 +29,7 @@ On some platforms additional features are supported:
+=========================+==========+===========+============+
| Linux | Yes | Yes | Yes [1]_ |
+-------------------------+----------+-----------+------------+
| Mac OS X | Yes | Yes | Yes (all) |
| macOS | Yes | Yes | Yes (all) |
+-------------------------+----------+-----------+------------+
| FreeBSD | Yes | Yes | Yes (all) |
+-------------------------+----------+-----------+------------+

View file

@ -21,7 +21,7 @@ and readable after one of the failures mentioned above occurred, run
- At least three directory levels with short names
- Typically, file sizes up to a few hundred MB.
Large repositories may require large files (>2 GB).
- Up to 1000 files per directory (10000 for repositories initialized with Borg 1.0)
- Up to 1000 files per directory.
- rename(2) / MoveFile(Ex) should work as specified, i.e. on the same file system
it should be a move (not a copy) operation, and in case of a directory
it should fail if the destination exists and is not an empty directory,

View file

@ -10,36 +10,20 @@ The path/filenames used as input for the pattern matching start from the
currently active recursion root. You usually give the recursion root(s)
when invoking borg and these can be either relative or absolute paths.
So, when you give `relative/` as root, the paths going into the matcher
will look like `relative/.../file.ext`. When you give `/absolute/` as
root, they will look like `/absolute/.../file.ext`.
File paths in Borg archives are always stored normalized and relative.
This means that e.g. ``borg create /path/to/repo ../some/path`` will
store all files as `some/path/.../file.ext` and ``borg create
/path/to/repo /home/user`` will store all files as
`home/user/.../file.ext`.
Starting with Borg 1.2, paths that are matched against patterns always
appear relative. If you give ``/absolute/`` as root, the paths going
into the matcher will start with ``absolute/``.
If you give ``../../relative`` as root, the paths will be normalized
as ``relative/``.
A directory exclusion pattern can end either with or without a slash ('/').
If it ends with a slash, such as `some/path/`, the directory will be
included but not its content. If it does not end with a slash, such as
`some/path`, both the directory and content will be excluded.
File patterns support these styles: fnmatch, shell, regular expressions,
path prefixes and path full-matches. By default, fnmatch is used for
``--exclude`` patterns and shell-style is used for the ``--pattern``
option. For commands that support patterns in their ``PATH`` argument
like (``borg list``), the default pattern is path prefix.
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.
If followed by a colon (':') the first two characters of a pattern are
used as a style selector. Explicit style selection is necessary when a
non-default style is desired or when the desired pattern starts with
two alphanumeric characters followed by a colon (i.e. `aa:something/*`).
Borg supports different pattern styles. To define a non-default
style for a specific pattern, prefix it with two characters followed
by a colon ':' (i.e. ``fm:path/*``, ``sh:path/**``).
`Fnmatch <https://docs.python.org/3/library/fnmatch.html>`_, selector `fm:`
This is the default style for ``--exclude`` and ``--exclude-from``.
@ -124,37 +108,60 @@ Examples::
# Exclude '/home/user/junk' and '/home/user/subdir/junk' but
# not '/home/user/importantjunk' or '/etc/junk':
$ borg create -e '/home/*/junk' backup /
$ borg create -e 'home/*/junk' backup /
# Exclude the contents of '/home/user/cache' but not the directory itself:
$ borg create -e home/user/cache/ backup /
# The file '/home/user/cache/important' is *not* backed up:
$ borg create -e /home/user/cache/ backup / /home/user/cache/important
$ borg create -e home/user/cache/ backup / /home/user/cache/important
# The contents of directories in '/home' are not backed up when their name
# ends in '.tmp'
$ borg create --exclude 're:^/home/[^/]+\.tmp/' backup /
$ borg create --exclude 're:^home/[^/]+\.tmp/' backup /
# Load exclusions from file
$ cat >exclude.txt <<EOF
# Comment line
/home/*/junk
home/*/junk
*.tmp
fm:aa:something/*
re:^/home/[^/]+\.tmp/
sh:/home/*/.thumbnails
re:^home/[^/]+\.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 /
A more general and easier to use way to define filename matching patterns exists
with the ``--pattern`` and ``--patterns-from`` options. Using these, you may
specify the backup roots (starting points) and patterns for inclusion/exclusion.
A root path starts with the prefix `R`, 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 ``--pattern`` and ``--patterns-from`` options. Using
these, you may specify the backup roots, default pattern styles and
patterns for inclusion and exclusion.
Root path prefix ``R``
A recursion root path starts with the prefix ``R``, 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.
Pattern style prefix ``P``
To change the default pattern style, use the ``P`` prefix, followed by
the pattern style abbreviation (``fm``, ``pf``, ``pp``, ``re``, ``sh``).
All patterns following this line will use this style until another style
is specified.
Exclude pattern prefix ``-``
Use the prefix ``-``, followed by a pattern, to define an exclusion.
This has the same effect as the ``--exclude`` option.
Exclude no-recurse pattern prefix ``!``
Use the prefix ``!``, 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.
Include pattern prefix ``+``
Use the prefix ``+``, 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.
.. note::
@ -162,11 +169,29 @@ with the prefix -, an exclude-norecurse rule starts with !, all followed by a pa
of files using pattern prefixes ``+`` and ``-``. With ``--exclude`` and
``--exclude-from`` ONLY excludes are defined.
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't recurse into it and won't discover any potential matches for
include rules below that directory.
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.
Example::
# 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's 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.
- **
.. note::
@ -197,23 +222,23 @@ The patterns.lst file could look like that::
P sh
R /
# can be rebuild
- /home/*/.cache
- home/*/.cache
# they're downloads for a reason
- /home/*/Downloads
- home/*/Downloads
# susan is a nice person
# include susans home
+ /home/susan
+ home/susan
# also back up this exact file
+ pf:/home/bobby/specialfile.txt
+ pf:home/bobby/specialfile.txt
# don't backup the other home directories
- /home/*
- home/*
# don't even look in /proc
! /proc
! proc
You can specify recursion roots either on the command line or in a patternfile::
# these two commands do the same thing
borg create --exclude /home/bobby/junk repo::arch /home/bobby /home/susan
borg create --exclude home/bobby/junk repo::arch /home/bobby /home/susan
borg create --patterns-from patternfile.lst repo::arch
The patternfile::
@ -224,7 +249,7 @@ The patternfile::
R /home/bobby
R /home/susan
- /home/bobby/junk
- home/bobby/junk
This allows you to share the same patterns between multiple repositories
without needing to specify them on the command line.
@ -281,7 +306,7 @@ Examples::
borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
borg prune --prefix '{hostname}-' ...
borg prune --glob-archives '{hostname}-*' ...
.. note::
systemd uses a difficult, non-standard syntax for command lines in unit files (refer to
@ -348,29 +373,44 @@ auto,C[,L]
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't make any sense.
- your repo size will be bigger, of course.
the observable stored chunk size more difficult. Note:
The SPEC value will determine how the size obfuscation will work:
- You must combine this with encryption, or it won't make any sense.
- Your repo size will be bigger, of course.
- A chunk is limited by the constant ``MAX_DATA_SIZE`` (cur. ~20MiB).
The SPEC value determines how the size obfuscation works:
*Relative random reciprocal size variation* (multiplicative)
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.
Add a randomly sized padding up to the given size:
110: 1kiB
...
120: 1MiB
...
123: 8MiB (max.)
Available factors::
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
Example probabilities for SPEC ``1``::
90 % 0.01 .. 0.1
9 % 0.1 .. 1
0.9 % 1 .. 10
0.09% 10 .. 100
*Randomly sized padding up to the given size* (additive)
::
110: 1kiB (2 ^ (SPEC - 100))
...
120: 1MiB
...
123: 8MiB (max.)
Examples::
@ -381,7 +421,7 @@ Examples::
borg create --compression zlib,1 REPO::ARCHIVE data
borg create --compression auto,lzma,6 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 ...

View file

@ -19,7 +19,7 @@ borg import-tar
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| | ``TARFILE`` | input tar file. "-" to read from stdin instead. |
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| | ``--tar-filter`` | filter program to pipe data through |
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
@ -31,6 +31,8 @@ borg import-tar
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | output stats as JSON (implies --stats) |
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| | ``--ignore-zeros`` | ignore zero-filled blocks in the input tarball |
+-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
@ -64,12 +66,13 @@ borg import-tar
input tar file. "-" to read from stdin instead.
optional arguments
options
--tar-filter filter program to pipe data through
-s, --stats print statistics for the created archive
--list output verbose list of items (files, dirs, ...)
--filter STATUSCHARS only display items with the given status characters
--json output stats as JSON (implies --stats)
--ignore-zeros ignore zero-filled blocks in the input tarball
:ref:`common_options`
@ -96,7 +99,7 @@ based on its file extension and pipe the file through an appropriate filter:
- .tar.gz or .tgz: gzip -d
- .tar.bz2 or .tbz: bzip2 -d
- .tar.xz or .txz: xz -d
- .tar.zstd: zstd -d
- .tar.zstd or .tar.zst: zstd -d
- .tar.lz4: lz4 -d
Alternatively, a --tar-filter program may be explicitly specified. It should
@ -114,4 +117,8 @@ otherwise supported by Borg.
A ``--sparse`` option (as found in borg create) is not supported.
import-tar reads POSIX.1-1988 (ustar), POSIX.1-2001 (pax), GNU tar, UNIX V7 tar
and SunOS tar with extended attributes.
and SunOS tar with extended attributes.
To import multiple tarballs into a single archive, they can be simply
concatenated (e.g. using "cat") into a single file, and imported with an
``--ignore-zeros`` option to skip through the stop markers between them.

View file

@ -12,31 +12,31 @@ borg info
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to display information about |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | format output as JSON |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to display information about |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **options** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--json`` | format output as JSON |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -52,7 +52,7 @@ borg info
repository or archive to display information about
optional arguments
options
--json format output as JSON
@ -60,9 +60,9 @@ borg info
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated)
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied

View file

@ -17,7 +17,7 @@ borg init
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY`` | repository to create |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e MODE``, ``--encryption MODE`` | select encryption key mode **(required)** |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -46,7 +46,7 @@ borg init
repository to create
optional arguments
options
-e MODE, --encryption MODE select encryption key mode **(required)**
--append-only create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details.
--storage-quota QUOTA Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
@ -128,6 +128,8 @@ The key will be stored in your home directory (in ``~/.config/borg/keys``).
If you do **not** want to encrypt the contents of your backups, but still
want to detect malicious tampering use ``--encryption authenticated``.
To normally work with ``authenticated`` repos, you will need the passphrase, but
there is an emergency workaround, see ``BORG_WORKAROUNDS=authenticated_no_key`` docs.
If ``BLAKE2b`` is faster than ``SHA-256`` on your hardware, use ``--encryption authenticated-blake2``,
``--encryption repokey-blake2`` or ``--encryption keyfile-blake2``. Note: for remote backups

View file

@ -19,7 +19,7 @@ borg key export
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| | ``PATH`` | where to store the backup |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
| | ``--paper`` | Create an export suitable for printing and later type-in |
+-------------------------------------------------------+----------------+------------------------------------------------------------------------+
@ -46,7 +46,7 @@ borg key export
where to store the backup
optional arguments
options
--paper Create an export suitable for printing and later type-in
--qr-html Create an html file suitable for printing and later type-in or qr scan

View file

@ -19,7 +19,7 @@ borg key import
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| | ``PATH`` | path to the backup ('-' to read from stdin) |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
| | ``--paper`` | interactively import from a backup done with ``--paper`` |
+-------------------------------------------------------+----------------+----------------------------------------------------------+
@ -44,7 +44,7 @@ borg key import
path to the backup ('-' to read from stdin)
optional arguments
options
--paper interactively import from a backup done with ``--paper``

View file

@ -34,11 +34,11 @@ Examples
-rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text
...
$ borg list /path/to/repo/::archiveA --pattern 're:\.ext$'
$ borg list /path/to/repo/::archiveA --pattern '+ re:\.ext$' --pattern '- re:^.*$'
-rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext
...
$ borg list /path/to/repo/::archiveA --pattern 're:.ext$'
$ borg list /path/to/repo/::archiveA --pattern '+ re:.ext$' --pattern '- re:^.*$'
-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
...

View file

@ -19,7 +19,7 @@ borg list
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to list; patterns are supported |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--consider-checkpoints`` | Show checkpoint archives in the repository contents list (default: hidden). |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -37,17 +37,17 @@ borg list
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
| **Include/Exclude options** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -74,7 +74,7 @@ borg list
paths to list; patterns are supported
optional arguments
options
--consider-checkpoints Show checkpoint archives in the repository contents list (default: hidden).
--short only print file/directory names, nothing else
--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}")
@ -86,14 +86,14 @@ borg list
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated)
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN
@ -156,6 +156,7 @@ Keys available only when listing archives in a repository:
- comment: archive comment interpreted as text (might be missing non-text characters, see bcomment)
- bcomment: verbatim archive comment, can contain any character except NUL
- id: internal ID of the archive
- tam: TAM authentication state of this archive
- start: time (start) of creation of the archive
- time: alias of "start"

View file

@ -12,55 +12,55 @@ borg mount
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to mount |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``MOUNTPOINT`` | where to mount filesystem |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--consider-checkpoints`` | Show checkpoint archives in the repository contents list (default: hidden). |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-f``, ``--foreground`` | stay in foreground, do not daemonize |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-o`` | Extra mount options |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-ids`` | use numeric user and group identifiers from archive(s) |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to mount |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``MOUNTPOINT`` | where to mount filesystem |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **options** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--consider-checkpoints`` | Show checkpoint archives in the repository contents list (default: hidden). |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-f``, ``--foreground`` | stay in foreground, do not daemonize |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-o`` | Extra mount options |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--numeric-ids`` | use numeric user and group identifiers from archive(s) |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--first N`` | consider first N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--last N`` | consider last N archives after other filters were applied |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **Include/Exclude options** |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -80,7 +80,7 @@ borg mount
paths to extract; patterns are supported
optional arguments
options
--consider-checkpoints Show checkpoint archives in the repository contents list (default: hidden).
-f, --foreground stay in foreground, do not daemonize
-o Extra mount options
@ -92,14 +92,14 @@ borg mount
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated)
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
--first N consider first N archives after other filters were applied
--last N consider last N archives after other filters were applied
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN
@ -143,14 +143,14 @@ manually. Unlike the ``uid`` and ``gid`` mount options which affect all files,
Additional mount options supported by borg:
- versions: when used with a repository mount, this gives a merged, versioned
- ``versions``: when used with a repository mount, this gives a merged, versioned
view of the files in the archives. EXPERIMENTAL, layout may change in future.
- allow_damaged_files: by default damaged files (where missing chunks were
replaced with runs of zeros by borg check ``--repair``) are not readable and
- ``allow_damaged_files``: by default damaged files (where missing chunks were
replaced with runs of zeros by ``borg check --repair``) are not readable and
return EIO (I/O error). Set this option to read such files.
- ignore_permissions: for security reasons the "default_permissions" mount
option is internally enforced by borg. "ignore_permissions" can be given to
not enforce "default_permissions".
- ``ignore_permissions``: for security reasons the ``default_permissions`` mount
option is internally enforced by borg. ``ignore_permissions`` can be given to
not enforce ``default_permissions``.
The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users
to tweak the performance. It sets the number of cached data chunks; additional

View file

@ -276,7 +276,7 @@ with file 6::
That's all to do in the repository.
If you want to access this rollbacked repository from a client that already has
If you want to access this rolled back repository from a client that already has
a cache for this repository, the cache will reflect a newer repository state
than what you actually have in the repository now, after the rollback.

View file

@ -7,9 +7,9 @@ Be careful, prune is a potentially dangerous command, it will remove backup
archives.
The default of prune is to apply to **all archives in the repository** unless
you restrict its operation to a subset of the archives using ``--prefix``.
When using ``--prefix``, be careful to choose a good prefix - e.g. do not use a
prefix "foo" if you do not also want to match "foobar".
you restrict its operation to a subset of the archives using ``--glob-archives``.
When using ``--glob-archives``, be careful to choose a good matching pattern -
e.g. do not use "foo*" if you do not also want to match "foobar".
It is strongly recommended to always run ``prune -v --list --dry-run ...``
first so you will see what it would do without it actually doing anything.
@ -22,7 +22,7 @@ first so you will see what it would do without it actually doing anything.
# Same as above but only apply to archive names starting with the hostname
# of the machine followed by a "-" character:
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 --prefix='{hostname}-' /path/to/repo
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 --glob-archives='{hostname}-*' /path/to/repo
# actually free disk space:
$ borg compact /path/to/repo

View file

@ -12,49 +12,51 @@ borg prune
.. class:: borg-options-table
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY`` | repository to prune |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--force`` | force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the deleted archive |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of archives it keeps/prunes |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-within INTERVAL`` | keep all archives within this time interval |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-last``, ``--keep-secondly`` | number of secondly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-minutely`` | number of minutely archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-H``, ``--keep-hourly`` | number of hourly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-d``, ``--keep-daily`` | number of daily archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-w``, ``--keep-weekly`` | number of weekly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-m``, ``--keep-monthly`` | number of monthly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-y``, ``--keep-yearly`` | number of yearly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
+-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``REPOSITORY`` | repository to prune |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **options** |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--force`` | force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work. |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics for the deleted archive |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of archives it keeps/prunes |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-within INTERVAL`` | keep all archives within this time interval |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-last``, ``--keep-secondly`` | number of secondly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--keep-minutely`` | number of minutely archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-H``, ``--keep-hourly`` | number of hourly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-d``, ``--keep-daily`` | number of daily archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-w``, ``--keep-weekly`` | number of weekly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-m``, ``--keep-monthly`` | number of monthly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-y``, ``--keep-yearly`` | number of yearly archives to keep |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``--save-space`` | work slower, but using less space |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". |
+-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -70,7 +72,7 @@ borg prune
repository to prune
optional arguments
options
-n, --dry-run do not change repository
--force force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work.
-s, --stats print statistics for the deleted archive
@ -84,14 +86,15 @@ borg prune
-m, --keep-monthly number of monthly archives to keep
-y, --keep-yearly number of yearly archives to keep
--save-space work slower, but using less space
-c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800)
:ref:`common_options`
|
Archive filters
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
-P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated)
-a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
Description

View file

@ -19,7 +19,7 @@ borg recreate
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to recreate; patterns are supported |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -33,7 +33,7 @@ borg recreate
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Exclusion options** |
| **Include/Exclude options** |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -63,7 +63,7 @@ borg recreate
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--recompress MODE`` | recompress data chunks according to `MODE` and ``--compression``. Possible modes are `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered); `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and `never`: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, `if-different` will be used. Not passing --recompress is equivalent to "--recompress never". |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--chunker-params PARAMS`` | specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the current defaults. default: buzhash,19,23,21,4095 |
| | ``--chunker-params PARAMS`` | rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk |
+-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. raw:: html
@ -82,7 +82,7 @@ borg recreate
paths to recreate; patterns are supported
optional arguments
options
--list output verbose list of items (files, dirs, ...)
--filter STATUSCHARS only display items with the given status characters (listed in borg create --help)
-n, --dry-run do not change anything
@ -92,7 +92,7 @@ borg recreate
:ref:`common_options`
|
Exclusion options
Include/Exclude options
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
--pattern PATTERN include/exclude paths matching PATTERN
@ -109,7 +109,7 @@ borg recreate
--timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory.
-C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
--recompress MODE recompress data chunks according to `MODE` and ``--compression``. Possible modes are `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered); `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and `never`: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, `if-different` will be used. Not passing --recompress is equivalent to "--recompress never".
--chunker-params PARAMS specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the current defaults. default: buzhash,19,23,21,4095
--chunker-params PARAMS rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk
Description

View file

@ -13,7 +13,7 @@ borg serve
.. class:: borg-options-table
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--restrict-to-path PATH`` | restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub-directories is granted implicitly; PATH doesn't need to directly point to a repository. |
+-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -40,7 +40,7 @@ borg serve
optional arguments
options
--restrict-to-path PATH restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub-directories is granted implicitly; PATH doesn't need to directly point to a repository.
--restrict-to-repository PATH restrict repository access. Only the repository located at PATH (no sub-directories are considered) is accessible. Can be specified multiple times to allow the client access to several repositories. Unlike ``--restrict-to-path`` sub-directories are not accessible; PATH needs to directly point at a repository location. PATH may be an empty directory or the last element of PATH may not exist, in which case the client may initialize a repository there.
--append-only only allow appending to repository segment files. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details.

View file

@ -17,7 +17,7 @@ borg upgrade
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``REPOSITORY`` | path to the repository to be upgraded |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| **optional arguments** |
| **options** |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change repository |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
@ -29,6 +29,8 @@ borg upgrade
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``--disable-tam`` | Disable manifest authentication (in key and cache). |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| | ``--archives-tam`` | add TAM authentication for all archives. |
+-------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
@ -48,12 +50,13 @@ borg upgrade
path to the repository to be upgraded
optional arguments
options
-n, --dry-run do not change repository
--inplace rewrite repository in place, with no chance of going back to older versions of the repository.
--force Force upgrade
--tam Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).
--disable-tam Disable manifest authentication (in key and cache).
--archives-tam add TAM authentication for all archives.
:ref:`common_options`
@ -80,6 +83,23 @@ You do **not** need to run it when:
Borg 1.x.y upgrades
+++++++++++++++++++
Archive TAM authentication:
Use ``borg upgrade --archives-tam REPO`` to add archive TAMs to all
archives that are not TAM authenticated yet.
This is a convenient method to just trust all archives present - if
an archive does not have TAM authentication yet, a TAM will be added.
Archives created by old borg versions < 1.0.9 do not have TAMs.
Archives created by newer borg version should have TAMs already.
If you have a high risk environment, you should not just run this,
but first verify that the archives are authentic and not malicious
(== have good content, have a good timestamp).
Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons.
This upgrade needs to be done once per repository.
Manifest TAM authentication:
Use ``borg upgrade --tam REPO`` to require manifest authentication
introduced with Borg 1.0.9 to address security issues. This means
that modifying the repository after doing this with a version prior

3
pyproject.toml Normal file
View file

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "pkgconfig", "Cython", "setuptools_scm>=1.7"]
build-backend = "setuptools.build_meta"

View file

@ -1,5 +0,0 @@
# style and other checks for many languages.
# some bears (checkers) have additional requirements.
coala
coala-bears

View file

@ -1,13 +1,12 @@
setuptools==60.7.1
setuptools-scm==6.4.2
pip==22.0.3
virtualenv==20.13.0
setuptools==68.2.2
setuptools-scm==8.0.4
pip==23.3.1
virtualenv==20.24.6
pkgconfig==1.5.5
tox==3.24.5
pytest==7.0.0
pytest-xdist==2.5.0
pytest-cov==3.0.0
pytest-benchmark==3.4.1
Cython==0.29.27
twine==3.8.0
tox==4.11.3
pytest==7.4.3
pytest-xdist==3.3.1
pytest-cov==4.1.0
pytest-benchmark==4.0.0
Cython==0.29.36
python-dateutil==2.8.2

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