Commit graph

3069 commits

Author SHA1 Message Date
ash
d1899c1919 Remove unnecessary check that Padmé overhead is at most 12%
It's easy enough to verify exhaustively for any plausible chunker params
that Padmé always produces at most a 12% overhead. Checking that again
at runtime is pointless.
2025-04-18 23:00:23 +01:00
Thomas Waldmann
df2bb8c988
freebsd: fix nfs4 acl processing, fixes #8756
This only happened when:
- using borg extract --numeric-ids
- processing NFS4 ACLs

It didn't affect POSIX ACL processing.

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

The bug was discovered by PyCharm's "Junie" AI. \o/
2025-04-17 15:41:31 +02:00
Peter Zangerl
ce5dd4bed2 Fix paper key import error message 2025-04-13 10:06:16 +02:00
Xiaocheng Song
0d9f375fdd
macOS: retrieve birthtime in nanosecond precision via system call, fixes #8724 2025-04-12 14:03:48 +02:00
Thomas Waldmann
3fdf7a3e78
fetch_many: add replacement_chunk=True param
Sometimes, usually for file content chunks, it makes sense to
generate all-zero replacement chunks on-the-fly.

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

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

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

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

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

Co-authored-by: Divyansh Agrawal <your.email@example.com>
2025-04-05 19:12:19 +02:00
Thomas Waldmann
72cdf82660
create: remove --make-parent-dirs option, #8619
borgstore now does this automatically.
2025-04-04 23:18:39 +02:00
vancheese
8df4bf75d4
docs: borg commands updated with --repo option, fixes #8550 2025-04-01 17:28:57 +02:00
Abhijeet
4eef6178e4
add {unixtime} placeholder, fixes #8522 2025-02-24 17:18:58 +01:00
goebbe
4832364c1d
docs: clarify requirements when using command line options with special characters within a shell (#8628)
docs: within a shell, cli options with special characters may require quoting, #8578
2025-01-11 14:37:21 +01:00
Ken Kundert
b9498ca571
Allow timespan to be specified with common time units (#8626)
allow timespan to be specified with common time units, fixes #8624

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

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

Setting `BORG_DISPLAY_PASSHRASE=YES` now always shows passphrase and its hex utf-8 byte sequence.
2025-01-08 17:58:35 +01:00
TW
f9f1d21b33
Merge pull request #8613 from ThomasWaldmann/compact-dry-run-master
compact: support --dry-run (do nothing), fixes #8300
2024-12-29 19:17:30 +01:00
Thomas Waldmann
1559a1ed07
compact: support --dry-run (do nothing), fixes #8300 2024-12-29 17:57:54 +01:00
Thomas Waldmann
9d1107ea80
yes: deal with UnicodeDecodeError in input(), fixes #6984
if retry is True, it will just retry to get a valid answer.
if retry is False, it will return the default.

the code can be tested by entering "error" (without the quotes).
2024-12-29 17:36:28 +01:00
Syed Ali Ghazi Ejaz
ec3c7b5770
Add flags to borg extract Command (Fixes #8564) (#8575)
borg extract --dry-run now displays +/- flags (included/excluded) left to the path.
2024-12-27 23:10:43 +01:00
Thomas Waldmann
694fa93b76
iter_items: decouple item iteration and content data chunks preloading
It needs to be possible to iterate over all items in an archive,
do some output (e.g. if an item is included / excluded) and then
only preload content data chunks for the included items.
2024-12-23 22:30:12 +01:00
Thomas Waldmann
2108616e4c
remote: simplify code, add debug logging 2024-12-23 21:19:42 +01:00
Thomas Waldmann
a46131bec5
compact: add --stats option
with --stats it will be as slow as before, listing all repo objs.

without --stats, it will be faster by using the cached chunks index.
2024-11-24 19:36:16 +01:00
Björn Ketelaars
33834c419f Filter test output with LibreSSL related warnings on OpenBSD
We do not want that urllib spoils test output with LibreSSL related
warnings on OpenBSD.

`NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently
the 'ssl' module is compiled with 'LibreSSL 3.8.2'`.
2024-11-20 06:01:12 +01:00
Thomas Waldmann
0323c2f987
adapt to and require borghash 0.1.0 2024-11-18 01:48:01 +01:00
Thomas Waldmann
f7dea6e93f
repo-compress: reduce memory consumption
Worst (but frequent) case here is that all or most of the chunks
in the repo need to get recompressed, thus storing all chunk ids
in a python list would need significant amounts of memory for
large repositories.

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

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

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

also:

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

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

Support running with or without --repair.

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

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

Only if it is the right type of object, we need to read the full object (metadata
and data).
2024-11-05 21:02:49 +01:00
Thomas Waldmann
299c05287f
compact: remove soft-deleted archives/* entries, docs 2024-11-05 21:02:24 +01:00
Thomas Waldmann
9fabc19e6b
undelete: undelete soft-deleted archives, fixes #8500 2024-11-05 20:56:32 +01:00
Thomas Waldmann
7ed8ed56d2
repo-list: --deleted lists deleted archives 2024-11-05 20:03:07 +01:00
Thomas Waldmann
088d59d814
repository: store_list: add deleted param 2024-11-05 20:03:06 +01:00
Thomas Waldmann
c8bce0329d
archive deletion: use store soft-deletion
This keeps the object, just renames it to "*.del".
2024-11-05 20:03:04 +01:00
Thomas Waldmann
179aadc5cc
repository: add store_move for soft-delete 2024-11-05 20:02:57 +01:00
Thomas Waldmann
5fc72080bb
mount docs: apply jdchristensen's suggestion, better phrasing. 2024-11-03 14:04:45 +01:00