diff --git a/README.md b/README.md index 57835a4..3144e7c 100644 --- a/README.md +++ b/README.md @@ -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 user.backup=true user.sync=true user.sync-target-remote= +``` + ## 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. diff --git a/bin/incus-sentinel.linux.amd64 b/bin/incus-sentinel.linux.amd64 deleted file mode 100755 index 1fcb5cf..0000000 Binary files a/bin/incus-sentinel.linux.amd64 and /dev/null differ diff --git a/bin/incus-sentinel.linux.arm64 b/bin/incus-sentinel.linux.arm64 deleted file mode 100755 index d0cffaa..0000000 Binary files a/bin/incus-sentinel.linux.arm64 and /dev/null differ diff --git a/bin/incus-sentinel.v0.linux.amd64 b/bin/incus-sentinel.v0.linux.amd64 deleted file mode 100755 index 1fcb5cf..0000000 Binary files a/bin/incus-sentinel.v0.linux.amd64 and /dev/null differ diff --git a/bin/incus-sentinel.v0.linux.arm64 b/bin/incus-sentinel.v0.linux.arm64 deleted file mode 100755 index d0cffaa..0000000 Binary files a/bin/incus-sentinel.v0.linux.arm64 and /dev/null differ diff --git a/incus/main.go b/incus/main.go index 51843e2..e6657a2 100644 --- a/incus/main.go +++ b/incus/main.go @@ -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 {