forked from WGBH/ltoscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAA_LTO_checksum_update
More file actions
28 lines (24 loc) · 905 Bytes
/
Copy pathAA_LTO_checksum_update
File metadata and controls
28 lines (24 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# AA_LTO_checksum.sh
#
#
# Created by MLA User on 1/7/15.
# This script only generates a list of checksums for transferred files, and assumes that AA_PBCorescript has been run to generate checksums for the original files
echo "Drag and drop the directory where you would like to save your checksum files"
read dir
echo "Type in the barcode number of the drive, in the format barcode######"
read barcode
echo "Drag and drop the directory for the drive on the LTO tape"
read folder
for d in $(find "$folder" \( ! -regex '.*/\..*' \) ! -path . -type d); do
cd $d
if ls | grep *.xml; then
file=$( find . \( ! -regex '.*/\..*' \) ! -path . -type f -not -name *.xml )
i=$( echo "$file" | cut -d '/' -f 2 )
c=$(md5 -q "$i")
printf '%s\n' "MD5 ("$i") = $c" >> "$dir"/"$barcode"_MD5_Copy.csv
cd "$folder"
else
cd "$folder"
fi
done