From d8007ec292b05fbf1c7a570feb30482f520666ad Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Thu, 6 Jul 2017 10:29:19 +0200 Subject: [PATCH] Indent corrections and minor corrections for readability --- zfs_autobackup | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/zfs_autobackup b/zfs_autobackup index e014fc1..e0df2d3 100755 --- a/zfs_autobackup +++ b/zfs_autobackup @@ -443,14 +443,14 @@ for source_filesystem in source_filesystems: latest_target_snapshot=target_snapshots[target_filesystem][-1] if latest_target_snapshot not in source_snapshots[source_filesystem]: - #cant find latest target anymore. find first common snapshot and inform user - error="Cant find latest target snapshot on source, did you destroy it accidently? "+source_filesystem+"@"+latest_target_snapshot - for latest_target_snapshot in reversed(target_snapshots[target_filesystem]): - if latest_target_snapshot in source_snapshots[source_filesystem]: - error=error+"\nYou could solve this by rolling back to: "+target_filesystem+"@"+latest_target_snapshot; - break + #cant find latest target anymore. find first common snapshot and inform user + error="Cant find latest target snapshot on source, did you destroy it accidently? "+source_filesystem+"@"+latest_target_snapshot + for latest_target_snapshot in reversed(target_snapshots[target_filesystem]): + if latest_target_snapshot in source_snapshots[source_filesystem]: + error=error+"\nYou could solve this by rolling back to: "+target_filesystem+"@"+latest_target_snapshot; + break - raise(Exception(error)) + raise(Exception(error)) #send all new source snapshots that come AFTER the last target snapshot latest_source_index=source_snapshots[source_filesystem].index(latest_target_snapshot) @@ -480,8 +480,10 @@ for source_filesystem in source_filesystems: for send_snapshot in send_snapshots: zfs_transfer( - ssh_source=args.ssh_source, source_filesystem=source_filesystem, first_snapshot=latest_target_snapshot, second_snapshot=send_snapshot, - ssh_target=args.ssh_target, target_filesystem=target_filesystem) + ssh_source=args.ssh_source, source_filesystem=source_filesystem, + first_snapshot=latest_target_snapshot, second_snapshot=send_snapshot, + ssh_target=args.ssh_target, target_filesystem=target_filesystem + ) #now that we succesfully transferred this snapshot, the previous snapshot is obsolete: if latest_target_snapshot: