forked from WGBH/ltoscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecksum_compare
More file actions
34 lines (17 loc) · 739 Bytes
/
Copy pathchecksum_compare
File metadata and controls
34 lines (17 loc) · 739 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
29
30
31
32
33
34
#!/bin/bash
# compare checksums in two directories
# set desired directories
echo "Drag and drop the two directories that you would like to compare and then hit ENTER"
read dir1 dir2
echo "Drag and drop the directory where you would like to save your checksum files"
read dir3
echo "Type in the barcode number of the drive, in the format barcode######"
read barcode
# MD5, ignoring hidden files
cd "$dir1"
find . \( ! -regex '.*/\..*' \) -type f -exec md5 '{}' \; >> "$dir3"/"$barcode"_MD5_Source.csv
cd "$dir2"
find . \( ! -regex '.*/\..*' \) -type f -exec md5 '{}' \; >> "$dir3"/"$barcode"_MD5_Copy.csv
# sort and diff output
cd "$dir3"
diff <(sort "$barcode"_MD5_Source.csv) <(sort "$barcode"_MD5_Copy.csv) > diff.txt