SVN BAckup - HELP please!

Welcome Forums General PowerShell Q&A SVN BAckup - HELP please!

This topic contains 8 replies, has 3 voices, and was last updated by

 
Moderator
2 years, 3 months ago.

  • Author
    Posts
  • #48251

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    Ok, got the forum rule thing.

    Please elaborate on my error? What I did wrong?

  • #48319

    Moderator
    Points: 24
    Team Member
    Rank: Member

    Hi, the following article might be able to help.

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

  • #48366

    Participant
    Points: 0
    Rank: Member

    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

      Participant
      Points: 0
      Rank: Member

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

  • #48395

    Participant
    Points: 21
    Rank: Member

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

  • #48398

    Participant
    Points: 21
    Rank: Member

    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

  • #48401

    Participant
    Points: 21
    Rank: Member

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

  • #48403

    Moderator
    Points: 24
    Team Member
    Rank: Member

    Hi,

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

    Best,
    Daniel

The topic ‘SVN BAckup - HELP please!’ is closed to new replies.