#!/bin/bash
. ~/.bashrc
echo $#
if [ $# -lt 1 ]
then
echo "need job config file"
exit
fi
jobname="$1"
taskname=`echo $(basename $jobname .xml)`
echo "$jobname,taskname=$taskname"
DATAX_HOME=/home/work/datax
timenow=` date +'%H%M%S'`
cd $DATAX_HOME
outputfile="${DATAX_HOME}/log/${taskname}.log"
errorfile="${DATAX_HOME}/log/${taskname}.error"
rm ${outputfile} -f
python ${DATAX_HOME}/bin/datax.py ${jobname} >> ${outputfile} 2>${errorfile}
if [ $? -eq 0 ]
then
tail -n32 ${outputfile}
exit 0
else
tail -n32 ${outputfile}
exit 102
fi
tail -n32 ${outputfile}
exit 103
# nohup sh ./start_datax.sh /home/work/datax/job/open/open_t_pay > open_t_pay.out 2>&1 &
# grep 'Percentage' ~/datax/log/open_t_pay.log