cleanup for files in scripts/perf
This commit is contained in:
parent
5c7f9b7dc4
commit
b81cbf2a86
8 changed files with 14 additions and 12 deletions
12
scripts/perf/sessiondatacollect.sh
Normal file → Executable file
12
scripts/perf/sessiondatacollect.sh
Normal file → Executable file
|
@ -6,9 +6,9 @@
|
|||
# Collection such runtime tar balls from all distributed servers to folder
|
||||
# /tmp/<sessionid>-<date>-<time> for example: /tmp/56779-11Oct14-09:33:13
|
||||
|
||||
currentdir=` pwd `
|
||||
currentdir=$(pwd)
|
||||
sid=${currentdir##*.}
|
||||
ts=` date +%y%h%d-%T `
|
||||
ts=$(date +%y%h%d-%T)
|
||||
logfile=/tmp/corelog.tgz
|
||||
echo Collect data from localhost:$currentdir to $logfile
|
||||
cd ..
|
||||
|
@ -18,7 +18,7 @@ if [ ! $? = 0 ]; then
|
|||
fi
|
||||
cd $currentdir
|
||||
|
||||
m=` grep master $currentdir/servers `
|
||||
m=$(grep master $currentdir/servers)
|
||||
if [ ! $sid = ${m##*=} ]; then
|
||||
# quite if this is not a master server
|
||||
echo not a master server
|
||||
|
@ -34,13 +34,13 @@ fi
|
|||
cp $logfile $logdir/localhost-${currentdir##*.}.tgz
|
||||
|
||||
# harvest CORE data from distributed servers
|
||||
hs=` grep -v master= $currentdir/servers | awk {'print $2'} `
|
||||
hs=$(grep -v master= $currentdir/servers | awk {'print $2'})
|
||||
echo hosts are localhost $hs
|
||||
for h in $hs; do
|
||||
echo checking host $h ...
|
||||
out=` ping -c 1 -w 1 $h | grep " 0 received," `
|
||||
out=$(ping -c 1 -w 1 $h | grep " 0 received,")
|
||||
if [ " $out " = " " ]; then
|
||||
slavesid=` ssh $h tar -tzf $logfile | awk -F / {'print $1'} `
|
||||
slavesid=$(ssh $h tar -tzf $logfile | awk -F / {'print $1'})
|
||||
if [ $? = 0 ]; then
|
||||
destlogfile=$logdir/$h-${slavesid##*.}.tgz
|
||||
echo Collect data from $h:$logfile to $destlogfile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue