[Zetaback-devel] [zetaback commit] Zetaback branch, sendr, updated. 83ae1614330bbd92ad6939d0dc454442cebb5d94

git at labs.omniti.com git at labs.omniti.com
Mon Jun 13 12:32:53 EDT 2011


Pushed by: mark
The branch, sendr has been updated
       via  83ae1614330bbd92ad6939d0dc454442cebb5d94 (commit)
      from  ff3354c6ecfa942593f762298b324d83b8388073 (commit)

Summary of changes:
 zetaback.in |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

Log:
commit 83ae1614330bbd92ad6939d0dc454442cebb5d94
Author: Mark Harrison <mark at mivok.net>
Date:   Mon Jun 13 12:19:30 2011 -0400

    Fix location and contents of in-progress file
    
     * Put the location in the base store directory (no hostname)
       to make it more consistent
     * Include the snapshot name as well as the filesystem name

diff --git a/zetaback.in b/zetaback.in
index e99066c..5f15374 100755
--- a/zetaback.in
+++ b/zetaback.in
@@ -658,6 +658,8 @@ sub zfs_remove_snap($$$) {
 sub zfs_do_backup($$$$$$;$) {
   my ($host, $fs, $type, $point, $store, $dumpname, $base) = @_;
   my ($storefs, $fsname);
+  my $basestore = config_get($host, 'store');
+  $basestore =~ s/\/?%h//g;
   my $agent = config_get($host, 'agent');
   my $ssh_config = config_get($host, 'ssh_config');
   my $DEBUGLOG="2>>/tmp/zetaback_command_output" if ($DEBUG);
@@ -686,13 +688,15 @@ sub zfs_do_backup($$$$$$;$) {
     if ($@) {
       # The zfs filesystem doesn't exist, so we have to work out what it
       # would be
-      my $basestore = config_get($host, 'store');
-      $basestore =~ s/\/?%h//g;
       $storefs = get_fs_from_mountpoint($basestore);
       $storefs="$storefs/$host";
     }
     my $recvopt = "";
     $fsname = $dumpname;
+    # Store the name of the currently transferring snapshot in a file
+    open(CURRENT, ">$basestore/zetaback.in-progress");
+    print CURRENT "$storefs/$fsname\n";
+    close(CURRENT);
     if (config_get($host, 'dataset_recursive') == 1) {
       $recvopt = "-u -d";
       $fsname =~ s/@.*$//;
@@ -701,10 +705,6 @@ sub zfs_do_backup($$$$$$;$) {
     }
     print STDERR "Receiving to zfs filesystem $storefs/$fsname\n"
       if($DEBUG);
-    # Store the name of the currently transferring snapshot in a file
-    open(CURRENT, ">$store/zetaback.in-progress");
-    print CURRENT "$storefs/$fsname\n";
-    close(CURRENT);
     if (config_get($host, 'dataset_recursive') == 1) {
       # We need to create filesystems as deep as the poolname and receive to
       # that in order to preserve the exact layout
@@ -811,10 +811,10 @@ sub zfs_do_backup($$$$$$;$) {
     chomp(my $error = $@);
     $error =~ s/[\r\n]+/ /gsm;
     zetaback_log($host, "FAILED[$error] $host:$fs $type\n");
-    unlink("$store/zetaback.in-progress");
+    unlink("$basestore/zetaback.in-progress");
     die "zfs_full_backup: failed $@";
   }
-  unlink("$store/zetaback.in-progress");
+  unlink("$basestore/zetaback.in-progress");
   my $size;
   if ($type ne "s") {
     my @st = stat("$store/$dumpname");




hooks/post-receive
-- 
Zetaback


More information about the Zetaback-devel mailing list