README update
This commit is contained in:
parent
23e637ebc3
commit
e4330c781f
6 changed files with 15 additions and 3 deletions
14
README.md
14
README.md
|
@ -4,7 +4,6 @@ This project is covering backup and sync scenarios for Incus instances.
|
||||||
|
|
||||||
* Backups instances into Restic repository
|
* Backups instances into Restic repository
|
||||||
* Syncs instances to another incus instance
|
* Syncs instances to another incus instance
|
||||||
* Backs up incus itself
|
|
||||||
|
|
||||||
## KV
|
## 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-pool | pool0 | Target's storage pool |
|
||||||
| user.sync-target-instance-suffix | -cold | Instance name suffix at the target side |
|
| 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
|
## Important notes
|
||||||
|
|
||||||
Only one backup or sync job can run the same time. There is internal queue of jobs that
|
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_PASSWORD
|
||||||
* RESTIC_REPOSITORY
|
* 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.
|
@ -48,9 +48,9 @@ func (d *IncusDriver) Sync(sourceInstance string, targetInstance string, targetH
|
||||||
|
|
||||||
var cmd *exec.Cmd
|
var cmd *exec.Cmd
|
||||||
if len(instances) == 0 {
|
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 {
|
} 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()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue