Create "SVN update. BAT file, copy the following commands to the file, save and exit, and then use the "Task Scheduler" function of windows to automatically update the svn directory at regular intervals.
Run the following command to process files in batches. The content of two directories can be automatically updated at a time. If you want to update the content of three directories at a time, you can set the new environment variable svn_work3 in the same way and add the new command set: update3 and: gengxin3. Note: change the environment variable name in update3 to svn_work3 and gengxin3.
Note:
- Enter the directory name for installing the svn client after "svn_home = ".
- Fill in the 1st directory names to be updated after "svn_work1 =.
- Fill in the 2nd directory names to be updated after "svn_work2 =.
SVN update. BAT:
@ Echo off
@ Echo ========================================
@ Echo author-sun at 2011.7.18
@ ECHO: automatically updates the project content on SVN at regular intervals, which can be used when the project is placed on a Web server without Hudson
@ Echo time is determined by your "task schedule" Time
@ Echo 1. svn_home = directory for installing tortoise. The tortoisesvn client must be installed.
@ Echo 2. svn_work = update the directory of the project file
@ Echo win7, winvista, or win2008 users must run the command as administrators.
@ Echo ========================================
Set svn_home = directory name for installing the svn Client
Set svn_work1 = Name of the 1st directories to be updated
Set svn_work2 = Name of the 2nd directories to be updated
Goto: update1
: Update1
If exist % svn_work1 % Goto: gengxin1 else Goto: mk
: Update2
If exist % svn_work2 % Goto: gengxin2 else Goto: mk
: Mk
@ Echo check whether your working directory is correct
Echo & pause Goto: End
: End
Exit
: Gengxin1
"% Svn_home %" \ tortoiseproc.exe/command: update/path: "% svn_work1 %"/notempfile/closeonend: 1
Goto: update2
: Gengxin2
"% Svn_home %" \ tortoiseproc.exe/command: update/path: "% svn_work2 %"/notempfile/closeonend: 1
@ ECHO: update complete and exit
How to Set a Windows Task Plan:
1. Click Start \ All Programs \ accessories \ System Tools \ task plan"
2. Click "add Task Plan"
3. Click "Next"
4. Click Browse and select the svn update. BAT file you just edited.
5. Select the task execution frequency, for example, daily
6. Click "Next"
7. Select the task execution time, for example, 9: 00
8. Click "Next"
9. Enter the logon username and password set during startup. If no logon password exists, click "Next"
10. Click Finish
If you have not set the logon username and password, the system reports an error after completing the preceding settings:
Right-click the newly added "SVN Update" icon, select "properties", check the option "run only after Logon", and click "OK.
How to automatically update SVN Projects