惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
博客园 - 司徒正美
F
Fortinet All Blogs
D
Docker
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
U
Unit 42
The Register - Security
The Register - Security
Martin Fowler
Martin Fowler
IT之家
IT之家
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
T
Tenable Blog
S
Security Affairs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
W
WeLiveSecurity
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tailwind CSS Blog
TaoSecurity Blog
TaoSecurity Blog
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
雷峰网
雷峰网
Forbes - Security
Forbes - Security
Recent Announcements
Recent Announcements
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
P
Palo Alto Networks Blog
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
Attack and Defense Labs
Attack and Defense Labs
Latest news
Latest news
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
Last Week in AI
Last Week in AI
Scott Helme
Scott Helme
A
Arctic Wolf
L
LINUX DO - 最新话题
A
About on SuperTechFans
K
Kaspersky official blog
博客园 - Franky

博客园 - Zealic

Windows 下使用 Nginx+Mono 部署 ASP.Net 一种版本化的数据库脚本管理机制 Visual Studio 使用的 ProjectTypeGuids MSBuild 简解 CCNet 的 Build 流程 发散性碎片(2008-12-29) Google Toolbar 5 简析 Google Gadget 的数据丢失原因 乱弹用户资源 职业·病 发散性碎片(2008-11-14) 动态链接库重定向技术 SilverLight 与移动平台 Linux 下的 Apache + FastCGI 部署 ROR 应用 Live Writer 12.0.1370.325 + SyntaxColor4Writer 0.27 ICE 编译器环境集合 Subversion and .Net Windows 下的 Apache + FastCGI 部署 ROR 应用 好用的 Abyss Web Server
SVN 简单备份与还原
Zealic · 2008-11-26 · via 博客园 - Zealic

  备份 SVN 仓库是很麻烦的事,而 Coder 通常是很怕麻烦的人,于是 Zealic  就为减少麻烦,花了一点麻烦的时间,写了两个麻烦的脚本,解决了这个麻烦的问题。

  1.备份脚本 DumpAll.bat

Copy Code

@ECHO OFF ::==================== ::Author : Zealic ::Version : 1.00 ::FileName : DumpAll.bat ::Summary : Dump 当前目录的所有 Svn 仓库,脚本将备份当前目录下的所有SVN仓库, :: 本脚本依赖于 7za.exe 程序,请到下述连接下载程序 :: http://downloads.sourceforge.net/sevenzip/7za457.zip ::Update : 2008-11-26 ::==================== SET VAR_DATE=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2% dir /B /AD > DIRS IF EXIST DUMP_FILES ( DEL /Q DUMP_FILES ) FOR /F %%i IN (DIRS) DO ( SET REPOS_NAME=%%i CALL :DUMP_REPOS ) SET REPOS_NAME= ECHO. ECHO Compressing dump files... 7za a Repos_%VAR_DATE%.7z *.bin ECHO Delete dump files... FOR /F %%i IN (DUMP_FILES) DO ( DEL /Q %%i ) DEL /Q DIRS DEL /Q DUMP_FILES ECHO Successed. GOTO :EOF ::==== Functions ==== :DUMP_REPOS SET DUMP_FILE=%REPOS_NAME%.bin ECHO Dumping repository ^"%REPOS_NAME%^" ... svnadmin dump ^"%REPOS_NAME%^" -q > %DUMP_FILE% IF %errorlevel%==0 ( ECHO %DUMP_FILE% >> DUMP_FILES ) ELSE ( DEL /Q %DUMP_FILE% ECHO Dump ^"%REPOS_NAME%^" failed. ) SET DUMP_FILE= ECHO.

2.还原脚本 LoadAll.bat

Copy Code

@ECHO OFF ::==================== ::Author : Zealic ::Version : 1.00 ::FileName : LoadAll.bat ::Summary : Load Svn 仓库,确保当前目录为没有任何子目录, :: 脚本将搜索当前目录下的 *.bin 文件,自动为其创建仓库并 Load Dump文件。 ::Update : 2008-11-26 ::==================== SET VAR_IS_EMPTY_DIR=TRUE dir /B /AD > DIRS FOR /F %%i IN (DIRS) DO ( SET VAR_IS_EMPTY_DIR=FALSE ) DEL /Q DUMP_FILES IF "%VAR_IS_EMPTY_DIR%"=="FALSE" ( ECHO Error : Current directory is not empty. GOTO :EOF ) SET VAR_IS_EMPTY_DIR= dir /B /A-D *.bin > DUMP_FILES IF "%errorlevel%"=="0" ( ECHO Finded dump file. ) ELSE ( ECHO Error : Can not find dump file. GOTO :EOF ) FOR /F %%i IN (DUMP_FILES) DO ( SET REPOS_FILE=%%i CALL :LOAD_REPOS ) SET REPOS_FILE= DEL /Q DUMP_FILES ECHO Successed. GOTO :EOF ::==== Functions ==== :LOAD_REPOS SET REPOS_NAME=%REPOS_FILE:~0,-4% mkdir %REPOS_NAME% ECHO Loading repository ^"%REPOS_NAME%^" ... svnadmin create %REPOS_NAME% svnadmin load -q %cd%\%REPOS_NAME% < %REPOS_FILE% IF %errorlevel%==0 ( ECHO %DUMP_FILE% >> DUMP_FILES ) ELSE ( RMDIR /Q %REPOS_NAME% ECHO Load ^"%REPOS_NAME%^" failed. ) SET REPOS_NAME= ECHO.

麻烦解决之,所以可以去娱乐了。

2008-11-26 Zealic