Subversion SVN Backup - HotCopy Not a folder copy

Subversion hotcopy is tricky, because you have to empty the contents of the destination folder before you run the svnadmin hotcopy command.

To do this I create a console app and run it before the svnadmin command runs.App is really simple and has the following code in it.

''share of the destination folder
Dim folder As String = "\\svnbackupserver\svnreposbackup"
Dim rootFiles() As String = System.IO.Directory.GetFiles(folder)
For Each file In rootFiles
System.IO.File.SetAttributes(file, FileAttributes.Normal)
Dim dr() As String = System.IO.Directory.GetDirectories(folder)
For Each item In dr
Dim str() As String = System.IO.Directory.GetFiles(item)
For Each item1 In str
System.IO.File.SetAttributes(item1, FileAttributes.Normal)
System.IO.Directory.Delete(item, True)
Catch ex As Exception
End Try
End Sub

C:\Batch\SVNBackup.exe svnadmin hotcopy \\svnserver\svnrepo \\svnserverbackup\SvnReposBackup


Popular posts from this blog

Duplicate Folders Freeware - Not Duplicate Files

Free SQL Server Management Studio Addin/Plugin/External Tool to get object information quickly

SSRS Compile Errors