-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathes_diff.sh
More file actions
executable file
·44 lines (34 loc) · 907 Bytes
/
es_diff.sh
File metadata and controls
executable file
·44 lines (34 loc) · 907 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
35
36
37
38
39
40
41
42
#!/bin/bash
# compares the output folders created by get_es_stats.sh
#
# Run the script: ./get_es_stats dev
# Run it again for the other cluster you want to compare against: ./get_es_stats qa
#
# Compare both clusters: ./es_diff.sh dev qa
#
# variables
OUTPUT=./output
# init styles
bold=$(tput bold)
normal=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 2)
# newline
printf "$normal \n"
# stop if the number of arguments does not equal 2
if (($# != 2)); then
printf "There must be only two arguments.\n"
exit
fi
# check if data about the first cluster to be compared exist
if ! test -d "$OUTPUT/$1"; then
printf "No data for $red $1.\n$normal"
exit
fi
# check if data about the second cluster to be compared exist
if ! test -d "$OUTPUT/$2"; then
printf "No data for $red $2.\n$normal"
exit
fi
# diff all directories recursively
diff -ry --suppress-common-lines $OUTPUT/$1 $OUTPUT/$2