View | Details | Raw Unified | Return to bug 246132 | Differences between
and this patch

Collapse All | Expand All

(-)b/sysutils/zetaback/Makefile (-5 / +10 lines)
Lines 2-21 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	zetaback
4
PORTNAME=	zetaback
5
PORTVERSION=	1.0.7
5
DISTVERSION=	1.0.7
6
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
7
MASTER_SITES=	http://mirrors.omniti.com/zetaback/
8
7
9
MAINTAINER=	cy@FreeBSD.org
8
MAINTAINER=	cy@FreeBSD.org
10
COMMENT=	Zetaback ZFS backup and recovery management system
9
COMMENT=	Zetaback ZFS backup and recovery management system
11
10
12
BROKEN=		unfetchable
11
USE_GITHUB=	yes
13
DEPRECATED=	Broken for more than 6 months
12
GH_ACCOUNT=	omniti-labs
14
EXPIRATION_DATE=	2020-05-05
15
13
16
LICENSE=	BSD3CLAUSE
14
LICENSE=	BSD3CLAUSE
17
LICENSE_FILE=	${WRKSRC}/LICENSE
15
LICENSE_FILE=	${WRKSRC}/LICENSE
18
16
17
OPTIONS_DEFINE=	LOCAL BETTER_COMPRESSION
18
LOCAL_DESC=	Avoid ssh for localhoost backup
19
BETTER_COMPRESSION_DESC=	Allow different compressions for snapshots
20
21
LOCAL_EXTRA_PATCHES=	${PATCHDIR}/opt-localhost.in
22
BETTER_COMPRESSION_EXTRA_PATCHES=	${PATCHDIR}/opt-compression.in
23
19
USES=		autoreconf perl5
24
USES=		autoreconf perl5
20
USE_PERL5=	run
25
USE_PERL5=	run
21
GNU_CONFIGURE=	yes
26
GNU_CONFIGURE=	yes
(-)b/sysutils/zetaback/distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (zetaback-1.0.7.tar.gz) = e4bad4bb4a0149d44e5ae6022519b2927e4c0b5a0da465d47b4e66d707270270
1
TIMESTAMP = 1588467175
2
SIZE (zetaback-1.0.7.tar.gz) = 49934
2
SHA256 (omniti-labs-zetaback-1.0.7_GH0.tar.gz) = b10c6df2b27d823f5fc18e4c7c8460e8231a86d32d89f9c73a916a7b15f98888
3
SIZE (omniti-labs-zetaback-1.0.7_GH0.tar.gz) = 25592
(-)b/sysutils/zetaback/files/opt-compression.in (+66 lines)
Added Link Here
1
--- zetaback.in.orig	2019-01-31 14:04:38.000000000 -0800
2
+++ zetaback.in	2020-05-02 16:38:22.402137000 -0700
3
@@ -434,11 +434,15 @@
4
 
5
 This value defaults to (14 * 86400), or two weeks.
6
 
7
+=item compressionprogram
8
+
9
+Compress files using gzip, bzip2, or xz. Defaults to gzip.
10
+
11
 =item compressionlevel
12
 
13
-Compress files using gzip at the specified compression level. 0 means no
14
-compression. Accepted values are 1-9. Defaults to 1 (fastest/minimal
15
-compression.)
16
+Compress files using gzip, bzip2, or xz at the specified compression level.
17
+0 means no compression. Accepted values are 1-9. Defaults to 1
18
+(fastest/minimal compression.)
19
 
20
 =item ssh_config
21
 
22
@@ -781,9 +785,18 @@
23
 
24
   # compression is meaningless for dataset backups
