Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Dan1el42/03a3b965e421065a6f94223ef3f562a3 to your computer and use it in GitHub Desktop.

Select an option

Save Dan1el42/03a3b965e421065a6f94223ef3f562a3 to your computer and use it in GitHub Desktop.
#Variable setup
$DateTime = Get-Date -Format "yyyyMMdd-hhmmss"
$SvnAdminExecutablePath = "C:\Program Files\VisualSVN Server\bin\svnadmin.exe"
$SvnAdminSubcommand = "dump"
$RepositoriesRootPath = "D:\Repositories"
$RepositoryName = "Admin"
$RepositoryPath = Join-Path -Path $RepositoriesRootPath -ChildPath $RepositoryName
$BackupRootPath = "\\c2sd2643t\SVN-BU"
$BackupFilePath = Join-Path -Path $BackupRootPath -ChildPath "${RepositoryName}_${DateTime}.svndump"
$BackupMessagesFilePath = Join-Path -Path $BackupRootPath -ChildPath "${RepositoryName}_${DateTime}.txt"
cmd.exe /c "$SvnAdminExecutablePath" $SvnAdminSubcommand "$RepositoryPath" `>"$BackupFilePath" 2`>"$BackupMessagesFilePath"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment