README update

This commit is contained in:
Adam Štrauch 2025-01-05 10:40:41 +01:00
parent 23e637ebc3
commit e4330c781f
Signed by: cx
GPG key ID: 7262DAFE292BCE20
6 changed files with 15 additions and 3 deletions

View file

@ -4,7 +4,6 @@ This project is covering backup and sync scenarios for Incus instances.
* Backups instances into Restic repository
* Syncs instances to another incus instance
* Backs up incus itself
## KV
@ -22,6 +21,14 @@ Functions of Sentinel depends on user KV values configured on each instance. Her
| user.sync-target-pool | pool0 | Target's storage pool |
| user.sync-target-instance-suffix | -cold | Instance name suffix at the target side |
### Examples
Enabled sync and backup on existing instance:
```
incus config set <instance name> user.backup=true user.sync=true user.sync-target-remote=<remote_host>
```
## Important notes
Only one backup or sync job can run the same time. There is internal queue of jobs that
@ -32,3 +39,8 @@ Restic needs two environment variables to be set:
* RESTIC_PASSWORD
* RESTIC_REPOSITORY
Also its binary needs to be available on the system where sentinel is running.
Sentinel uses Incus's CLI interface, not its API. Currently it can work only on the same machine where Incus is running.
Synced instances have sync and backup flags disabled so if the remote system runs sentinel too it won't interfere with configuration of the main location.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -48,9 +48,9 @@ func (d *IncusDriver) Sync(sourceInstance string, targetInstance string, targetH
var cmd *exec.Cmd
if len(instances) == 0 {
cmd = exec.Command("incus", "copy", sourceInstance, targetHost+":"+targetInstance, "-s", targetPool, "--mode", "push", "--stateless")
cmd = exec.Command("incus", "copy", sourceInstance, targetHost+":"+targetInstance, "-s", targetPool, "--mode", "push", "--stateless", "-c", "user.backup=false", "-c", "user.sync=false")
} else {
cmd = exec.Command("incus", "copy", sourceInstance, targetHost+":"+targetInstance, "-s", targetPool, "--mode", "push", "--stateless", "--refresh")
cmd = exec.Command("incus", "copy", sourceInstance, targetHost+":"+targetInstance, "-s", targetPool, "--mode", "push", "--stateless", "-c", "user.backup=false", "-c", "user.sync=false", "--refresh")
}
out, err := cmd.CombinedOutput()
if err != nil {