Skip to content

Improve global-policy configrations (support for ignoreIdenticalSnapshots, neverCompress, onlyCompress, ignoreDotFiles)#23

Open
TBxy wants to merge 9 commits intoperfectra1n:mainfrom
burgdev:feature/repo_config_improvments
Open

Improve global-policy configrations (support for ignoreIdenticalSnapshots, neverCompress, onlyCompress, ignoreDotFiles)#23
TBxy wants to merge 9 commits intoperfectra1n:mainfrom
burgdev:feature/repo_config_improvments

Conversation

@TBxy
Copy link
Copy Markdown

@TBxy TBxy commented Nov 9, 2025

When using a global-policy.json not everything from kopia is supported.
The documentation is a bit misleading in this regard.

New properties

This PR adds support for:

Kopia name fallbacks

Some keys used by volsync global-policy.json do use different names than a kopia configuration. The two I am aware of are

  • compression.compressor
  • keepYearly

in kopia this are

  • compression.compressorName
  • keepAnually

I added support for both, but in my opinion it would be better to just use the one from kopia, or is it something already used by volsync in other places?

Reset properties

Currently if something is removed from a property (e.g. keepYearly) this is not applied anymore, which means the old value is still used. This is probably not the expected behavior?

I reset everything (usually defaults to inherit) before applying the new policy.

(See POLICY_CLEAR_CMD and keepX commands)

Questions

  • Does snapshot_interval have any effect?
  • Why if [[ ${#POLICY_CMD[@]} -gt 3 ]]; then ...? Should it not run if -gt 1?
  • Why not just run kopia policy import --global --from-file=<(echo "$policy_json"). Maybe just with "known" properties?

Formatter

I run the formatter with

shfmt -i 4 -ci -w entry.sh

This removed some whitespaces and stuff, I can revert that.

Tests

I run tests with this image: https://github.com/burgdev/volsync/pkgs/container/volsync
Works as expected (connected with kopia to the backup and checked the applied policies)

Further Work

There are still some open configurations not applied in volsync, I can add them as well if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update default policy to Ignore Identical Snapshots

1 participant