# Piping data on Windows command prompt

I need to get a backup dump of a large (~8gb) svn repository. My current method involves using svnadmin dump to a file and then using 7-Zip to compress and split the file.

> svnadmin dump c:\path\to\myrepo > c:\svndump.svn
> 7z svndump.svn svndump.7z      // or whatever the correct syntax is


I was wondering if there would be a way to skip the middle-man here, and get the svn dump data to be compressed in one go by using pipes or something? Is this possible? What would the syntax be?

• Git and Dropbox - local repo
• Performing Hotbackups of Gogs
• How do I set up a local Git repository and a local backup directory?
• Tips for using CVS or Subversion as a backup framework for office documents
• git setup for backup & sync between 2 computers
• Backup hosted repository to off-site location
• SVN installation
• Adding Git to PATH Variable - Can't find GitHub under AppData/Local
• Is there a synopsis about how to do certain things with different scm tools?
• Git-SVN for Web development — how to do it?
• SVN keeps corrupting files with “<<<<<<< .mine”, how to fix?
• How to setup access control in SVN?
• ### 2 Solutions collect form web for “Piping data on Windows command prompt”

svnadmin dump dumps to standard out by default and the 7z command line can read from standard input using the -si switch.

svnadmin dump c:\path\to\myrepo | 7z a -si svndump.7z


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.

Git Baby is a git and github fan, let's start git clone.