resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Docs: Configuration reference does not state default value for `tag` option

Open rsnitsch opened this issue 2 years ago • 4 comments

The reference docs on the config options does not specify a default value for the tag option. Link: https://creativeprojects.github.io/resticprofile/configuration/reference/index.html

For example in the forget and retention sections it just says:

image

The observed behavior of resticprofile indicates that true is the default value being applied to my profiles. Correct me if I'm wrong.

The default value for the path option is also missing. There I guess the default is false but I haven't tested it. EDIT: I did a test now and it seems the default value for the path option is also true.

I think this information is important to understand resticprofile's default behavior and should be included in the docs, so that user's don't have to run tests to find out which it is...

rsnitsch avatar Apr 23 '23 09:04 rsnitsch

Thanks for pointing it out.

As a matter of fact, the "reference" in the documentation is automatically generated, and we don't have a field to specify the default value as there's only a few flags that need it.

This is something we plan to fix at some point though 👍🏻

creativeprojects avatar Apr 23 '23 12:04 creativeprojects

The default unfortunately depends on the config version, it is fixed in V1. We might need a separate doc page on this and some discussion, proper defaults for tag and path are quite important but cannot be changed for config version 1 since it could break existing setups.

E.g. if path is true and backup.source is changed, it won't match existing snapshots anymore, therefore forget (retention) as well as any other commands that select snapshots will not match snapshots belonging to a certain profile in this case which means that for example retention will not work as expected. The same is true for tags but it also depends on what is more likely to get changed, tags or source and whether we allow configurations (in config version 2) that create such issues.

jkellerer avatar Apr 24 '23 09:04 jkellerer

E.g. if path is true and backup.source is changed, it won't match existing snapshots anymore, therefore forget (retention) as well as any other commands that select snapshots will not match snapshots belonging to a certain profile in this case which means that for example retention will not work as expected.

This is actually slightly off-topic, because I just wondered why the default is not given in the docs. The actual defaults I don't care about, since we can overwrite them anyway.

In any case, my tests showed that resticprofile's default is true for both the tag and path options. So this is the current default behavior of resticprofile for v1 config. I believe this is also consistent with restic's default behavior. By default restic forget uses --group-by host,paths so that snapshots with a different path will be treated as a separate group anyway. Ok, obviously specifying the paths via --path is even more strict, but I think the core issue is the same: The retention policy will largely stop working "properly" if you change the path of the source.

Personally I prefer what I call tag-centric backups where I am free to move around folders on my system and the retention policies will keep working. I.e. I use restic forget --tag mybackupname --group-by host and thus overwrite the default --group-by host,paths.

rsnitsch avatar Apr 24 '23 09:04 rsnitsch

Not entirely off topic since it is the explanation why it wasn't given in the first incarnation of the auto generated config reference 😀 .. but as @creativeprojects already mentioned we need to improve this part.

For config v2, I'd also prefer a tag centric approach (for the default values, you can still configure what you want) but that requires some separate discussion and documentation.

jkellerer avatar Apr 24 '23 09:04 jkellerer