Exit non-zero when snapshot create --skip-errors skips anything it cannot read (closes #310)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A backup under --skip-errors printed its skip errors, then "Finished successfully.", and exited 0, so a cron wrapper could not tell it from a complete backup. Each skipped entry, including a directory the walk could not list, is now counted as examined and failed. If --skip-errors skipped anything it could not read or list, the run still keeps its snapshots and prunes as before, then fails with "Backup completed, but N file(s) could not be read". A file removed during the run, even before the walk reaches it, counts once as failed and leaves the exit status alone; without the flag it no longer stops the backup. Excluded entries are never counted. Model: opus-5-5
This commit was merged in pull request #381.
This commit is contained in:
@@ -115,6 +115,13 @@ on Linux), then /etc/vaultik/config.yml.`,
|
||||
return
|
||||
}
|
||||
|
||||
if errors.Is(err, vaultik.ErrFilesUnreadable) {
|
||||
log.Error("Backup completed with unreadable files", "error", err)
|
||||
ReportErrorf("Backup completed, but %v", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
log.Error("Snapshot creation failed", "error", err)
|
||||
ReportErrorf("Snapshot creation failed: %v", err)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user