I’ve created an issue on GH with no response, so maybe here I’ll find the solution:
Kopia 0.17 is installed in the server mode on Ubuntu 23.04.
I’m trying to configure the Kopia via Ansible and Kopia cli and struggling with the ‘policy set’:
kopia policy set "user@host:/some/path" --before-snapshot-root-action "/path/to/script.sh script-param1 script-param2"
After running the above command and looking at the Kopia UI policy page for the ‘user@host:/some/path’ the ‘Before Snapshot’ field (both defined and effective) remains empty no matter what I’ve tried although the 'kopia policy show ’ shows that the before action is correctly set:
Run command before snapshot root: (defined for this target)
Command:
/path/to/script.sh script-param1 script-param2
Mode: essential
Timeout: 1m0s
The referenced script is running fine when the snapshot is taken, though and I could live with it but when the before/after action is set via CLI these before/after commands are removed when the policy is updated via Server UI manually.
On the other hand, if I set the same script but on the Server UI manually it is set correctly and visible in the UI and the snapshot runs successfully. But the kopia policy show
shows it as an embedded script (not as Command as shown above) :
Run command before snapshot root: (defined for this target)
Embedded script (stored in repository): <<<<<<<<---------
/path/to/script.sh script-param1 script-param2
Mode: essential
Timeout: 1m0s
Looks like a bug. Does anyone have a solution?