{"id":50,"date":"2008-05-03T09:00:22","date_gmt":"2008-05-03T14:00:22","guid":{"rendered":"http:\/\/www.cfchimp.com\/wordpress\/?p=50"},"modified":"2025-01-21T11:12:38","modified_gmt":"2025-01-21T16:12:38","slug":"subversion-backup-of-multiple-repositories-via-dos-bat-file","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2008\/05\/subversion-backup-of-multiple-repositories-via-dos-bat-file\/","title":{"rendered":"Subversion backup of multiple repositories via DOS .bat file"},"content":{"rendered":"<p>I recently had to implement <a title=\"Subversion\" href=\"https:\/\/tortoisesvn.net\/\" target=\"_blank\">Subversion<\/a> at work to manage our source code.  Part of that implementation was coming up with a way to automate the backup process.  Since developers could be accessing code repositories at any time there is a special command (called hotcopy) in Subversion for copying a repository to another location, which you can then backup to disk, tape, etc.<\/p>\n<p>I started out just doing a simple DOS .bat file to run the hotcopy.  My plan was to schedule this to run in the Windows scheduler prior to the nightly backup.  As I started working on the script though I found myself trying to improve it to be as generic and hands off as possible.  I also wanted to backup multiple repositories.<\/p>\n<p>Here are some &#8220;features&#8221; of the script:<\/p>\n<ul>\n<li>It will hotcopy multiple repositories in a specified directory.<\/li>\n<li>It can be run attended or unattended<\/li>\n<li>It has some basic log functionality<\/li>\n<\/ul>\n<p>Here is a look at the actual hotcopy command in the .bat file:<code><br \/>\nECHO Starting SVN backup for %%G... &gt;&gt; %repolog% &amp; ^<br \/>\nsvnadmin hotcopy %repodir%%%G %repodirhot%%%G --clean-logs &gt;&gt; %repolog% &amp; ^<\/code><\/p>\n<p><a title=\"Download DOS .bat file for Subversion backup\" href=\"https:\/\/csimmons.dev\/blog\/wp-content\/uploads\/2008\/05\/svn_backup.txt\" target=\"_blank\">Download it here<\/a> and rename it from svn_backup.txt to svn_backup.bat.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently had to implement Subversion at work to manage our source code. Part of that implementation was coming up with a way to automate the backup process. Since developers could be accessing code repositories at any time there is a special command (called hotcopy) in Subversion for copying a repository to another location, which &#8230; <a title=\"Subversion backup of multiple repositories via DOS .bat file\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2008\/05\/subversion-backup-of-multiple-repositories-via-dos-bat-file\/\" aria-label=\"Read more about Subversion backup of multiple repositories via DOS .bat file\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[12,38,17],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-developer","tag-developer","tag-dos","tag-subversion"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-O","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}