Add support for zstd backups via tzst extension.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-12-12 21:37:13 -06:00
parent a4bd63df49
commit 28de7fdf86
No known key found for this signature in database
GPG Key ID: 9FC8B9E008872109
4 changed files with 38 additions and 0 deletions

View File

@ -135,6 +135,23 @@ class BackupCommand extends CommandAbstract
);
switch ($file_ext) {
case 'tzst':
$this->passThruProcess(
$io,
array_merge(
[
'tar',
'-I',
'zstd',
'-cf',
$tmpPath,
],
$files_to_backup
),
'/'
);
break;
case 'gz':
case 'tgz':
$this->passThruProcess(

View File

@ -43,6 +43,20 @@ class RestoreCommand extends CommandAbstract
$file_ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
switch ($file_ext) {
case 'tzst':
$this->passThruProcess(
$io,
[
'tar',
'-I',
'unzstd',
'-xvf',
$path,
],
'/'
);
break;
case 'gz':
case 'tgz':
$this->passThruProcess(

View File

@ -45,6 +45,7 @@
- gzip
- zip
- unzip
- zstd
- name: Install Focal Packages (20.04)
apt:

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
source /bd_build/buildconfig
set -x
$minimal_apt_get_install zstd