Skip to content

Instantly share code, notes, and snippets.

@TaylorBurnham
Created May 10, 2021 12:25
Show Gist options
  • Save TaylorBurnham/ccaeffe8a9caede93d094852d9e75f02 to your computer and use it in GitHub Desktop.
Save TaylorBurnham/ccaeffe8a9caede93d094852d9e75f02 to your computer and use it in GitHub Desktop.
Tar a directory with progress using pv and split it.
#!/bin/bash
INPUT=$1
cat "${INPUT}*.gz_*" | gzip - -d | tar xfv -
#!/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