Created
January 31, 2016 23:37
-
-
Save LazerPanther/bd0a1360ce40071860a3 to your computer and use it in GitHub Desktop.
A somewhat unnecessary script used to compress a folder into a 7zip archive with "ultra" settings.
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
#!/bin/sh +x | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "1 argument required, $# provided" | |
[ -e "$1" ] || die "$1 does not exist" | |
_cwd=`pwd` | |
_file=$( basename "$1" ) | |
_ext=${_file##*.} | |
_shortname=$( basename "$_file" .$_ext ) | |
_workdir=${_tmp} | |
echo "Compressing files..." | |
7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=64m -ms=on "${_shortname}.7z" "$_shortname/" | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment