Make sure there is not a lock when we start a backup
This commit is contained in:
parent
f45801cf76
commit
7f4ef3c94c
@ -37,7 +37,11 @@ func init() {
|
||||
|
||||
func checkRepo(repo string) error {
|
||||
log := logger.WithValues("backup-checkrepo", repo)
|
||||
cmd := exec.Command(resticExec, "check", "-r", repo)
|
||||
cmd := exec.Command(resticExec, "unlock", "-r", repo)
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err, "unable to unlock repo", "repo", repo)
|
||||
}
|
||||
cmd = exec.Command(resticExec, "check", "-r", repo)
|
||||
output, err := cmd.CombinedOutput()
|
||||
log.V(1).Info("restic check output", "output", string(output))
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user