226 Commits
Author SHA1 Message Date
Thomas WaldmannandClaude Fable 5 cf58f9a05a copy: new command to copy an archive to a new archive name, #2300
Copying is cheap and fast: no file content is read or written, only a new
archive metadata object is created. Like any deduplicated archives, the two
archives share their data, so a copy needs almost no additional repository
space.

The copy is an independent archive: deleting either of the two archives
keeps the other one intact, because "borg compact" only frees chunks that no
remaining archive references.

Archive.copy() is Archive.rename() without removing the original archive
entry. Copying an archive to its own name is refused: the new metadata would
be identical, thus have the same archive ID, and no second archive would be
created. NEWNAME may well be the name of some other existing archive, the
copy then just joins that archive series.

OLDNAME must match precisely one archive, so it accepts an archive name (if
it is unique) or an archive ID like "aid:d34db33f".

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-28 06:30:19 +02:00
Thomas Waldmann cfd368624e find: new command to search files across archives, #9974
borg find iterates over the archives selected by the usual archive
filter options (all archives by default) from newest to oldest, over
all items of each archive, and outputs one line per item matching the
given PATHs (paths or patterns, matching like in borg list /
borg extract).

Output lines are formatted like borg list default output, but are
prefixed with a short archive ID and the archive name. As the
archives of a series all share the same name, only the archive ID
uniquely identifies the archive.

Output is customizable via --format / BORG_FIND_FORMAT (ItemFormatter
keys) and --json-lines.

There is no extra index for file paths (keeping one up to date would
cost considerable runtime and space), so this reads the metadata of
all selected archives.
2026-08-14 14:10:11 +02:00
Thomas WaldmannandClaude Fable 5 637972f363 re-add repo-compress, fixes #9663
reimplemented for the pack-based repository format: the repository is
processed pack after pack - each pack is read as a whole and, if it has
objects not stored with the desired compression, those get recompressed
and the pack is rewritten (objects already fine are copied into the new
pack unchanged), the chunk index is updated and the old pack is deleted.
a pack whose objects all already match is not touched at all.

- new Repository.transform_pack: rewrite one pack, passing each indexed
  object's bytes through a transform callback. gap bytes are handled
  like in compact_pack: superseded duplicates are dropped, other
  unindexed bytes are carried forward for "borg check --repair".
- factored the check_pack_objects / superseded_gap_ranges helpers out
  of compact_pack, now shared with merge_packs and transform_pack.
