-
Notifications
You must be signed in to change notification settings - Fork 0
/
NLoW_V1.3.sh
executable file
·64 lines (49 loc) · 1.9 KB
/
NLoW_V1.3.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
echo "BlackPearl Tape Verify Script, used to verify a generation of tapes in a bucket"
echo "Enter name of environmental setup file and extension Example: setup.sh"
read setup_file
echo "Type in Bucket to Verify"
read bucket_name
echo "Enter generation you want to verify.....Example: L7"
read gen
echo "Now working on this bucket and finding all tapes, excluding all other generations other than the one you asked for.....Standby please"
source $setup_file
./ds3_java_cli -c get_tapes -b $bucket_name --http --output-format json > output.json
grep '"BarCode"\|"LastVerified\|"VerifyPending"' output.json | tr -d '"BarCode" : , astVerified, VerifyPeding' > barcode.txt
if [ -s barcode.txt ]; then
echo "Finding what tapes need to be verified"
IFS=$'\n' read -d '' -r -a lines < barcode.txt
vfy_null=1
vfy_low=2
tape=0
rm tapes_to_verify.txt
for (( j=0; j<${#lines[@]}; j++ ));
do
echo ${lines[@]} >> output.txt
if [[ ${lines[vfy_null]} == "Lull" && ${lines[vfy_low]} == "ull" ]]; then
# echo ${lines[$tape]}
# echo ${lines[@]}
echo ${lines[$tape]} >> tapes_to_verify.txt
fi
vfy_null=$((vfy_null+3))
vfy_low=$((vfy_low+3))
tape=$((tape+3))
done
if [ -s tapes_to_verify.txt ]; then
echo "Removing all other generation of tapes from list"
grep "$gen" tapes_to_verify.txt > sorted_tapes_to_verify.txt
if [ -s sorted_tapes_to_verify.txt ]; then
for i in $(cat ./sorted_tapes_to_verify.txt);
do
echo "Sending verify jobs now"
#sh ./ds3_java_cli -c verify_tape -i $i --http
#echo $i
done
else
echo "No tapes identified as needing a verify"
fi
else
echo "No tapes identified as needing a verify"
fi
else
echo "No file found"
fi