[Zetaback-devel] [zetaback commit] r98 - branches/replay

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Tue Jun 16 17:48:59 EDT 2009


Author: mark
Date: 2009-06-16 17:48:59 -0400 (Tue, 16 Jun 2009)
New Revision: 98

Modified:
   branches/replay/zetaback.in
   branches/replay/zetaback_agent.in
Log:
More work linking the two scripts together

Modified: branches/replay/zetaback.in
===================================================================
--- branches/replay/zetaback.in	2009-06-16 14:17:29 UTC (rev 97)
+++ branches/replay/zetaback.in	2009-06-16 21:48:59 UTC (rev 98)
@@ -553,8 +553,8 @@
 }
 
 # Lots of args.. internally called.
-sub zfs_do_backup($$$$$$) {
-  my ($host, $fs, $type, $point, $store, $dumpname) = @_;
+sub zfs_do_backup($$$$$$;$) {
+  my ($host, $fs, $type, $point, $store, $dumpname, $base) = @_;
   my $agent = config_get($host, 'agent');
   my $ssh_config = config_get($host, 'ssh_config');
   $ssh_config = "-F $ssh_config" if($ssh_config);
@@ -580,7 +580,13 @@
       die "error: $?" if($?);
     }
     else {
-      my @cmd = ('ssh', split(/ /, $ssh_config), $host, $agent, '-z', $fs, "-$type", $point);
+      my @cmd = ('ssh', split(/ /, $ssh_config), $host, $agent, '-z', $fs)
+      if ($type eq "i" || $type eq "s") {
+        push @cmd ("-i", $base);
+      }
+      if ($type eq "f" || $type eq "s") {
+        push @cmd ("-$type", $point);
+      }
       open STDIN, "/dev/null" || exit(-1);
       if ($type eq "s") {
         my $storefs = get_fs_from_mountpoint($store);
@@ -634,7 +640,7 @@
   my $efs = dir_encode($fs);
   my $dumpname = "$point.$efs.incremental.$base";
 
-  zfs_do_backup($host, $fs, 'i', $base, $store, $dumpname);
+  zfs_do_backup($host, $fs, 'i', $point, $store, $dumpname, $base);
 }
 
 sub zfs_dataset_backup($$$$) {
@@ -644,7 +650,7 @@
   my $point = time();
   my $dumpname = "$host/$fs\@$point";
 
-  zfs_do_backup($host, $fs, 's', $base, $store, $dumpname);
+  zfs_do_backup($host, $fs, 's', $point, $store, $dumpname, $base);
 }
 
 sub perform_retention($$) {

Modified: branches/replay/zetaback_agent.in
===================================================================
--- branches/replay/zetaback_agent.in	2009-06-16 14:17:29 UTC (rev 97)
+++ branches/replay/zetaback_agent.in	2009-06-16 21:48:59 UTC (rev 98)
@@ -90,7 +90,8 @@
 =item -s <timestamp>
 
 Perform a dataset backup.  The name of the backup will include 
-<timestamp>, which is provided by the backup server.
+<timestamp>, which is provided by the backup server. This requires the -i
+option to specify the base dataset the expected by the backup server.
 
 =item -l
 
@@ -317,8 +318,8 @@
 if($ZFS && $SNAP) { zfs_agent_remove_snap(); exit; }
 if($ZFS && $RESTORE) { zfs_agent_perform_restore(); exit; }
 if($ZFS && $FULL) { zfs_agent_perform_full(); exit; }
+if($ZFS && $DSET && $BASE) { zfs_agent_perform_dataset(); exit; }
 if($ZFS && $BASE) { zfs_agent_perform_incremental(); exit; }
-if($ZFS && $DSET) { zfs_agent_perform_dataset(); exit; }
 
 =pod
 



More information about the Zetaback-devel mailing list