1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-23 00:00:04 +01:00
restic/internal/archiver
Sebastian Hasler fcb451cd1f backup: support reading changed files/dirs from a file
For `restic backup`, support new flags
`--changed-files-from-verbatim` and `--changed-files-from-raw` to
read the files/dirs that actually have changed from a file (or
multiple files). Directories that don't (directly or indirectly)
contain any changed files/dirs will reuse the corresponding subtree
of the parent snapshot.

This option is useful for higher-level backup tools which use
restic as a backend but have their own mechanism of figuring out
which files have changed (e.g., using zfs or btrfs diff tools).
We require to explicitly pass `--parent` as a protection mechanism
in order to make sure the higher-level backup tool and restic agree
on the parent snapshot. Though the caller can circumvent this
protection mechanism by passing `--parent latest`.

Caveat: since device IDs are unstable (across reboots or across
different zfs/btrfs snapshots of the same subvolume), the parent
snapshot and current snapshot might have mismatching device IDs.
In this case, the feature will still reuse subtrees of the parent
snapshot (under the conditions mentioned above), so we end up with
a snapshot that contains subtrees with different `device_id`
values, even if there was only a single mountpoint in play.

For now, we could simply document this caveat and discourage users
who rely on correct restoration of hardlinks from using this
feature. When https://github.com/restic/restic/issues/3041 is
properly fixed in the future, then this caveat probably goes away,
too.

The idea for this feature emerged here:
https://github.com/restic/restic/issues/1502#issuecomment-1721956623
2023-09-16 11:09:06 +02:00
..
archiver.go backup: support reading changed files/dirs from a file 2023-09-16 11:09:06 +02:00
archiver_test.go test: use parameter instead of hardcoded constant 2023-05-18 21:17:53 +02:00
archiver_unix_test.go Remove unused context or testing parameters 2023-05-18 21:17:53 +02:00
archiver_windows_test.go Remove unused context or testing parameters 2023-05-18 21:17:53 +02:00
blob_saver.go archiver: Asynchronously complete FutureFile 2022-10-30 10:29:11 +01:00
blob_saver_test.go Replace lots of unused parameters with _ 2023-05-18 21:17:53 +02:00
buffer.go archiver: Remove cleanup goroutine from BufferPool 2022-05-29 17:09:16 +02:00
doc.go archiver: Add high-level documentation 2018-05-12 23:55:54 +02:00
file_saver.go archiver: Fix race condition resulting in files containing null IDs 2022-11-10 20:19:37 +01:00
file_saver_test.go test: use parameter instead of hardcoded constant 2023-05-18 21:17:53 +02:00
scanner.go archiver: remove unused fileInfo from progress callback 2022-07-23 14:16:23 +02:00
scanner_test.go test: Use testing.T.Cleanup to remove tempdirs 2022-12-09 14:23:55 +01:00
testing.go backup: support reading changed files/dirs from a file 2023-09-16 11:09:06 +02:00
testing_test.go repository: Remove empty cleanup functions in tests 2022-12-11 11:06:25 +01:00
tree.go archiver/tree: Introduce functions Leaf() and NodeNames() 2021-01-29 11:11:28 +01:00
tree_saver.go tweak debug logs 2023-04-23 11:38:06 +02:00
tree_saver_test.go Replace lots of unused parameters with _ 2023-05-18 21:17:53 +02:00
tree_test.go test: Use testing.T.Cleanup to remove tempdirs 2022-12-09 14:23:55 +01:00