Unknown flag: --keep-within

I’m trying to run this line, but I get the subject error.

restic backup --dry-run --skip-if-unchanged forget --keep-within 1m --files-from=“things_to_back_up.txt” --exclude-file=“things_to_exclude.txt” -vv

I read the documentation stating that “-- keep-within” should work with feeding it with a duration string like “2y5m7d3h” should work? Everything else works as expected, just seeing this with the --keep-within flag.

Any ideas? Thanks!

restic 0.17.1 compiled with go1.23.1 on windows/amd64

You are mixing commands… either you run backup or forget. And for backup there is no --keep-within flag indeed.

For backup run:

restic backup --skip-if-unchanged --files-from=“things_to_back_up.txt” --exclude-file=“things_to_exclude.txt” -vv --dry-run

For forget run:

restic forget --keep-within 1m -vv --dry-run 
3 Likes

Heh, totally the solution, thank you! :blush:

PSA: as a father of a wonderful 3 weeks old baby I can hereby certify that reading documentation while sleep deprived will yield strange results…

4 Likes