restic/internal
Aneesh Agrawal 058dfc20da Avoid choosing parent snapshot newer than time of current snapshot
Currently, `restic backup` (if a `--parent` is not provided)
will choose the most recent matching snapshot as the parent snapshot.
This makes sense in the usual case,
where we tag the snapshot-being-created with the current time.

However, this doesn't make sense if the user has passed `--time`
and is currently creating a snapshot older than the latest snapshot.
Instead, choose the most recent snapshot
which is not newer than the snapshot-being-created's timestamp,
to avoid any time travel.

Impetus for this change:
I'm using restic for the first time!
I have a number of existing BTRFS snapshots
I am backing up via restic to serve as my initial set of backups.
I initially `restic backup`'d the most recent snapshot to test,
then started backing up each of the other snapshots.
I noticed in `restic cat snapshot <id>` output
that all the remaining snapshots have the most recent as the parent.
2022-01-23 23:55:00 -05:00
..
archiver Merge pull request #3510 from MichaelEischer/fix-archiver-early-on-abort 2021-10-16 15:37:41 +02:00
backend Merge pull request #3544 from restic/fix-b2-delete-retry 2022-01-13 23:28:30 +01:00
bloblru Check cap instead of len in bloblru 2021-10-03 09:34:17 +02:00
cache Merge pull request #3474 from kitone/fix-issue-3382 2021-11-07 17:57:54 +01:00
checker Add plumbing to calculate backend specific file hash for upload 2021-08-04 22:17:46 +02:00
crypto crypto: Remove unused error 2020-09-05 10:07:16 +02:00
debug Allow debug logging to pipes and terminals 2020-10-19 22:30:30 +02:00
dump Refactor internal/dump + concurrent load/write 2021-11-01 23:01:55 +01:00
errors Modernize error handling in local backend 2021-06-18 11:13:27 +02:00
filter filter: Fix crash for '**' pattern 2021-05-14 23:50:31 +02:00
fs Save cached files to a temporary location first 2021-08-04 22:02:42 +02:00
fuse Move Blobcache into dedicated internal package 2021-09-24 15:45:00 +02:00
hashing errcheck: Add error checks 2021-01-30 20:02:37 +01:00
limiter Add plumbing to calculate backend specific file hash for upload 2021-08-04 22:17:46 +02:00
migrations Fix issues reported by semgrep 2020-12-11 09:41:59 +01:00
mock Add plumbing to calculate backend specific file hash for upload 2021-08-04 22:17:46 +02:00
options Some options fixes 2020-12-23 23:26:04 +03:00
pack Add plumbing to calculate backend specific file hash for upload 2021-08-04 22:17:46 +02:00
repository Replace siphash by hash/maphash 2021-09-19 16:05:18 +02:00
restic Avoid choosing parent snapshot newer than time of current snapshot 2022-01-23 23:55:00 -05:00
restorer restore: Fix linting error 2021-09-19 14:41:07 +02:00
selfupdate self-update: Don't cancel download after 30 seconds 2019-02-23 11:15:18 +01:00
test Add more error handling 2021-01-30 20:19:47 +01:00
textfile Add more error handling 2021-01-30 20:19:47 +01:00
ui ui: consolidate backup ui in ui/backup package 2021-09-12 16:20:15 +02:00
walker internal/restic: Don't allocate in Tree.Insert 2021-09-26 18:08:48 +02:00