25
   if ($type ne "s") {
26
+    my $cp = config_get($host, 'compressionprogram');
27
+    if ($cp ne "xz" && $cp ne "bzip2" && $cp ne "gzip" && $cp ne "") {
28
+	die "zfs_full_backup: unsupported compression program specified\n";
29
+    } else ($cp eq "") {
30
+	$cp = "gzip";
31
+	my $cl = 1;
32
+    } else {
33
+	my $cl = 1;
34
+    }
35
     my $cl = config_get($host, 'compressionlevel');
36
     if ($cl >= 1 && $cl <= 9) {
37
-        open(LBACKUP, "|gzip -$cl >$store/.$dumpname") ||
38
+        open(LBACKUP, "|$cp -$cl >$store/.$dumpname") ||
39
         die "zfs_do_backup $host:$fs $type: cannot create dump\n";
40
     } else {
41
         open(LBACKUP, ">$store/.$dumpname") ||
42
@@ -1319,16 +1332,22 @@
43
   else {
44
     $command = "__ZFS__ recv $fs";
45
   }
46
+  my $cp = config_get($host, 'compressionprogram');
47
+  if ($cp ne "xz" && $cp ne "bzip2" && $cp ne "gzip" && $cp ne "") {
48
+      die "zfs_full_backup: unsupported compression program specified\n";
49
+  } elsif ($cp eq "") {
50
+      $cp = "gzip";
51
+  }
52
   if ($file) {
53
     print " => piping $file to $command\n" if($DEBUG);
54
-    print "gzip -dfc $file | ssh $ssh_config $host $command\n" if ($DEBUG && $NEUTERED);
55
+    print "$cp -dfc $file | ssh $ssh_config $host $command\n" if ($DEBUG);
56
   } elsif ($dataset) {
57
     print " => piping $dataset to $command using zfs send\n" if ($DEBUG);
58
     print "zfs send $dataset | ssh $ssh_config $host $command\n" if ($DEBUG && $NEUTERED);
59
   }
60
   unless($NEUTERED) {
61
     if ($file) {
62
-      open(DUMP, "gzip -dfc $file |");
63
+      open(DUMP, "$cp -dfc $file |");
64
     } elsif ($dataset) {
65
       open(DUMP, "__ZFS__ send $dataset |");
66
     }
(-)b/sysutils/zetaback/files/opt-localhost.in (+56 lines)
Added Link Here
1
--- zetaback.in.orig	2020-05-02 21:18:03 UTC
2
+++ zetaback.in
3
@@ -769,7 +769,11 @@ sub zfs_remove_snap($$$) {
4
   }
5
   return unless($snap);
6
   print "Dropping $snap on $fs\n" if($DEBUG);
7
-  `ssh $ssh_config $host $agent -z $fs -d $snap`;
8
+  if ($host eq "localhost") {
9
+      `$agent -z $fs -d $snap`;
10
+  } else {
11
+      `ssh $ssh_config $host $agent -z $fs -d $snap`;
12
+  }
13
 }
14
 
15
 # Lots of args.. internally called.
16
@@ -832,7 +836,12 @@ sub zfs_do_backup($$$$$$;$) {
17
       die "Child exit value: $ev" if ($ev);
18
     }
19
     else {
20
-      my @cmd = ('ssh', split(/ /, $ssh_config), $host, $agent, '-z', $fs);
21
+      my @cmd;
22
+      if ($host eq "localhost") {
23
+         @cmd = ($agent, '-z', $fs);
24
+      } else  {
25
+         @cmd = ('ssh', split(/ /, $ssh_config), $host, $agent, '-z', $fs);
26
+      }
27
       if ($type eq "i" || ($type eq "s" && $base)) {
28
         push @cmd, ("-i", $base);
29
       }
30
@@ -1346,7 +1359,11 @@ sub zfs_restore_part($$$$;$) {
31
       open(DUMP, "__ZFS__ send $dataset |");
32
     }
33
     eval {
34
-      open(RECEIVER, "| ssh $ssh_config $host $command");
35
+      if ($host eq "localhost") {
36
+	  open(RECEIVER, "| $command");
37
+      } else {
38
+	  open(RECEIVER, "| ssh $ssh_config $host $command");
39
+      }
40
       my $buffer;
41
       while(my $len = sysread(DUMP, $buffer, $BLOCKSIZE)) {
42
         if(syswrite(RECEIVER, $buffer, $len) != $len) {
43
@@ -1573,7 +1590,12 @@ sub plan_and_run($$) {
44
     # Get list of zfs filesystems from the agent
45
     open(SILENT, ">&", \*STDERR);
46
     close(STDERR);
47
-    my $rv = open(ZFSLIST, "ssh $ssh_config $host $agent -l |");
48
+    my $rv;
49
+    if ($host eq "localhost") {
50
+      $rv = open(ZFSLIST, "$agent -l |");
51
+    } else {
52
+      $rv = open(ZFSLIST, "ssh $ssh_config $host $agent -l |");
53
+    }
54
     open(STDERR, ">&", \*SILENT);
55
     close(SILENT);
56
     next unless $rv;
(-)b/sysutils/zetaback/files/patch-zetaback.in (+11 lines)
Added Link Here
1
--- zetaback.in.orig	2019-01-31 22:04:38 UTC
2
+++ zetaback.in
3
@@ -1585,7 +1585,7 @@ sub plan_and_run($$) {
4
 
5
     foreach my $diskline (@disklist) {
6
       chomp($diskline);
7
-      next unless($diskline =~ /^(\S+) \[([^\]]*)\](?: {([^}]*)})?/);
8
+      next unless($diskline =~ /^(\S+) \[([^\]]*)\](?: \{([^}]*)\})?/);
9
       my $diskname = $1;
10
       my %snaps;
11
       map { $snaps{$_} = 1 } (split(/,/, $2));

Return to bug 246132