A simple dos script, svn get code, dossvn
Get the latest code
svn update --username %SVN_USER% --password %SVN_PASSWORD% >> "../%LOG_FILE%"
Back up Tomcat sites
md "%APP_ROOT%\backup\%MVN_PROFILE%-%CUR_DATE%-%myran%" >> "%LOG_FILE%"xcopy "%APP_ROOT%\%MVN_PROFILE%" "%APP_ROOT%\backup\%MVN_PROFILE%-%CUR_DATE%-%myran%"/s >> "%LOG_FILE%"
Compile code
You must call the cmd cal command l. Otherwise, the maven command will exit the entire bat directly. This problem has been called for most of the night.
call mvn clean install -DskipTests -P %MVN_PROFILE% -f %MVN_POM% >> "%LOG_FILE%"
Stop tomcat Service
net stop Tomcat6 >> "%LOG_FILE%"
Release site
rd /s/q "%APP_ROOT%\%MVN_PROFILE%" >> "%LOG_FILE%"md "%APP_ROOT%\%MVN_PROFILE%" >> "%LOG_FILE%"xcopy "%MVN_WEBAPP%\%MVN_PROFILE%" "%APP_ROOT%\%MVN_PROFILE%"/s >> "%LOG_FILE%"xcopy "%MVN_3RD_LIB%" "%APP_ROOT%\%MVN_PROFILE%\WEB-INF\lib" >> "%LOG_FILE%"
Start tomcat Service
net start Tomcat6 >> "%LOG_FILE%"
Source code file
How to write a script? When SVN submits code, a prompt is given to the submitter.
Read-p "content:" variable
Help me write a simple dos batch processing script
How long is it? The following is the interval of one minute.
@ Echo off
: Sleep 100 s
Ping-n 100 127.1> nul
: 1
Ping-n 60 127.1> nul
Ping-n 1 xxx. xxx | findstr/c: "Request timed out"
Goto % errorlevel %
: 0
@ Echo on
2> nul
Ping-n 1 127.1> nul
2> nul
Ping-n 1 127.1> nul
2> nul
Ping-n 3 127.1> nul
@ Echo off
Shutdown-s-f-t 10-c "error, restart now"
Save the above as a bat file and place it in "start"> "start" to enable auto-start upon startup. Change xxx. xxx to the ip address you want to ping.