Skip to content

Instantly share code, notes, and snippets.

@troutowicz
Created January 27, 2015 20:58
Show Gist options
  • Save troutowicz/8daf08889c65b6554611 to your computer and use it in GitHub Desktop.
Save troutowicz/8daf08889c65b6554611 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# tar wrapper that additionally creates a file of md5sums
#
# http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/
#
dest=$1
src=$2
tar -czvf "$dest.tar.gz" $src \
| xargs -I '{}' sh -c "test -f '{}' && md5sum '{}'" \
> "$dest.md5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment