讓SVN作為windows系統服務自動運行

來源:互聯網
上載者:User

方法一:

SVNService(將svn作為windows服務啟動並執行工具)

SVN Service Wrapper for Windows
This is my Win32 Service wrapper for SVN. Source is included, and its in the public domain. No need to copyright this stuff.

Usage instructions:

   SVNService -?                                to display this list
   SVNService -install <svnserve parameters>    to install the service
   SVNService -setup <svnserve parameters>      to change command line parameters for svnserve
   SVNService -remove                           to remove the service
   SVNService -debug                            to run as a console app for debugging

將svnservice.exe放在subversion的bin目錄下

Example:
比如,你的所有項目都在e:/svnrepo下,你可以如下
安裝時用   SVNService -install -d -r e:/svnrepo
更改時用   SVNService -setup -d -r e:/otherplace/svnrepo
如果訪問其中的一個項目e:/svnrepo/project1,可以指定路徑

svn://localhost/project1 (註:作為url時用/)

第一次安裝完後要到服務中手動啟動它,
或者到服務中將它設為自動啟動,讓每次機器啟動時自動啟動這個服務。

檔案: SVNService.rar
大小: 23KB
下載: 下載

方法二:

Subversion 從1.4版本開始,可以以windows系統服務的形式在開機時自動運行。但Subversion安裝程式還不能把自己安裝成windows服務,需要我們自己進行手動安裝,方法如下: 開啟一個DOS命令視窗,執行如下命令:  

sc create svnserve binPath= "/"C:/Program Files/Subversion/bin/svnserve.exe/" --service --root e:/svn --listen-port 3691" displayname= "Subversion Repository" depend= Tcpip start= auto   

其中,sc是windows內建的服務配置程式,參數binPath表示svnserve可執行檔的安裝路徑,由於路徑中的"Program Files"帶有空格,因此整個路徑需要用雙引號引起來。而雙引號本身是個特殊字元,需要進行轉移,因此在路徑前後的兩個雙引號都需要寫成/"

--service參數表示以windows服務的形式運行,--root指明svn repository的位置,service參數與root參數都作為binPath的一部分,因此與svnserve.exe的路徑一起被包含在一對雙引號當中,而這對雙引號不需要進行轉義。

displayname表示在windows服務列表中顯示的名字, depend =Tcpip 表示svnserve服務的運行需要tcpip服務,start=auto表示開機後自動運行。  

安裝服務後,svnserve要等下次開機時才會自動運行。  

若要卸載svn服務,則執行 sc delete svnserve 即可。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.