Skip to content

archive: use 3 timestamps, fixes #9400#9436

Merged
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
ThomasWaldmann:three-timestamps
Mar 4, 2026
Merged

archive: use 3 timestamps, fixes #9400#9436
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
ThomasWaldmann:three-timestamps

Conversation

@ThomasWaldmann
Copy link
Member

time: the nominal ts, used for prune, list, sorting, ...
start: operation start time (informative)
end: operation end time (informative)

Often, "time" is the same as "start" (normal borg create).

But it can make sense to have a different "time":

  • borg create --timestamp=...
  • borg recreate --timestamp=...
  • borg recreate (will keep "time" as in original archive)
  • borg transfer (will keep "time" as in original archive)

recreate and transfer produce new archives, "start" and "end" will reflect the recreate/transfer operation.

Also: remove start_monotonic. start and end are just what the clock shows (including tz), so should be ok to compute duration from that, even for dst switching times.

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.53%. Comparing base (7b69bed) to head (9b633cd).
⚠️ Report is 15 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/borg/helpers/parseformat.py 50.00% 1 Missing ⚠️
src/borg/upgrade.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9436   +/-   ##
=======================================
  Coverage   76.52%   76.53%           
=======================================
  Files          85       85           
  Lines       14822    14809   -13     
  Branches     2214     2209    -5     
=======================================
- Hits        11343    11334    -9     
+ Misses       2802     2800    -2     
+ Partials      677      675    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

time: the nominal ts, used for prune, list, sorting, ...
start: operation start time (informative)
end: operation end time (informative)

Often, "time" is the same as "start" (normal borg create).

But it can make sense to have a different "time":
- borg create --timestamp=...
- borg recreate --timestamp=...
- borg recreate (will keep "time" as in original archive)
- borg transfer (will keep "time" as in original archive)

recreate and transfer produce new archives, "start" and "end"
will reflect the recreate/transfer operation.

Also: remove start_monotonic. start and end are just what the
clock shows (including tz), so should be ok to compute duration
from that, even for dst switching times.
@ThomasWaldmann ThomasWaldmann merged commit 404c06d into borgbackup:master Mar 4, 2026
31 of 32 checks passed
@ThomasWaldmann ThomasWaldmann deleted the three-timestamps branch March 4, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant