Author Posts

July 26, 2016 at 12:59 pm

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
$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"

$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.

July 26, 2016 at 1:36 pm

Ok, got the forum rule thing.

Please elaborate on my error? What I did wrong?

July 26, 2016 at 8:18 pm

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

July 26, 2016 at 8:22 pm

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

July 27, 2016 at 1:56 am

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

-gt is a comparison operator in powershell.

  • This reply was modified 2 years ago by  Dan Potter.

July 27, 2016 at 2:14 am

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 >.

Here is an example.

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

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

  • This reply was modified 2 years ago by  Dan Potter.

July 27, 2016 at 2:37 am

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

July 27, 2016 at 5:03 am


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