diff --git a/archive.sh b/archive.sh new file mode 100644 index 0000000..0ebbd0f --- /dev/null +++ b/archive.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +BUILD_DIR=.build +ARCHIVE_DIR=Archive + +MYNAME=RobertFry +STAMP=$(date +"%Y-%m-%d.%H%M%S") + +for filepath in $BUILD_DIR/*.pdf; +do + printf "%s\n" "Archiving $filepath..." + + file=${filepath##*/} + name=$(echo "${file%.*}" | perl -pe 's/(^|[_\s])([a-z])/\U$2/g') + + cp $filepath $ARCHIVE_DIR/$MYNAME.$name.$STAMP.pdf + cp -f $filepath $ARCHIVE_DIR/$MYNAME.$name.pdf +done