Last active
August 29, 2015 14:00
-
-
Save naftulikay/11244323 to your computer and use it in GitHub Desktop.
Create Signatures and Checksums for Multiple Files at Once
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/bash | |
# needs: apt-get install gnupg parallel | |
# for mybackup.tar.gz.aa, mybackup.tar.gz.ab, etc. | |
find . -maxdepth 1 -type f -iname "mybackup.tar.gz.??" | parallel --gnu \ | |
-j 8 --workdir "$PWD" ' | |
gpg --armor --detach-sig "{}" ; | |
echo -n "$(shasum "{}" | cut -b 1-40)" > "{}.sha" ; | |
echo -n "$(md5sum "{}" | cut -b 1-32)" > "{}.md5" ; | |
' | |
# using 8 workers, generate signatures and checksums for all found files above. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment