Skip to content

Instantly share code, notes, and snippets.

@PhirePhly
Created March 17, 2014 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhirePhly/9606989 to your computer and use it in GitHub Desktop.
Save PhirePhly/9606989 to your computer and use it in GitHub Desktop.
breakapart.sh
#!/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