-
-
Save iAladdin/242ab081a52eacd5845e441312665fec to your computer and use it in GitHub Desktop.
compress encode and split a bulk file to many slices; sh a.sh filePath; sh m.sh filePath-ts-ala;
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/ | |
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 |
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/ | |
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