-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring a retention on a stdin profile applies the retention policy to the whole repository #225
Comments
Retention automatically applies a When using "stdin-filename" instead of a backup source, there is no Try using: [gitea]
inherit = "default"
[gitea.backup]
stdin-filename = "gitea.sql"
stdin-command = [
"pg_dump …",
]
tag = ["gitea", "pg_dump"]
[gitea.retention]
tag = true
after-backup = true
keep-within-yearly = "5y"
keep-within-monthly = "1y"
keep-within-weekly = "1m"
keep-within-daily = "7d"
prune = true
To the bonus question: Inheritance can be nested it is not limited explicitly. |
Thanks for all your answers, I must have overlooked the E.g. as a quick thought:[mysql]
inherit = "stdin"
[mysql.backup]
stdin-command = [ 'mysqldump --all-databases --order-by-primary' ]
stdin-filename = "dump.sql"
tag = [ 'mysql' ]
# To limit stdin profile retention policies use the tag=true option From my first observation limiting the retention to tags is not "additive", the retention in your example will affect all snapshots having the tag |
@Lucki: "tags not additive" ... yes that is a bug, I realised myself after writing a reply to this case. See #227 (second commit will fix this). As a workaround, use a singe tag at the moment. The problem is that the tag parameter is not the same for backup and other restic commands. Therefore the copy function ( The need for documentation on retention is noted. It will also include an update for this case. |
I'm new to restic and maybe I'm interpreting the command output wrong.
I have a few profiles in the configuration. Some normal path profiles and a stdin profile. One profile has no retention configured.
The retention output for the normal profile looked correct, listing all snapshots of that profile only and declaring the reasons to keep each one.
However, the output of the forget command from a stdin profile got me thinking:
[…] keep 2 snapshots: […] Reasons: daily within 7d […]
is listed for a third profile, although that specific profile has no retention. In fact that command listed all profiles with the same retention policy.The difference seems to be the
--path=…
command line flag which is missing for the profile using stdin.Retention command after normal profile:
Retention command after stdin profile which applies to all profiles including a profile without retention:
My uneducated guess is that the absence of the
--path=
flag will apply the retention policy to the whole repository regardless of other configured retention policies.Reference example: https://creativeprojects.github.io/resticprofile/configuration/examples/index.html#use-stdin-in-configuration
My trimmed config
Bonus question:
While for includes it is made very clear that they can't nest this isn't specifically mentioned for inherited profiles. Is nesting possible for inherited profiles?
The text was updated successfully, but these errors were encountered: