Skip to content

Instantly share code, notes, and snippets.

@iAladdin
Created May 22, 2020
Embed
What would you like to do?
compress encode and split a bulk file to many slices; sh a.sh filePath; sh m.sh filePath-ts-ala;
#!/bin/
name=$1
if [[ -n "$name" ]]; then
target="$( date +%s )"
encTarget="$name-$target.ala"
splitTargetPrefix="$name-$target.ala-"
tar -czvf $target $name
openssl des -in $target -out $encTarget
rm -rf $target
#25MB
split -b 25000000 $encTarget $splitTargetPrefix
printf '%s*' $splitTargetPrefix | md5
else
echo "argument error"
fi
#!/bin/
name=$1
if [[ -n "$name" ]]; then
target="$name"
dencTarget="$name.tar.gz"
openssl des -d -in $target -out $dencTarget
tar -xzvf $dencTarget
rm -rf $dencTarget
rm -rf "$name"*
else
echo "argument error"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment