#!/bin/bash DATE=`date +%Y-%m-%d_%H-%M` Project=shuyun WORKING_PATH=`pwd` echo "#### [$WORKING_PATH]start begin ... #####" SUBDIRS="tomcat8080 tomcat8081 tomcat8082 tomcat8083 tomcat8084" echo "===============================" echo "$SUBDIRS" echo "===============================" for str in $SUBDIRS do dir=${str%/*} echo "#### Enter ->" $dir " #####" cd $dir rm -rf ./webapps/${Project} cp -r /data/back/${Project} ./webapps bash ./bin/shutdown.sh bash ./bin/startup.sh echo "####################################" cd $WORKING_PATH done mv /data/back/${Project} /data/back/${Project}_${DATE}