From 381e9d8d8717e5b2111bf6b785a5350a13e762ce Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 24 Jun 2014 19:26:09 +0200 Subject: [PATCH 1/2] Fixing zetaback erroring out after something touched the receiving filesystem --- zetaback.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zetaback.in b/zetaback.in index 0342e46..75c2480 100755 --- a/zetaback.in +++ b/zetaback.in @@ -798,7 +798,7 @@ sub zfs_do_backup($$$$$$;$) { print STDERR "Receiving to zfs filesystem $storefs/$encodedname\n" if($DEBUG); zfs_create_intermediate_filesystems("$storefs/$encodedname"); - open(LBACKUP, "|__ZFS__ recv $storefs/$encodedname"); + open(LBACKUP, "|__ZFS__ recv -F $storefs/$encodedname"); } # Do it. yeah. eval { @@ -1304,7 +1304,7 @@ sub zfs_restore_part($$$$;$) { $command .= " -b $dep" if($dep); } else { - $command = "__ZFS__ recv $fs"; + $command = "__ZFS__ recv -F $fs"; } if ($file) { print " => piping $file to $command\n" if($DEBUG); From be9e16d4cf09901371feb736ff69cfa27c38b877 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 24 Jun 2014 20:16:36 +0200 Subject: [PATCH 2/2] Fixing locking on dir not working in all cases --- zetaback.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zetaback.in b/zetaback.in index 75c2480..6b2b5ab 100755 --- a/zetaback.in +++ b/zetaback.in @@ -1630,7 +1630,7 @@ sub plan_and_run($$) { # We need to drop a __zb_base snap or a __zb_incr snap before we proceed unless($NEUTERED || $backup_type eq 'no') { # attempt to lock this action, if it fails, skip -- someone else is working it. - next unless(lock($host, dir_encode($diskname), 1)); + next unless(lock($host, dir_encode($diskname) . ".lock", 1)); unlock($host, '.list'); if($backup_type eq 'full') { @@ -1677,7 +1677,7 @@ sub plan_and_run($$) { } $took_action = 1; } - unlock($host, dir_encode($diskname), 1); + unlock($host, dir_encode($diskname) . ".lock", 1); } $suppress{"$host:$diskname"} = 1; last if($took_action);