Skip to main content

snapshot_skipped_unchanged

Function snapshot_skipped_unchanged 

Source
pub fn snapshot_skipped_unchanged(stderr: &str) -> bool
Expand description

Whether a successful (exit 0) snapshot create that produced no JSON on stdout was kopia deliberately declining to write a manifest because the source is byte-identical to the previous snapshot.

kopia’s message is:

 Not saving snapshot because no files have been changed since previous snapshot

This is gated by the retention-policy knob ignoreIdenticalSnapshots (*OptionalBool, kopia default false). With it on, snapshot create --json exits 0, writes nothing to stdout, and says why only on stderr — which read as a hard EmptyOutput failure and terminally failed the Snapshot CR (#351).

Matched on the stable middle of the sentence rather than the whole string: kopia prefixes it with a leading space and has reworded the surrounding phrasing across releases, but “no files have been changed” has been constant. Case-insensitive for the same reason.

use kopiur_kopia::snapshot_skipped_unchanged;
assert!(snapshot_skipped_unchanged(
    " Not saving snapshot because no files have been changed since previous snapshot"
));
assert!(!snapshot_skipped_unchanged("Snapshotting app@host:/pvc/data ..."));
assert!(!snapshot_skipped_unchanged(""));