Created
April 7, 2022 07:02
-
-
Save SaicharanKandukuri/c867945c0542337d6c16eb8da3fb701a to your computer and use it in GitHub Desktop.
A Script for compressing folders with lz4
This file contains 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
#!/usr/bin/env bash | |
# Usage: bash clz.sh foldername filenametocompress | |
target=$2 | |
target_source=$1 | |
tar \ | |
--exclude="${target_source}"${0} \ | |
--exclude="${target_source}${target}.tar.lz" \ | |
--exclude-caches-all \ | |
-cpf \ | |
- "${target_source}" -P \ | |
| pv -s $(($(du -skx "${target_source}" | awk '{print $1}') * 1024)) |\ | |
lz4 -9 > "${target}".tar.lz # use high compression |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment