SVN BAckup - HELP please!

Hi all-

I am trying to do an SVN backup via Powershell. I have a script I am using that I want to repurpose because it is
doing a “hotcopy” instead of a “dump”. I want to use CMD /C to do the work as Powershell would be slow.
Here is what I have:
#Variable setup
$Date = Get-Date -format MM.dd.yyyy
$RepBasePath=“d:\Repositories”
$cmd=“cmd /c”
$RepBuPath = “\c2sd2643t\SVN-BU”
$Admin=“c:\program files\VisualSVN Server\bin\svnadmin.exe”
$CopyType = “dump”
$tod = Get-Date -format “hh:mm:ss MM.dd.yy”

$Repository=“Admin”
$BuFinalPath="\c2sd2643t\svn-bu"
$BuFile=$BuFinalPath + “” + $Repository + “.” + “dump”
cmd.exe /c svnadmin.exe $CopyType $Repository `> $BuFile

The variable $BuFile gets built correctly but fails in the final line with "svnadmin: E720003: Can’t open file ‘admin\format’: The system cannot find the file specified.

What am I doing wrong? Note this is a snippet of a larger script, I am doing testing.

Ok, got the forum rule thing.

Please elaborate on my error? What I did wrong?

Hi, the following article might be able to help.

http://www.heyweb.net/2012/04/backup-svn-with-powershell/

Thank you for the example. I DID see this but being a powershell novice I am not
quite understanding.

svnadmin dump -q $svnDumpSource > $svnDumpDest

not understanding how > takes the place of > .

Ex: svnadmin dump reposa > reposa.dump

Sorry, formatting is off. The example shows “gt;” . How does that translate to “>”

> = pipe in ms-dos. All ms-doss commands run in powershell so using the pipe wouldn’t work, MS-dos will interpret the &gt as a pipe. make sense?

-gt is a comparison operator in powershell.

After further thought I’m not sure what I said even makes sense to me, time for another beer:D

You see that a lot in html where it’s supposed to be > but ends up &gt.

Here is an example.

[Reflection.Assembly]::LoadFile( ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Web.dll’) | out-null
[System.Web.HttpUtility]::HtmlDecode(’>’)

If that one doesn’t make sense I give up:D

Ha of course the forums would translate that for me. HtmlDecode ( ’ & g t ; ') with no spaces.

Hi,

Please check out if below modified script works for you (it does on my system).

https://gist.github.com/Dan1el42/03a3b965e421065a6f94223ef3f562a3

Best,
Daniel