From 29078b7c04c67e75513e16ee1df9118a3114f690 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Tue, 29 Oct 2019 00:32:55 +0100 Subject: [PATCH] tips in case of missing last target snapshot on source --- zfs_autobackup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zfs_autobackup b/zfs_autobackup index 03ae0e1..9706dc1 100755 --- a/zfs_autobackup +++ b/zfs_autobackup @@ -974,7 +974,14 @@ class ZfsDataset(): snapshot=self.find_snapshot(target_dataset.our_snapshots[-1].snapshot_name) if not snapshot: - raise(Exception("Cant find latest target snapshot on source")) + #try to find another common snapshot as rollback-suggestion for admin + for target_snapshot in reversed(target_dataset.our_snapshots): + if self.find_snapshot(target_snapshot): + target_snapshot.error("Latest common snapshot, roll back to this.") + raise(Exception("Cant find latest target snapshot on source.")) + target_dataset.error("Cant find common snapshot with target. ") + raise(Exception("You probablly need to delete the target dataset to fix this.")) + snapshot.debug("common snapshot")