Commit Graph

1939 Commits

Author SHA1 Message Date
Michael Eischer 39823c5f6c doc: deprecate short_id and add some missing fields 2025-02-06 20:53:01 +01:00
Michael Eischer da47967316
Merge pull request #5194 from darkdragon-001/json-check
Json check
2025-02-05 22:15:10 +01:00
Dark Dragon 49a411f7ac Print JSON summary in all error cases 2025-02-05 22:08:06 +01:00
Dark Dragon 7cc1aa0cd4 Add check summary 2025-02-05 22:08:06 +01:00
Dark Dragon a58a8f2ce0 Add JSON output to check command 2025-02-05 22:08:05 +01:00
Dark Dragon 79d435efb1 Use printer.NewCounter() instead of newTerminalProgressMax()
where possible (max is unknown).
2025-02-05 22:07:47 +01:00
Michael Eischer 9cdf91b406
Merge pull request #5235 from MichaelEischer/refactor-ls-sorting
Refactor ls sorting
2025-02-05 20:44:08 +01:00
Winfried Plappert 4104a8e6a5
Issue: 4942: cmd_rewrite: add snapshot summary data to an existing snapshot. (#5185)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-02-05 20:40:20 +01:00
Michael Eischer 6cc06e0812 ls: add missing error handling 2025-02-03 22:15:59 +01:00
Michael Eischer c32613a624 ls: extract comparator 2025-02-03 22:15:59 +01:00
Michael Eischer 1807627dda ls: refactor sorting into sortedPrinter struct 2025-02-03 22:15:59 +01:00
Michael Eischer 993eb112cd ls: deduplicate sorting test 2025-02-03 22:15:54 +01:00
Michael Eischer 36d8916354 ls: use numeric based enum for SortMode 2025-02-03 22:11:46 +01:00
Winfried Plappert 060a44202f
ls: sort output by size, atime, ctime, mtime, time(=mtime), extension (#5182)
Enhancement: create ability to sort output of restic ls -l by
name, size, atime, ctime, mtime, time(=mtime), X(=extension), extension

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-02-03 22:07:04 +01:00
Gilbert Gilb's 536ebefff4
feat(backends/s3): add warmup support before repacks and restores (#5173)
* feat(backends/s3): add warmup support before repacks and restores

This commit introduces basic support for transitioning pack files stored
in cold storage to hot storage on S3 and S3-compatible providers.

To prevent unexpected behavior for existing users, the feature is gated
behind new flags:

- `s3.enable-restore`: opt-in flag (defaults to false)
- `s3.restore-days`: number of days for the restored objects to remain
  in hot storage (defaults to `7`)
- `s3.restore-timeout`: maximum time to wait for a single restoration
  (default to `1 day`)
- `s3.restore-tier`: retrieval tier at which the restore will be
  processed. (default to `Standard`)

As restoration times can be lengthy, this implementation preemptively
restores selected packs to prevent incessant restore-delays during
downloads. This is slightly sub-optimal as we could process packs
out-of-order (as soon as they're transitioned), but this would really
add too much complexity for a marginal gain in speed.

To maintain simplicity and prevent resources exhautions with lots of
packs, no new concurrency mechanisms or goroutines were added. This just
hooks gracefully into the existing routines.

**Limitations:**

- Tests against the backend were not written due to the lack of cold
  storage class support in MinIO. Testing was done manually on
  Scaleway's S3-compatible object storage. If necessary, we could
  explore testing with LocalStack or mocks, though this requires further
  discussion.
- Currently, this feature only warms up before restores and repacks
  (prune/copy), as those are the two main use-cases I came across.
  Support for other commands may be added in future iterations, as long
  as affected packs can be calculated in advance.
- The feature is gated behind a new alpha `s3-restore` feature flag to
  make it explicit that the feature is still wet behind the ears.
- There is no explicit user notification for ongoing pack restorations.
  While I think it is not necessary because of the opt-in flag, showing
  some notice may improve usability (but would probably require major
  refactoring in the progress bar which I didn't want to start). Another
  possibility would be to add a flag to send restores requests and fail
  early.

See https://github.com/restic/restic/issues/3202

* ui: warn user when files are warming up from cold storage

* refactor: remove the PacksWarmer struct

It's easier to handle multiple handles in the backend directly, and it
may open the door to reducing the number of requests made to the backend
in the future.
2025-02-01 18:26:27 +00:00
Winfried Plappert c4be05dbc2
Issue 4433: Ability to define sort order for output of find command (#5184)
The old sorting behaviour was to sort snapshots from oldest to newest.
The new sorting order is from newest to oldest. If one wants to revert to the
old behaviour, use the option --reverse.

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-01-29 20:44:16 +00:00
Michael Eischer 8b63e1cd72
Merge pull request #5129 from tesshuflower/5089_exclude_xattrs_on_restore
Allow excluding xattrs at restore time
2025-01-18 23:15:11 +01:00
Srigovind Nayak 115ecb3c92
tag: output the original ID and new snapshotID (#5144)
* tag: output the original ID and new snapshotID

tag: print changed snapshot information immediately

* print changed snapshot immediately after it has been saved
* add message type to the changedSnapshot
* add a summary type which will share the JSON output of the numer of changed snapshots
* updated verbosity of the changed snapshot in text mode to only work when verbosity > 2
* also use the terminal status printer for a standard handling for stdout messages
2025-01-14 18:57:47 +01:00
Michael Eischer b7ff8ea9cd repository: expose cache via method 2025-01-13 22:40:18 +01:00
Michael Eischer 99e105eeb6 repository: restrict SaveUnpacked and RemoveUnpacked
Those methods now only allow modifying snapshots. Internal data types
used by the repository are now read-only. The repository-internal code
can bypass the restrictions by wrapping the repository in an
`internalRepository` type.

The restriction itself is implemented by using a new datatype
WriteableFileType in the SaveUnpacked and RemoveUnpacked methods. This
statically ensures that code cannot bypass the access restrictions.

The test changes are somewhat noisy as some of them modify repository
internals and therefore require some way to bypass the access
restrictions. This works by capturing an `internalRepository` or
`Backend` when creating the Repository using a test helper function.
2025-01-13 22:39:57 +01:00
Albin Vass 5bf0204caf
Do not skip root tree when searching for trees (#5153)
This fixes an issue where restic cannot find the tree when trying to find the
tree id of a snapshot.

---------

Co-authored-by: Albin Vass <albinvass@gmail.com>
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-01-13 21:08:38 +00:00
Michael Eischer 14d02df8bb
Merge pull request #5162 from MichaelEischer/promote-feature-gates
Stabilize `explicit-s3-anonymous-auth` and `safe-forget-keep-tags` feature flags
2025-01-13 22:03:06 +01:00
Michael Wildman da71e77b28 backup: allow excluding online-only cloud files 2025-01-13 21:11:23 +01:00
Tesshu Flower cd84fe0853
xattrs - restore all by default, doc/chglog update
Signed-off-by: Tesshu Flower <tflower@redhat.com>
2025-01-10 15:25:09 -05:00
Tesshu Flower 3ac697d03d
linux default restore only user xattrs, doc update
* On Linux restore only user.* xattrs by default
* restore all for other OSs
* Update docs and changelog about the new restore
flags --exclude-xattr and --include-xattr

Signed-off-by: Tesshu Flower <tflower@redhat.com>
2025-01-10 15:13:45 -05:00
Tesshu Flower f457b16b23
update nodeRestoreExtendedAttributes() for win
- also other platforms
- move xattr include/exclude filter parsing into
  separate func

Signed-off-by: Tesshu Flower <tflower@redhat.com>
2025-01-10 15:13:44 -05:00
Tesshu Flower af839f9548
restore: exclude/include xattrs
For: https://github.com/restic/restic/issues/5089

Signed-off-by: Tesshu Flower <tflower@redhat.com>
2025-01-10 15:13:40 -05:00
Michael Eischer 098db935f7 Stabilize `explicit-s3-anonymous-auth` and `safe-forget-keep-tags` flags
The features can no longer be disabled.
2024-11-30 21:22:51 +01:00
Michael Eischer 8f9d755b44
Merge pull request #5158 from dnnr/clarify-max-repack-size
Reword description of --max-repack-size for clarity
2024-11-30 19:19:01 +01:00
Daniel Danner 1062546563
Mention `size` 2024-11-30 17:52:29 +01:00
Michael Eischer 641390103d fs: inline ExtendedStat 2024-11-30 16:19:16 +01:00
Daniel Danner 0997f26461 Reword description --max-repack-size for clarity 2024-11-29 23:29:43 +01:00
Michael Eischer bd16804812 Merge branch 'patch-release' 2024-11-09 11:43:01 +01:00
Alexander Neumann e2a98aa955 Set development version for 0.17.3 2024-11-08 20:36:48 +01:00
Alexander Neumann bc64921a8e Add version for 0.17.3 2024-11-08 20:36:36 +01:00
Michael Eischer d46525a51b fix double printf usage 2024-11-03 21:44:45 +01:00
Michael Eischer b8527f4b38 prune: allow dry-run without taking a lock 2024-11-03 21:44:45 +01:00
Michael Eischer 270e7b7679
Merge pull request #5122 from restic/bump-golangci-lint
Bump go and golangci lint version
2024-11-03 21:34:25 +01:00
Michael Eischer d5bd3fcda5
Merge pull request #5112 from MichaelEischer/fix-vss-root-volume
Fix VSS metadata error (master)
2024-11-03 21:30:39 +01:00
Michael Eischer d3c3390a51 ls: proper error handling if output is not possible 2024-11-01 17:07:43 +01:00
Michael Eischer 569a117a1d improve fprintf related error handling 2024-11-01 17:07:43 +01:00
Michael Eischer 41fa41b28b fix double printf usage 2024-11-01 16:36:23 +01:00
Michael Eischer e18a2a0072
Merge pull request #5096 from MichaelEischer/prune-allow-dry-run
prune: allow dry-run without taking a lock
2024-11-01 15:34:15 +01:00
Michael Eischer 868efe4968 prune: allow dry-run without taking a lock 2024-11-01 15:27:25 +01:00
Michael Eischer b5bc76cdc7 test retry on repo opening 2024-11-01 15:17:54 +01:00
Michael Eischer 74c783b850 retry load or creating repository config
By now missing files are not endlessly retried by the retry backend such
that it can be enabled right from the start.

In addition, this change also enables the retry backend for the `init`
command.
2024-11-01 15:17:54 +01:00
Michael Eischer 4380627cb7 backup: run test with absolute path 2024-10-31 22:07:15 +01:00
Michael Eischer 51cd1c847b backup: log error if test backup fails 2024-10-31 22:06:50 +01:00
Michael Eischer cb9247530e backup: run test with absolute path 2024-10-31 22:06:50 +01:00
Michael Eischer 1f0f6ad63d Merge branch 'patch-release' 2024-10-27 18:35:32 +01:00