#get the last time file
NEW_FILE=`ls -rt | sed '/sh/d' | tail -n1`
echo $NEW_FILE
#get the last file's id
var=`echo ${NEW_FILE}|awk -F '#' '{print $2}'|awk -F '.' '{print $1}'`
echo $var
#create the time and the new id
TODAY=`date +%Y%m%d`
let var+=1
echo "var = $var"
#mv and rename the old jar
mv /opt/qanda/qanda-1.1-SNAPSHOT.jar /opt/qanda/survey_spring_old_jar/qanda-1.1-SNAPSHOT-${TODAY-NEW}'#'${var}.jar