Commit Graph

1972 Commits

Author SHA1 Message Date
Alexander Neumann
d401ad6c1e Add version for 0.18.0 2025-03-27 20:16:56 +01:00
Michael Eischer
9aad8e9ea5 Merge pull request #5299 from Martin2112/go_cleanup
A few more small cleanups that should not change behaviour.
2025-03-24 13:59:39 +01:00
Michael Eischer
ffd63f893a Merge pull request #5296 from MichaelEischer/reindex-before-recover
recover: reindex before reassembling snapshot
2025-03-24 11:16:38 +01:00
Michael Eischer
f5989964ed restore: fix redundant default value for --overwrite option 2025-03-23 19:54:22 +01:00
Michael Eischer
99fdb00d39 recover: add minimal integration test 2025-03-23 18:07:41 +01:00
Michael Eischer
2409078d55 recover: automatically run repair index before recovering snapshots 2025-03-23 17:55:33 +01:00
Michael Eischer
0b6c355678 recover: refactor to use termstatus 2025-03-23 17:46:49 +01:00
Michael Eischer
f7f48b3026 ui/progress: extend Printer interface with print to stdout method 2025-03-23 17:46:04 +01:00
Martin Smith
6caad10840 Remove extra brackets. 2025-03-23 10:11:43 +00:00
Martin Smith
6e45c51509 Fix name including package name and variable shadowing package. 2025-03-23 10:01:19 +00:00
Martin Smith
f238f81ba6 Renames to fix clashes with reserved words. 2025-03-22 18:20:30 +00:00
Martin Smith
3788605127 Rename unused parameters to '_'. 2025-03-22 18:20:30 +00:00
Martin Smith
29b4680873 Remove unnecessary type conversions, second set. 2025-03-22 18:20:30 +00:00
Martin Smith
092899df8b Remove unnecessary type conversions. 2025-03-22 18:20:30 +00:00
Martin Smith
1daf5317f8 Fix import ordering. 2025-03-22 18:20:30 +00:00
Martin Smith
db8daeb192 Fix godoc comments. 2025-03-22 18:20:30 +00:00
Michael Eischer
ef692991a4 Merge pull request #5183 from wplapper/cmd_prune
restic prune: selection of packs to repack based on size
2025-03-22 15:43:32 +01:00
Michael Eischer
062cfc549d prune: fix not working option 2025-03-22 15:34:40 +01:00
Michael Eischer
3e58b15ace prune: allow --repack-smaller-than independently of --repack-small 2025-03-22 15:08:36 +01:00
Winfried Plappert
cc4712f8e9 add a test to cmd_ls_integration_test.go: test rest ls --json (#5255)
* cmd_ls: one more test: ls --json to check the JSON lines

validate that the individual JSON lines are valid JSON statements.
Check for snap ID and the path names in the backup.
2025-03-22 14:20:19 +01:00
Luz Paz
794341a494 doc: fix various typos
Found via `codespell -q 3 -L atleast,iinclude,ist,programm,reenable,ser,uptodate`
2025-03-05 20:47:08 -05:00
Winfried Plappert
a2a1309fd9 prune: make small pack size configureable for prune all changes together
cmd_prune.go: added option `--repack-smaller-than`
prune.go: added field `SmallPackBytes` to `PruneOptions`, including checking and processing
prune_test.go: added test `TestPruneSmall`
doc/060_forget.rst: added description of enhancement
changelog/unreleased/issue-5109: description of enhancement
2025-02-18 16:54:44 +00:00
Michael Eischer
5ddda7f5e9 Merge pull request #5242 from MichaelEischer/fix-read-stdin-msg
print password from stdin message only to terminal
2025-02-16 18:29:34 +01:00
Michael Eischer
8c12291f56 Merge pull request #5241 from MichaelEischer/cleanup-cli
Refactor CLI command initialization to use less global state
2025-02-16 18:28:48 +01:00
Michael Eischer
0c4e65228a refactor secondary options 2025-02-07 21:29:33 +01:00
Michael Eischer
120bd08c0d move globalOptions initialization into method 2025-02-07 21:29:33 +01:00
Michael Eischer
d378a171c8 cleanup backend initialization 2025-02-07 21:29:33 +01:00
Michael Eischer
c752867f0a fix linter errors 2025-02-07 21:29:33 +01:00
Michael Eischer
412d6d9ec5 Create root command via function 2025-02-07 21:29:33 +01:00
Michael Eischer
5497217018 print password from stdin message only to terminal 2025-02-07 20:54:18 +01:00
Michael Eischer
aa9cdf93cf refactor persistent options to be applied via functions 2025-02-07 19:03:46 +01:00
Michael Eischer
aacd6a47e3 refactor to use constructor functions to create cobra commands
This allows getting rid of the global options variables
2025-02-07 18:56:45 +01:00
Michael Eischer
dc9b6378f3 move cli flags into AddFlags on option structs 2025-02-06 22:10:41 +01:00
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