Michael Eischer
aa8e18cf32
restore: add deletions to progress output
2024-07-05 22:38:39 +02:00
Michael Eischer
f4b15fdd96
restore: allow deleting a directory to replace it with a file
...
When the `--delete` option is specified, recursively delete directories
that should be replaced with a file.
2024-07-05 22:38:39 +02:00
Michael Eischer
168fc09d5f
restore: use case insensitive file name comparison on windows
2024-07-05 22:38:39 +02:00
Michael Eischer
013a6156bd
restore: remove unused parameter from SelectFilter
2024-07-05 22:38:39 +02:00
Michael Eischer
ac44bdf6dd
restore: add --delete option to remove files that are not in snapshot
2024-07-05 22:38:39 +02:00
Michael Eischer
144e2a451f
restore: track expected filenames in a folder
2024-07-05 21:03:35 +02:00
Michael Eischer
d762f4ee64
restore: simplfy selectFilter arguments
2024-07-05 21:03:35 +02:00
Michael Eischer
a9a60f77ce
restore: optimize memory usage
2024-07-05 21:03:35 +02:00
Michael Eischer
ae978d60cc
restore: pass action enum to restore progress
2024-07-05 20:41:27 +02:00
Michael Eischer
83351f42e3
restore: add dry-run support
2024-07-05 20:41:27 +02:00
Michael Eischer
c47bf33884
restore: print processed files at maximum verbosity
2024-07-05 20:41:27 +02:00
Viktor Szépe
ac00229386
Fix typos
2024-07-03 20:02:06 +02:00
Michael Eischer
ca41c8fd11
restore: use fs function wrappers
...
This ensures proper path handling on Windows.
2024-06-13 22:40:37 +02:00
Michael Eischer
ebbd4e26d7
restorer: allow directory to replace existing file
2024-06-13 21:57:48 +02:00
Michael Eischer
ac729db3ce
restorer: fix overwriting of special file types
...
An attempt to replace an existing file with a hardlink previously ended
with a missing file.
Remove an existing file before trying to restore a special node. This
generalizes the existing behavior for symlinks to all special node
types.
2024-06-13 21:56:18 +02:00
Michael Eischer
5c3709e17a
restore: add --overwrite=if-changed to skip files if their mtime&size matches
...
--overwrite=always still checks the file content
2024-06-13 21:17:30 +02:00
Michael Eischer
a66658b4c9
restore: only restore changed file parts
...
For files that should be overwritten, first check whether their content
matches the snapshot and only restore diverging parts.
2024-06-13 21:17:30 +02:00
Michael Eischer
62e0e5e8d8
restore: cleanup options handling
2024-06-12 22:53:53 +02:00
Michael Eischer
8aa3ab6ef8
restore: check file type in verify
2024-06-12 22:53:53 +02:00
Michael Eischer
7f7c995977
fix linter warnings
2024-06-12 22:36:52 +02:00
Michael Eischer
e47e08a688
restorer: separately track skipped files
2024-06-12 22:36:52 +02:00
Michael Eischer
6a4ae9d6b1
restore: configurable overwrite behavior
2024-06-12 22:36:52 +02:00
Michael Eischer
2b50c2606c
restorer: use options struct
2024-06-12 22:36:52 +02:00
Michael Eischer
607daeed4f
restore: move nil pointer check into restoreui
2024-06-12 22:36:52 +02:00
Michael Eischer
30320a249a
restore: let filerestorer also handle empty files
...
This get's rid of the corresponding special cases.
2024-06-12 22:36:52 +02:00
Michael Eischer
1266a4932f
repository: fix parameter order of LookupBlobSize
...
All methods should use blobType followed by ID.
2024-05-24 21:33:17 +02:00
Michael Eischer
4df887406f
repository: inline MasterIndex interface into Repository interface
2024-05-24 21:33:17 +02:00
Aneesh Nireshwalia
d4be734c73
Handle readonly empty files in windows
2024-02-22 17:54:43 -07:00
Aneesh Nireshwalia
eeb1aa5388
Add ability to report warnings to terminal
...
Report warnings to terminal when unrecognized generic attributes are found in the repository.
2024-02-22 17:52:26 -07:00
Alexander Neumann
c0514dd8ba
Fix linter errors (except for tests)
2024-02-10 22:58:10 +01:00
Michael Eischer
2c310a526e
repository: Replace StreamPack function with LoadBlobsFromPack method
...
LoadBlobsFromPack is now part of the repository struct. This ensures
that users of that method don't have to deal will internals of the
repository implementation.
The filerestorer tests now also contain far fewer pack file
implementation details.
2024-01-19 21:40:43 +01:00
Michael Eischer
a8fdcf79b7
restorer: Make hardlink index generic
...
This will allow reusing it for the stats command without regressing the
memory usage due to storing an unnecessary file path.
2023-10-27 23:40:42 +02:00
Michael Eischer
1514593f22
Remove unused context or testing parameters
2023-05-18 21:17:53 +02:00
Michael Eischer
23a122a901
restore: count files in the same way as the stats command
2023-05-08 20:51:49 +02:00
Michael Eischer
e77002f841
restore: correctly count hardlinks in progress bar
...
For hardlinked files, only the first instance of that file increases the
amount of bytes to restore. All later instances only increase the file
count but not the restore size.
2023-05-08 20:51:49 +02:00
Mark Herrmann
f875a8843d
restore: Add progress bar
...
Co-authored-by: Mark Herrmann <mark.herrmann@mailbox.org>
2023-04-07 12:08:23 +02:00
greatroar
b150dd0235
all: Replace some errors.Wrap calls by errors.WithStack
...
Mostly changed the ones that repeat the name of a system call, which is
already contained in os.PathError.Op. internal/fs.Reader had to be
changed to actually return such errors.
2022-12-17 09:41:07 +01:00
Michael Eischer
a3113c6097
restic: Change FindSnapshot functions to return the snapshot
2022-10-15 13:34:04 +02:00
Michael Eischer
5b6a77058a
Enable sparseness only conditionally
...
We can either preallocate storage for a file or sparsify it. This
detects a pack file as sparse if it contains an all zero block or
consists of only one block. As the file sparsification is just an
approximation, hide it behind a `--sparse` parameter.
2022-09-24 21:20:00 +02:00
MichaelEischer
443cc49afd
Merge pull request #3830 from MichaelEischer/cleanup-repo
...
Extract Load/SaveTree/JSONUnpacked from repository
2022-07-23 10:46:13 +02:00
Michael Eischer
c44b21d366
restorer: extract hardlinks index from restic package
2022-07-17 13:45:42 +02:00
Michael Eischer
fbcbd5318c
repository: extract LoadTree/SaveTree
...
The repository has no real idea what a Tree is. So these methods never
belonged there.
2022-07-17 13:11:28 +02:00
Michael Eischer
6f53ecc1ae
adapt workers based on whether an operation is CPU or IO-bound
...
Use runtime.GOMAXPROCS(0) as worker count for CPU-bound tasks,
repo.Connections() for IO-bound task and a combination if a task can be
both. Streaming packs is treated as IO-bound as adding more worker
cannot provide a speedup.
Typical IO-bound tasks are download / uploading / deleting files.
Decoding / Encoding / Verifying are usually CPU-bound. Several tasks are
a combination of both, e.g. for combined download and decode functions.
In the latter case add both limits together. As the backends have their
own concurrency limits restic still won't download more than
repo.Connections() files in parallel, but the additional workers can
decode already downloaded data in parallel.
2022-07-03 12:19:26 +02:00
Michael Eischer
921e328b56
restore: Fix linting error
2021-09-19 14:41:07 +02:00
Michael Eischer
2cdc0719af
restorer: Sanitize verify errors
2021-09-19 14:01:26 +02:00
greatroar
bdcdfaf6b4
restore --verify: buffer reuse consistency and comment
2021-09-19 13:11:27 +02:00
greatroar
2b94742ca5
Replace no-op closures in restorer by nil check
2021-09-19 13:11:16 +02:00
greatroar
d357744104
Handle canceled context in restore --verify properly
2021-09-19 13:11:05 +02:00
greatroar
d4225ec803
Simplify buffer growing in Restorer.verifyFile
...
Suggested-by: Igor Fedorenko <igor@ifedorenko.com>
2021-09-19 13:10:55 +02:00
greatroar
de8521ae56
Report number of successes from Restorer.VerifyFiles
...
Previously, the number of attempts was reported.
2021-09-19 13:10:44 +02:00