Index: head/sysutils/zetaback-devel/Makefile =================================================================== --- head/sysutils/zetaback-devel/Makefile (revision 533780) +++ head/sysutils/zetaback-devel/Makefile (revision 533781) @@ -1,35 +1,35 @@ # Created by: Cy Schubert # $FreeBSD$ PORTNAME= zetaback DISTVERSION= ${ZETABACK_COMMIT_DATE} CATEGORIES= sysutils PKGNAMESUFFIX= -devel HASH= 78d1d082 ZETABACK_COMMIT_DATE= 2020.01.31 MAINTAINER= cy@FreeBSD.org COMMENT= Zetaback ZFS backup and recovery management system USE_GITHUB= yes GH_ACCOUNT= omniti-labs GH_TAGNAME= ${HASH} CONFLICTS= zetaback-1.* LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE OPTIONS_DEFINE= LOCAL BETTER_COMPRESSION -LOCAL_DESC= Avoid ssh for localhoost backup +LOCAL_DESC= Avoid ssh for localhost backup BETTER_COMPRESSION_DESC= Allow different compressions for snapshots LOCAL_EXTRA_PATCHES= ${PATCHDIR}/opt-localhost.in BETTER_COMPRESSION_EXTRA_PATCHES= ${PATCHDIR}/opt-compression.in USES= autoreconf perl5 USE_PERL5= run GNU_CONFIGURE= yes NO_ARCH= yes .include Index: head/sysutils/zetaback-devel/files/opt-compression.in =================================================================== --- head/sysutils/zetaback-devel/files/opt-compression.in (revision 533780) +++ head/sysutils/zetaback-devel/files/opt-compression.in (revision 533781) @@ -1,66 +1,66 @@ --- zetaback.in.orig 2019-01-31 14:04:38.000000000 -0800 +++ zetaback.in 2020-05-02 16:38:22.402137000 -0700 @@ -434,11 +434,15 @@ This value defaults to (14 * 86400), or two weeks. +=item compressionprogram + +Compress files using gzip, bzip2, or xz. Defaults to gzip. + =item compressionlevel -Compress files using gzip at the specified compression level. 0 means no -compression. Accepted values are 1-9. Defaults to 1 (fastest/minimal -compression.) +Compress files using gzip, bzip2, or xz at the specified compression level. +0 means no compression. Accepted values are 1-9. Defaults to 1 +(fastest/minimal compression.) =item ssh_config @@ -781,9 +785,18 @@ # compression is meaningless for dataset backups if ($type ne "s") { + my $cp = config_get($host, 'compressionprogram'); + if ($cp ne "xz" && $cp ne "bzip2" && $cp ne "gzip" && $cp ne "") { + die "zfs_full_backup: unsupported compression program specified\n"; -+ } else ($cp eq "") { ++ } elsif ($cp eq "") { + $cp = "gzip"; + my $cl = 1; + } else { + my $cl = 1; + } my $cl = config_get($host, 'compressionlevel'); if ($cl >= 1 && $cl <= 9) { - open(LBACKUP, "|gzip -$cl >$store/.$dumpname") || + open(LBACKUP, "|$cp -$cl >$store/.$dumpname") || die "zfs_do_backup $host:$fs $type: cannot create dump\n"; } else { open(LBACKUP, ">$store/.$dumpname") || @@ -1319,16 +1332,22 @@ else { $command = "__ZFS__ recv $fs"; } + my $cp = config_get($host, 'compressionprogram'); + if ($cp ne "xz" && $cp ne "bzip2" && $cp ne "gzip" && $cp ne "") { + die "zfs_full_backup: unsupported compression program specified\n"; + } elsif ($cp eq "") { + $cp = "gzip"; + } if ($file) { print " => piping $file to $command\n" if($DEBUG); - print "gzip -dfc $file | ssh $ssh_config $host $command\n" if ($DEBUG && $NEUTERED); + print "$cp -dfc $file | ssh $ssh_config $host $command\n" if ($DEBUG); } elsif ($dataset) { print " => piping $dataset to $command using zfs send\n" if ($DEBUG); print "zfs send $dataset | ssh $ssh_config $host $command\n" if ($DEBUG && $NEUTERED); } unless($NEUTERED) { if ($file) { - open(DUMP, "gzip -dfc $file |"); + open(DUMP, "$cp -dfc $file |"); } elsif ($dataset) { open(DUMP, "__ZFS__ send $dataset |"); }