Eu faço dump e hotcopy. Coloque-os em um arquivo de lote e crie uma tarefa com o Agendador de Tarefas para executá-lo diariamente. Aqui está o meu arquivo de lote de amostra
!backing up credentials
copy H:\Repositories\authz G:\Repo-Backups-22-2013\backup
copy H:\Repositories\authz-windows G:\Repo-Backups-22-2013\backup
copy H:\Repositories\htpasswd G:\Repo-Backups-22-2013\backup
!full dump
svnadmin dump H:\Repositories\Proj1 > G:\Repo-Backups-22-2013\dump\Proj1
svnadmin dump H:\Repositories\Proj2 > G:\Repo-Backups-22-2013\dump\Proj2
!hard copy
svnadmin hotcopy H:\Repositories\Proj1 G:\Repo-Backups-22-2013\backup\Proj1
svnadmin hotcopy H:\Repositories\Proj2 G:\Repo-Backups-22-2013\backup\Proj2
Se você tem vários repositórios (projetos) para backup e eles mudam com freqüência, seria mais fácil ter um pequeno programa para criar o arquivo de lote acima para você. Aqui está o que eu escrevi para esse propósito:
public static void CreateBackupScript(string srcFolder, string desFolder, bool fullDump)
{
if (string.IsNullOrEmpty(srcFolder) || string.IsNullOrEmpty(desFolder))
return;
var dateString = DateTime.Now.ToShortDateString().Replace('/', '-');
var destination = System.IO.Path.Combine(desFolder, dateString, "backup");
if (!Directory.Exists(destination))
Directory.CreateDirectory(destination);
var source = srcFolder + "\";
var outputScript = "backup.cmd";
using (StreamWriter sw = new StreamWriter(outputScript))
{
sw.WriteLine("!backing up credentials");
sw.WriteLine("copy {0}authz {1}", source, destination);
sw.WriteLine("copy {0}authz-windows {1}", source, destination);
sw.WriteLine("copy {0}htpasswd {1}", source, destination);
// dump
if (fullDump == true)
{
sw.WriteLine("!full dump");
var dumpFolder = System.IO.Path.Combine(desFolder, dateString, "dump");
if (!Directory.Exists(dumpFolder))
Directory.CreateDirectory(dumpFolder);
foreach (var dir in new DirectoryInfo(source).GetDirectories("*.*", SearchOption.TopDirectoryOnly))
{
sw.WriteLine(@"svnadmin dump {0} > {1}\{2}", dir.FullName, dumpFolder, dir.Name);
}
}
//hot copy
sw.WriteLine("!hard copy");
foreach (var dir in new DirectoryInfo(source).GetDirectories("*.*", SearchOption.TopDirectoryOnly))
{
sw.WriteLine(@"svnadmin hotcopy {0} {1}\{2}", dir.FullName, destination, dir.Name);
}
}
}