Created
March 17, 2014 19:57
-
-
Save PhirePhly/9606989 to your computer and use it in GitHub Desktop.
breakapart.sh
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/bash | |
ls keys/ >keylist.txt | |
seq 10 99 | | |
while read KEYSUFFIX; do | |
mkdir -p chunks/keys.$KEYSUFFIX | |
grep -e "$KEYSUFFIX\.key" keylist.txt | | |
while read KEYFILE; do | |
mv keys/$KEYFILE chunks/keys.$KEYSUFFIX/ | |
done | |
tar cfa chunks/`hostname`.keys.$KEYSUFFIX.tar chunks/keys.$KEYSUFFIX/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment