for the archives directory, we only need to know the archive IDs,
everything else can be fetched from the ArchiveItem in the repo.
so we store empty files into archives/* with the archiv ID as name.
this makes some "by-id" operations much easier and we don't have to
deal with a useless "store_key" anymore.
removed .delete method - we can't delete by name anymore as we
allow duplicate names for the series feature. everything uses
delete_by_id() now.
also: simplify, clean up, refactor
- we should always output name and id when talking about an archive
- no problem anymore if names in archives directory are "duplicate"
- use "by-id" archives directory entry delete function
- rewrite/simplify test for borg check --undelete-archives
so if one works with backup series, one can just do:
borg prune --keep-daily 30 seriesname
seriesname will then do a precise match on the archive names
and select that series.
aid:<archive-id-prefix> can be used for -a / --match-archives
to match on the archive id (prefix) instead of the name.
NAME positional argument now also supports matching (and aid:),
but requires that there is exactly ONE result.
macOS and Linux give EISDIR, while Windows gives EPERM when trying to
open a file for writing, if the filename is already taken by an existing
directory.
now all OSes should give the same RC in this case.
borg delete and borg prune do a quick and dirty archive deletion,
just removing the archives directory entry for them.
--undelete-archives can still find the archive metadata objects
by completely scanning the repository and re-create missing
archives directory entries.
but only until borg compact would remove all unused data.
if only the manifest is missing or corrupted, do not run that
scan, it is not required for the manifest anymore.
if the manifest file is missing, check generated *.1 *.2 ... archives although an entry for the correct name and id was already
present. BUG!
this is because if the manifest is lost, that does not imply
anymore that the complete archives directory is also lost, as it
did in borg 1.x.
Also improved log messages a bit.
not for check and compact, these need an exclusive lock.
to try parallel repo access on same machine, same user,
one needs to use a non-locking cache implementation:
export BORG_CACHE_IMPL=adhoc
this is slow due the missing files cache in that implementation,
but unproblematic because no caches/indexes are persisted.
old borg just didn't commit the transaction and
thus caused a transaction rollback if not in
repair mode.
we can't do that anymore, thus we must avoid
modifying the repo if not in repair mode.
previously, borg always read all archives entries, modified the
list in memory, wrote back to the repository (similar as borg 1.x
did).
now borg works directly with archives/* in the borgstore.