Skip to content

Instantly share code, notes, and snippets.

@textarcana
Created September 16, 2009 21:43
Show Gist options
  • Select an option

  • Save textarcana/188209 to your computer and use it in GitHub Desktop.

Select an option

Save textarcana/188209 to your computer and use it in GitHub Desktop.
SVN Backup Post-Commit Hook
rem incremental backup for SVN
rem copies each commit to a network drive, as it happens
svnadmin dump --incremental -r %2 %1 > c:\repository\backup_system\dumpfiles\rev%2
cksum c:\repository\backup_system\dumpfiles\rev%2 > c:\repository\backup_system\dumpfiles\rev%2.sum
rem this strategy only works if you set up the Subversion Windows service,
rem to run with your credentials or admin credentials.
rem For details, see the great article on CodingHorror.com
cp c:\repository\backup_system\dumpfiles\rev%2 \\my_network_drive\backup_system\dumpfiles
cp c:\repository\backup_system\dumpfiles\rev%2.sum \\my_network_drive\backup_system\dumpfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment