Created
May 10, 2021 12:25
-
-
Save TaylorBurnham/ccaeffe8a9caede93d094852d9e75f02 to your computer and use it in GitHub Desktop.
Tar a directory with progress using pv and split it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INPUT=$1 | |
cat "${INPUT}*.gz_*" | gzip - -d | tar xfv - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INPUT=$1 | |
OUTPUT=$2 | |
SIZE="512MiB" | |
tar pcf - "${INPUT}" | pv -s $(du -sb "${INPUT}" | awk '{print $1}') | gzip - | split -d -a 5 -b "${SIZE}" - "${OUTPUT}.tar.gz_" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment