scheduler: repair restic bootstrap probes

This commit is contained in:
codex 2026-07-14 16:16:46 -03:00
parent fb9a5d8007
commit 73525ad712
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ func TestJobNameBackupCommandAndResticEnvCoverRemainingBranches(t *testing.T) {
Dedupe: &dedupe,
KeepLast: &keepLast,
})
if !strings.Contains(cmd, "restic unlock") || !strings.Contains(cmd, "restic init") || !strings.Contains(cmd, "--tag dedupe=off") || !strings.Contains(cmd, "--keep-last 3") {
if !strings.Contains(cmd, "restic unlock") || !strings.Contains(cmd, "restic cat config") || !strings.Contains(cmd, "restic rebuild-index") || !strings.Contains(cmd, "restic init") || !strings.Contains(cmd, "--tag dedupe=off") || !strings.Contains(cmd, "--keep-last 3") {
t.Fatalf("expected backup command to include bootstrap/dedupe/keep-last logic, got %q", cmd)
}
if !strings.Contains(cmd, "--exclude *.tmp") || !strings.Contains(cmd, "--tag nightly") || !strings.Contains(cmd, "--tag prod") {

View File

@ -230,7 +230,7 @@ func backupCommand(cfg *config.Config, req api.BackupRequest) string {
cmd = fmt.Sprintf("%s && %s", cmd, forget)
}
bootstrap := "restic unlock >/dev/null 2>&1 || true; restic snapshots >/dev/null 2>&1 || restic init"
bootstrap := "restic unlock >/dev/null 2>&1 || true; restic cat config >/dev/null 2>&1 || restic init; restic snapshots >/dev/null 2>&1 || restic rebuild-index"
return "set -euo pipefail; " + bootstrap + "; " + cmd
}