-
Notifications
You must be signed in to change notification settings - Fork 3
/
logCollector.sh
executable file
·69 lines (48 loc) · 2.58 KB
/
logCollector.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
65
66
67
68
#!/bin/bash
echo "Start $0"
if [[ -f ~/build/bin/settings.sh ]]
then
echo "source settings.sh..."
. ~/build/bin/settings.sh
else
echo "File: '~/build/bin/settings.sh' not found. Exit."
exit -1
fi
echo " Done."
if [[ "$OBT_ID" =~ "OBT-AWS" ]]
then
SSH_KEYFILE="~/HPCC-Platform-Smoketest.pem"
SSH_TARGET="3.99.109.118" #SmoketestScheduler instance in AWS CA-Central
SSH_OPTIONS="-oConnectionAttempts=2 -oConnectTimeout=10 -oStrictHostKeyChecking=no"
else
SSH_KEYFILE="~/hpcc_keypair.pem"
SSH_OPTIONS="-oConnectionAttempts=3 -oConnectTimeout=20 -oStrictHostKeyChecking=no"
SSH_TARGET="10.224.20.54" #OpenStack Region 8
fi
YM=$(date +%Y-%m)
echo "Current year and month: $YM"
pushd $HOME
echo "Start hthor log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'hthor.*.log' -type f -print | egrep $YM | sort | zip -u HthorLogCollection-$YM -@ > HthorLogCollection-$YM.log &
echo "Start thor log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'thor.*.log' -type f -print | egrep $YM | sort | zip -u ThorLogCollection-$YM -@ > ThorLogCollection-$YM.log &
echo "Start roxie log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'roxie.*.log' -type f -print | egrep $YM | sort | zip -u RoxieLogCollection-$YM -@ > RoxieLogCollection-$YM.log &
echo "Start unit test log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'unittest*.log' -type f -print | egrep $YM | sort | zip -u UnittestsLogCollection-$YM -@ > UnittestsLogCollection-$YM.log &
echo "Start ML test log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'ml*.log' -type f -print | egrep $YM | sort | zip -u MlLogCollection-$YM -@ > MlLogCollection-$YM.log &
echo "Start WUTool test log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'wutooltest*.log' -type f -print | egrep $YM | sort | zip -u WutooltestLogCollection-$YM -@ > WutooltestLogCollection-$YM.log &
echo "Start build log collection..."
exec find ${STAGING_DIR_ROOT} -iname '*build*.log' -type f -print | egrep $YM | sort | zip -u BuildLogCollection-$YM -@ > BuildLogCollection-$YM.log &
echo "Start misc (report.htm, GlobalExclusion and git_2days) log collection..."
exec find ${STAGING_DIR_ROOT} -iname 'report.html' -o -iname 'GlobalExclusion.log' -o -iname 'git_2days.log' -type f | egrep $YM | sort | zip -u MiscLogCollection-$YM -@ > MiscLogCollection-$YM.log &
echo "Wait for processes finished."
wait
echo "All processes are finished."
popd
echo "Upload results.."
rsync -va -e "ssh -i ${SSH_KEYFILE} ${SSH_OPTIONS}" ~/*LogCollection* centos@${SSH_TARGET}:/home/centos/OBT/${OBT_ID}
echo "Upload done."
echo "End."