Piping data on Windows command prompt

▼魔方 西西 提交于 2019-11-29 03:53:38
Dave Webb

Because your sample was exactly what I was looking for, this is what I did as a complete solution to "dump" all my repositories. That solution dump all svn repositories to 7-zip file without uncompressed intermediate.

Put that batch file in your "repository root", e.g. m:\repositories\dump-all.bat

pushd %~dp0
SET SEVENZIP="c:\Program Files\7-Zip\7z.exe" a -mx1 -si 
FOR /f "tokens=*" %%i in ('DIR /a:d /b') DO svnadmin dump %%i | %SEVENZIP% ..\_svndump\%%i.dump.7z

And, start that batch like this if you need to run it in low priority, both process (7z + svnadmin) will take a lot of cpu

start /low m:\repositories\dump-all.bat

Notes: "pushd %~dp0" set the "current directory" to where the batch file is, instead of starting it in "c:\windows\system32" if you start it from explorer with "run as administrator". It also works if the working folder is on another drive.
No need to type "m:" and "cd \repositories". if you start it from "c:" drive.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!