- crash safety like compact (#9748): stored chunk indexes are
  invalidated before the first store change, a full updated index is
  written back at the end. SIGINT stops cleanly at a pack boundary,
  saving a valid index; a later run recompresses the remaining packs.
- --stats reports rewritten packs, per-object outcomes (recompressed /
  already had the desired compression / kept as-is because
  recompression brings no gain) and the repository size change.
- re-adding the fish completions also restores the compression_methods
  definition that the create/transfer/recreate/import-tar completions
  kept referencing after it was removed together with the old
  repo-compress.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-02 10:12:06 +02:00
Thomas WaldmannandClaude Fable 5 d4b3d7a721 webdav: serve archive contents read-only via HTTP, #9942
New "borg webdav" command: it starts a read-only HTTP server on localhost,
so archive contents can be browsed and files downloaded with a web browser.

This first step implements plain HTTP only (GET/HEAD, HTML directory
listings, file downloads). The WebDAV methods (OPTIONS/PROPFIND), which
enable native mounting by Windows Explorer, macOS Finder and the Linux
desktop file managers, are planned to be added on top of this later.

Implementation notes:

- only uses the python standard library, no new dependencies.
- the directory tree of an archive is built in memory when it is first
  accessed, so a big archive only costs time/memory if it is browsed.
- all repository access is serialized with a lock, because borgstore
  connections are not thread-safe.
- a LockRefresher keeps the repository lock of an idle server alive,
  so it is not killed as stale, see #9872.
- missing chunks abort the download connection, so damaged files are
  never served as silently corrupted content.
- symlinks and special files are listed, but not downloadable.

Note: downloads via HTTP do not preserve POSIX metadata (owner, group,
mode, timestamps, xattrs, ACLs) - use borg extract or borg export-tar
for full-fidelity restores.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 18:03:23 +02:00
Thomas Waldmann 6cfb90dae9 repo-compress: remove this command for now
for packs, this needs to get implemented differently to perform well.
processing needs to be pack-after-pack and the index needs to be
updated correctly and carefully, e.g. considering interruptions
of repo-compress.
2026-05-22 13:00:13 +02:00
Thomas Waldmann 15f59233b5 completion: borg can now generate completion scripts for supported shells, fixes #9172
Added `shtab` dependency for shell completion functionality:
- bash completion (works).
- zsh completion (known-broken due to iterative/shtab#183).
2025-11-17 18:47:00 +01:00
Thomas Waldmann 3120f9cd1c fixed typos and grammar (AI)
this was done by Junie AI.
2025-09-23 14:56:23 +02:00
Thomas Waldmann ebfd581049 add undelete command to index 2024-11-18 02:30:58 +01:00
Thomas Waldmann e274860983 tag: set, add, remove tags 2024-10-02 23:52:39 +02:00
Thomas Waldmann de439ee839 analyze: sum up changed chunks per parent directory 2024-10-02 16:14:44 +02:00
Thomas Waldmann 3ff33684c6 remove "borg config" docs
the config command was already removed before.
2024-09-09 13:42:31 +02:00
Thomas Waldmann 78c7aabbb6 docs: fix usage docs and references for repo-* commands 2024-09-08 18:06:26 +02:00
Thomas Waldmann b50ed04ffc build_usage / build_man 2024-09-08 12:02:17 +02:00
Thomas Waldmann b64f6e3335 scripts/gendocs.py: make it work
remove unused html_write function

gendocs: update developer docs
2024-02-09 17:37:38 +01:00
Thomas Waldmann 8342f74d5c docs: add rcompress to usage index 2022-10-03 13:50:29 +02:00
Thomas Waldmann dbae8e60eb remove borg upgrade 2022-06-26 00:25:44 +02:00
Thomas Waldmann 51cf85e627 build_usage / build_man / doc updates 2022-06-25 21:58:19 +02:00
Milkey Mouse 7ea2bd1389 Only modify window.location when redirecting (fixes #4133)
window.location.pathname = window.location.pathname can trigger a redirect,
which created a refresh loop in usage.html.
2019-02-20 11:12:45 -08:00
Thomas Waldmann a8d52351bb update man pages / usage docs 2018-07-14 14:56:29 +02:00
Thomas Waldmann ce92960c63 add auto-generated docs for borg config
also: move a bit upwards in the use docs
(cherry picked from commit 278ed640e9)
2017-12-09 13:43:36 +01:00
Milkey Mouse 5b47cf6fa5 Add borg config command (fixes #3304)
This command works similarly to "git config" - it parses repo and
cache configs to get, set, and delete values. It only works on local
repos so a malicious client can't e.g. override their storage quota
or reset the append_only flag.

Add tests for borg config

Add documentation for borg config

Change manual config edits -> borg config

There were a couple places in the documentation where it was advised
to edit the repository or cache config file, a process that is stream-
lined by borg config.
2017-11-23 14:51:54 -08:00
Marian Beermann f6c3d1d2cc docs: no third level toc on command usage pages ("Description", "Examples") 2017-06-30 17:41:58 +02:00
Marian Beermann 22311abe02 docs: usage: add benchmark page
Previously, benchmark crud was not contained in the usage pages
at all.
2017-06-07 00:42:43 +02:00
Marian Beermann 8fb7db71bc docs: split usage 2017-06-07 00:38:48 +02:00
Marian Beermann 65d1deae1a faq: separate section for attic-stuff 2017-05-22 20:55:16 +02:00
enkore 52fab07b3b Merge pull request #2510 from enkore/issue/2473
Add --debug-profile option
2017-05-17 00:10:14 +02:00
enkore 5788219ff4 borg export-tar (#2519) 2017-05-17 00:09:41 +02:00
Marian Beermann 054897c872 docs: debugging facilities 2017-05-16 23:30:44 +02:00
Marian Beermann 0b14ed84eb docs: fix wrong heading level of "Common options" 2017-05-15 17:16:44 +02:00
enkore 9e6b8f67b9 serve: ignore --append-only when creating a repository (#2501) 2017-05-12 20:34:45 +02:00
Thomas Waldmann ba20d8d131 document borg init behaviour via append-only borg serve, fixes #2440 2017-04-26 03:16:12 +02:00
enkore 9a1c1e90c1 Merge pull request #2375 from enkore/buhdf
BORG_HOSTNAME_IS_UNIQUE=yes by default.
2017-04-05 14:09:58 +02:00
Marian Beermann 49f6128d1c docs: serve: env vars in original commands are ignored 2017-04-05 13:34:50 +02:00
Marian Beermann b2953357ed recreate: add --recompress flag, avoid weirdo use of args.compression 2017-04-04 15:11:15 +02:00
Milkey Mouse 55759f76e6 Address SSH batch mode in docs (fixes #2202) (#2270) 2017-03-09 21:43:23 +01:00
enkore 0e3560b6cd Merge pull request #2219 from enkore/f/frontend-docs
document JSON
2017-02-27 17:03:37 +01:00
TW 1a67b82726 Merge pull request #2220 from ThomasWaldmann/compression-default-lz4
use lz4 compression by default, fixes #2179
2017-02-27 00:31:43 +01:00
Marian Beermann 332f7898bc update docs for create -C default change 2017-02-26 23:07:31 +01:00
kmq 757921dbdc Document relative path usage #1868 2017-02-26 20:33:15 +02:00
Marian Beermann 9ed8e4b7a9 document JSON 2017-02-26 17:01:06 +01:00
Marian Beermann 8e8d9d3f48 docs: add edited "Cryptography in Borg" and "Remote RPC protocol security" sections
The former section is a bit older (Nov 2016) and has been the piece
responsible for finding CVE-2016-10099, since while writing it I
wondered how the manifest was authenticated to actually
*be* the manifest. Well. There it is ;)

It has been edited to final form only recently and should now be ready
for review.

The latter section is new.
2017-02-16 20:27:16 +01:00
Marian Beermann 96fa1e8414 docs: define "ours" merge strategy for auto-generated files 2017-02-12 18:51:40 +01:00
Marian Beermann fa24e1f38f man pages: add borg(1) master/intro page 2017-02-12 15:28:59 +01:00
Marian Beermann 15dfaae223 docs: create: move --exclude note to main doc 2017-02-12 15:28:59 +01:00
Marian Beermann 0710bbd40e docs: create: move item flags to main doc 2017-02-12 15:28:58 +01:00
Marian Beermann d6a26ca26d docs: fix examples using borg init without -e/--encryption 2017-02-05 15:46:46 +01:00
Marian Beermann 4e0422cdf0 Move change-passphrase to the "key" group (but leave old name, too) 2017-02-04 15:10:45 +01:00
Marian Beermann 5fe32866e6 Move migrate-to-repokey to the "key" command group 2017-02-04 15:10:45 +01:00
Marian Beermann ecad0ed53a Merge branch '1.0-maint' into merge/1.0-maint
# Conflicts: ... everywhere ...
#	.travis.yml
#	Vagrantfile
#	borg/testsuite/key.py
#	docs/changes.rst
#	docs/quickstart.rst
#	docs/usage.rst
#	docs/usage/upgrade.rst.inc
#	src/borg/archive.py
#	src/borg/archiver.py
#	src/borg/crypto.pyx
#	src/borg/helpers.py
#	src/borg/key.py
#	src/borg/remote.py
#	src/borg/repository.py
#	src/borg/testsuite/archive.py
#	src/borg/testsuite/archiver.py
#	src/borg/testsuite/crypto.py
#	src/borg/testsuite/helpers.py
#	src/borg/testsuite/repository.py
#	src/borg/upgrader.py
#	tox.ini
2017-01-12 15:01:41 +01:00
Thomas Waldmann 01090d2d40 fix typos
taken from debian package, thanks to danny edel and lintian for finding these.
2017-01-12 02:25:41 +01:00