Backup cvs repository regularly

Last modified at $Date: 2005/04/11 07:07:54 $

Backup cvs repository regularly

Regular backup is important for cvs administrator. We can use some simple tech to make our life easier. We are going to use simple m$-dos batch file to do backup thing for cvs server run on m$ windows2000 platform.

This batch file is especially for windows english version. m$-dos date command's output is different from the one on chinese version. Destination zip file is located in cvsroot directory. We only uncompress project directory not the entire cvsroot directory, there is no need to backup the whole cvsroot directory.

The following is the content of m$-dos batch file. Format of the backup file is zip. We can easily change to use another uncompress tool like tar in Linux. Zip file name's suffix is current date when backup separated by _

for /f "Tokens=2-4 Delims=/ " %%i in ('date /t') do  set LOGDATE=%%k-%%i-%%j

for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%LOGDATE%%tm%


cd /
cd d:/cvsroot

rar a cvsbackup_%dtt%.zip project_1 project_2 prj_3
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章