archive script
This commit is contained in:
+18
@@ -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
|
||||
Reference in New Issue
Block a user