Skip to content

Commit

Permalink
only snapshot on agents
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Dec 8, 2024
1 parent de3a444 commit 5694e14
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions internal/backend/backup/jobrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,23 @@ func RunBackup(job *store.Job, storeInstance *store.Store, waitChan chan struct{

_ = FixDatastore(job, storeInstance)

snapOk, err := storeInstance.AgentSnapshot(target)
if err != nil {
if agentMount != nil {
agentMount.Unmount()
if isAgent {
snapOk, err := storeInstance.AgentSnapshot(target)
if err != nil {
if agentMount != nil {
agentMount.Unmount()
}
cancel()
return nil, fmt.Errorf("RunBackup: agent snapshot error -> %w", err)
}
cancel()
return nil, fmt.Errorf("RunBackup: agent snapshot error -> %w", err)
}

if !snapOk {
if agentMount != nil {
agentMount.Unmount()
if !snapOk {
if agentMount != nil {
agentMount.Unmount()
}
cancel()
return nil, fmt.Errorf("RunBackup: agent snapshot error")
}
cancel()
return nil, fmt.Errorf("RunBackup: agent snapshot error")
}

cmd := exec.Command("/usr/bin/proxmox-backup-client", cmdArgs...)
Expand Down

0 comments on commit 5694e14

Please sign in to comment.