pbs-client: add 'create_tar' helper function

similar to create_zip, uses an accessor to write a tar into an output
that implements AsyncWrite, but we use a Decoder to iterate instead
of having a recursive function. This is done so that we get the
entries in the correct order, and it should be faster as well.

Includes files, directories, symlinks, hardlink, block/char devs, fifos
into the tar. If the hardlink points to outside the current dir to
archive, promote the first instance to a 'real' file, and use a
hardlink for the rest.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak
2022-04-12 13:04:16 +02:00
committed by Wolfgang Bumiller
parent 99f09fd3c1
commit 23af572d3f
3 changed files with 211 additions and 3 deletions

View File

@ -28,6 +28,7 @@ tokio = { version = "1.6", features = [ "fs", "signal" ] }
tokio-stream = "0.1.0"
tower-service = "0.3.0"
xdg = "2.2"
tar = "0.4"
pathpatterns = "0.1.2"