Backup SVN with PowerShell

Your ads will be inserted here by

Easy Ads.

Please go to the plugin admin page to set up your ad code.

I work with a team of developers and utilise SVN for our source control. The backup script in place was a simple batch file and had a few shortfalls, so I re-wrote it with PowerShell.

Essentially it checks the location of the repositories, performs a svnadmin dump to another location on the same server, then copies them over to a network share that will get put onto tape.

Your ads will be inserted here by

Easy Ads.

Please go to the plugin admin page to set up your ad code.

$RepoLocation = "C:\Repositories"
$RepoBackupLocation = "C:\ReposBackup"
$FileServerDestination = "\\file\Backups\SVN"
 
foreach ($repo in (Get-ChildItem($Repolocation)))
{
    if (!$repo.Directory)
    {
        #$repo.Name
        $svnDumpSource = $RepoLocation + "\" + $repo.Name
        $svnDumpDest = $RepoBackupLocation + "\" + $repo.Name + ".dmp"
        svnadmin dump -q $svnDumpSource > $svnDumpDest
     }
 
}
 
robocopy ($RepoBackupLocation+"\") $FileServerDestination *.dmp /Z /NP

Your ads will be inserted here by

Easy Ads.

Please go to the plugin admin page to set up your ad code.

One thought on “Backup SVN with PowerShell”

  1. As soon as I initially left a comment I clicked the Notify me when new comments are added checkbox and currently every time a remark is added I receive 4 email messages with the identical comment.

Leave a Reply

Your email address will not be published. Required fields are marked *