During this development project, some people in the team always forget to updateCode, Leading to issues such as code non-synchronization. It is easy for us to manually repeat each piece of work. If we make repetitive work into a template, is it much better.
Then we will give this job to our computer, "automatically update code before going to work every day" is divided into two parts. The first step is "Update SVN", which can be completed using tortoiseproc.exe, and the second step is to use scheduled system tasks for regular execution.
Step 1: autosvn. bat
@ Echo off
@ Echo ===================================
@ Echo author Luo mingui
@ Echo blog: http://luomingui.cnblogs.com
@ Echo Email: luomingui@hailin.com
@ Echo update: 2012-08-27
@ Echo ===================================
Rem SVN installation directory
Set svn_home = D: \ Program Files \ tortoisesvn \ bin
Rem SVN working directory
Set svn_work = F: \ Hailin \ project \ Oha \ heatingmanager \ source \ trunk
Rem SVN log directory
Set setup_path = D :\
@ Echo updating directory % svn_work %
If exist % svn_work % Goto: gengxin else Goto: mk
: Mk
@ Echo check whether your working directory is correct
Echo & pause Goto: End
@ ECHO: update complete and exit
Goto: End
: End
Exit
: Gengxin
If exist "% setup_path %" \ AutoUpdate. log (echo update: % date % time %> "% setup_path %" \ AutoUpdate. log) else echo create: % date % time %> "% setup_path %" \ AutoUpdate. log
"% Svn_home %" \ tortoiseproc.exe/command: update/path: "% svn_work %"/notempfile/closeonend: 1
Exit
Step 2: schedule task setup. bat
@ Echo off
@ Echo ===================================
@ Echo author Luo mingui
@ Echo blog: http://luomingui.cnblogs.com
@ Echo Email: luomingui@hailin.com
@ Echo update: 2012-08-27
@ Echo ===================================
@ ECHO: Add a task
Schtasks/create/SC daily/ST 08:30:00/TN "auto update SVN"/TR "% ~ Sdp0autosvn. Bat "/F
Step 3: Use
1: Save the content of step 1 and Step 2 to the BAT file.
2: Modify the svn installation directory, SVN working directory, and SVN log directory attributes in step 1 as needed.
3: Execute the setup. BAT file installation task.
MATERIALS:
Schtasks: http://hi.baidu.com/feavar/blog/item/fadac21ba8cc07fbae513375.html
Online example: http://www.cnblogs.com/doupip/archive/2012/02/10/2345708.html