SVN BAckup - HELP please!

This topic contains 8 replies, has 3 voices, and was last updated by  Daniel Krebs 1 year, 1 month ago.

  • Author
    Posts
  • #48251

    Windows LiveUser160
    Participant

    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.

  • #48259

    Windows LiveUser160
    Participant

    Ok, got the forum rule thing.

    Please elaborate on my error? What I did wrong?

  • #48319

    Daniel Krebs
    Moderator

    Hi, the following article might be able to help.

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

  • #48366

    Windows LiveUser160
    Participant

    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

    • #48368

      Windows LiveUser160
      Participant

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

  • #48395

    Dan Potter
    Participant

    > = 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 1 year, 1 month ago by  Dan Potter.
  • #48398

    Dan Potter
    Participant

    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
    [System.Web.HttpUtility]::HtmlDecode('>')

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

    • This reply was modified 1 year, 1 month ago by  Dan Potter.
  • #48401

    Dan Potter
    Participant

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

  • #48403

    Daniel Krebs
    Moderator

    Hi,

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

    Best,
    Daniel

You must be logged in to reply to this topic.