Skip to content

Instantly share code, notes, and snippets.

Last active Aug 9, 2018
What would you like to do?
Remembering the original spirit of BagIt.
# The simplest way to create a valid BagIt bag?
# Usage: <dir_to_bag> <bag_dir>
# Note: you'll need to have md5deep installed:
# brew install md5deep
# apt-get install md5deep
# etc...
mkdir -p $bag_dir/data
cp -a $source_dir $bag_dir/data
cd $bag_dir
md5deep -lr data > manifest-md5.txt
echo "BagIt-Version: 0.97" > bagit.txt
echo "Tag-File-Character-Encoding: UTF-8" >> bagit.txt
today=`date +%Y-%m-%d`
echo "Bagging-Date: $today" > bag-info.txt
echo "External-Description: This bag was created by $USER on $today." >> bag-info.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment