Skip to content
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

'retain' parameter with 'include_conf' does not work as expected #330

Open
2 tasks done
didierm opened this issue Sep 1, 2023 · 0 comments
Open
2 tasks done

'retain' parameter with 'include_conf' does not work as expected #330

didierm opened this issue Sep 1, 2023 · 0 comments
Labels

Comments

@didierm
Copy link

didierm commented Sep 1, 2023

Checklist

  • I'm reporting a bug
  • I've searched the bugtracker for similar issues, including closed ones.

What did you do?

  • create base config file base.conf with generic retain parameters
logfile /var/log/base.log
retain daily 7
retain weekly 4 
retain monthly 12
  • create instance config file instance01.conf with specific overriding retain parameters
include_conf base.conf

logfile /var/log/instance01.log
retain daily 30
retain monthly 24
  • execute rsnapshot
$ rsnapshot -t -c ./instance01.conf daily

What happened?

  • expectedly, rsnapshot creates a logfile /var/log/instance01
  • unexpectedly, rsnaphot retains only 7 copies of the "daily" backup level

What did you expect to happen

  • rsnaphot should retain 30 copies of the "daily" backup level, as the retain daily 30 parameter from the instance01 configuration succeeds, and hence should overwrite the retain daily 7 parameter from the base configuration.

My configuration

see above for a minimal example

Environment

* OS: CentOS Linux 7.9
* Filesystem: XFS
* rsnapshot : v1.4.5

Other information

When including a config file, the contents of the config file are inserted at that specific location :

$ man rsnapshot
...
include_conf       Include another file in the configuration at this point.
  • As expected, subsequent parameter values override previous parameter values (cfr. logfile).

  • This is apparently not the case for the retain parameter, which seems to add all encountered parameter values to an array, indifferent to already existing "name" backup level occurances.

Remediation :

  • only new backup level "name"s should be added to the array ;
  • exisiting backup level "name"s should be overwritten with the new "number" value.

Current mitigation :

  • include base configs at the end of the instsance config (unwanted, as this prevents overwriting base conf parameters)
  • do not define retain parameters in the base config.
@didierm didierm added the bug label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant