{"id":60,"date":"2006-10-01T20:40:37","date_gmt":"2006-10-01T19:40:37","guid":{"rendered":"http:\/\/www.hlynes.com\/2006\/10\/01\/backups-part-2-subversion\/"},"modified":"2006-10-01T20:40:37","modified_gmt":"2006-10-01T19:40:37","slug":"backups-part-2-subversion","status":"publish","type":"post","link":"http:\/\/www.hlynes.com\/?p=60","title":{"rendered":"Backups &#8211; Part 2: Subversion"},"content":{"rendered":"<p>We run a <a href=\"http:\/\/subversion.tigris.org\/\" target=\"\">subversion<\/a> service for a number of different research groups. Generally we create a separate subversion repository for each group. Obviously looking after this data is important. It&#8217;s not a good idea to lose months of someone&#8217;s work.<\/p>\n<p>Fortunately backing up a subversion repository is pretty simple. Subversion ships with a utility called svnadmin. One of the functions of which is to dump a repository to a file.<\/p>\n<p>As the repository owner do:<\/p>\n<pre>\nsvnadmin dump \/path\/to\/repository > subversion_dump_file\n<\/pre>\n<p>I have a directory full of subversion repositories so what I really want is a script that will find all the subversion repositories in the directory and dump them with sensible filenames. With my usual lack of imagination I&#8217;ve called this script svn_backup. It runs svnadmin verify against each file in the directory it&#8217;s given. If any of them turn out to be subversion repositories it dumps them using svnadmin dump.<\/p>\n<pre>\n$ .\/svn_backup\nsvn_backup  -s subversion_dir [-b backup_dir] [ -o logfile]\n        script to backup subversion repositories\n\n        -s      directory containging subversion repositories\n        -b      directory to dump backups to. defaults to \/tmp\n        -o      file to output names of backups to\n<\/pre>\n<p>So I now have an entry in cron.daily like:<\/p>\n<pre>\nsvn_backup -s \/var\/www\/subversion -o \/tmp\/svn.log -b \/var\/backups\/svn\n<\/pre>\n<p>The reason I write the backups to a log file is that it allows me to run a script once a week that copies the latest backups to Amazon&#8217;s S3 storage system.<\/p>\n<p>The scripts:<br \/>\n<a href=\"https:\/\/popov-cs.grid.cf.ac.uk\/subversion\/WeSC\/scripts\/svn_backup\" target=\"\">svn_backup<\/a><br \/>\n<a href=\"https:\/\/popov-cs.grid.cf.ac.uk\/subversion\/WeSC\/scripts\/s3svnbackup.py\" target=\"\">s3svnbackup.py<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We run a subversion service for a number of different research groups. Generally we create a separate subversion repository for each group. Obviously looking after this data is important. It&#8217;s not a good idea to lose months of someone&#8217;s work. Fortunately backing up a subversion repository is pretty simple. Subversion ships with a utility called &hellip; <a href=\"http:\/\/www.hlynes.com\/?p=60\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Backups &#8211; Part 2: Subversion<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-sysadmin"],"_links":{"self":[{"href":"http:\/\/www.hlynes.com\/index.php?rest_route=\/wp\/v2\/posts\/60"}],"collection":[{"href":"http:\/\/www.hlynes.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hlynes.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hlynes.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hlynes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=60"}],"version-history":[{"count":0,"href":"http:\/\/www.hlynes.com\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hlynes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hlynes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hlynes.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}