From ecf2a852b5e0fa54131c878597c9b24cffb8a663 Mon Sep 17 00:00:00 2001 From: danielewood Date: Thu, 12 Apr 2018 17:43:08 -0700 Subject: [PATCH] Added support for ZStandard compression. Available in all major distros with a simple yum/apt-get/pkg. References: ZSTD Compression by Allan Jude - https://www.youtube.com/watch?v=hWnWEitDPlM Zstandard - https://facebook.github.io/zstd/ --- syncoid | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/syncoid b/syncoid index 7337f5b..baf5053 100755 --- a/syncoid +++ b/syncoid @@ -368,6 +368,18 @@ sub compressargset { decomrawcmd => '/usr/bin/pigz', decomargs => '-dc', }, + 'zstd-fast' => { + rawcmd => '/usr/bin/zstd', + args => '-3', + decomrawcmd => '/usr/bin/zstd', + decomargs => '-dc', + }, + 'zstd-slow' => { + rawcmd => '/usr/bin/zstd', + args => '-19', + decomrawcmd => '/usr/bin/zstd', + decomargs => '-dc', + }, 'lzo' => { rawcmd => '/usr/bin/lzop', args => '', @@ -378,7 +390,7 @@ sub compressargset { if ($value eq 'default') { $value = $DEFAULT_COMPRESSION; - } elsif (!(grep $value eq $_, ('gzip', 'pigz-fast', 'pigz-slow', 'lzo', 'default', 'none'))) { + } elsif (!(grep $value eq $_, ('gzip', 'pigz-fast', 'pigz-slow', 'zstd-fast', 'zstd-slow', 'lzo', 'default', 'none'))) { warn "Unrecognised compression value $value, defaulting to $DEFAULT_COMPRESSION"; $value = $DEFAULT_COMPRESSION; }