<?xml version="1.0"?>
<!DOCTYPE content [ <!ENTITY nbsp " "> ]>
<rdf:RDF xml:base="http://snarfed.org/rdf"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://snarfed.org">
  <dc:title> snarfed.org  </dc:title>
  <dc:description> draw group stream of consciousness </dc:description>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>
</rdf:Description>

<rdf:Description rdf:about="http://snarfed.org/space/backup%20subversion%20fsfs%20with%20rsync">
  <dc:title> backup subversion fsfs with rsync </dc:title>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:date> 2003-01-01T05:00:00Z </dc:date>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>

  <content>
    <p><a href="http://subversion.tigris.org/"><img src="/space/subversion.png" alt="/space/subversion.png" title="" /></a></p>

<p>I use
<a href="http://subversion.tigris.org/">Subversion</a> for source control, and it's great.
I recently migrated my repository to use the new
<a href="http://svn.collab.net/repos/svn/trunk/notes/fsfs">FSFS</a> backing store, which
stores the repository directly on the filesystem, instead of in
<a href="http://sleepycat.com/">Berkeley DB</a>.</p>

<p>One of the many advantages of FSFS is that it's very easy to backup. The
repository files can be copied directly. The only tricks are to copy the
db/current file first, and not to copy the transactions/ directory. I backup my
repository with rsync, like so:</p>

<div class='p-shadow'><pre><code>rsync ... /path/to/repo/db/current backup:~/repo/db
rsync ... --exclude transactions/ --exclude db/current \
          /path/to/repo backup:~/
</code></pre></div>

<p><br class='clearing' />See also:</p>

<ul>
<li><a href="/space/subversion and tkdiff">subversion and tkdiff</a></li>
<li><a href="/space/gnu emacs backup files">gnu emacs backup files</a></li>
</ul>

  </content>

  <rdf:Seq>

<rdf:li>
<rdf:Description rdf:about="#1170969219.27">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> backup subversion fsfs with rsync </dc:title>
  <dc:creator> mike </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    You really dont want to do this. You can corrupt your svn database if rsync only gets part of a tranction. A better way is to script backing up the svn repository manually
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1172622841.22">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> backup subversion fsfs with rsync </dc:title>
  <dc:creator> joe </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Agreed about the corruption.&nbsp; I would instead recommend first making a hotcopy of the working repository and then doing an rsync on that.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1177685185.74">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> backup subversion fsfs with rsync </dc:title>
  <dc:creator> AlberT </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    The svn "Note: Backup" section seems to agree with this article ...<br />
<br />
the repository will not be corrupted as you don't copty transictions and copy current before the rest ...<br />
<br />
"So, if you are using standard backup tools to make backups of a FSFS
repository, configure the software to copy the "current" file before
the numbered revision files, if possible, and configure it not to copy
the "transactions" directory.&nbsp; If you can't do those things, use
"svnadmin hotcopy", or be prepared to cope with the very occasional
need for repair of the repository upon restoring it from backup."
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1212000683.43">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> backup subversion fsfs with rsync </dc:title>
  <dc:creator> jonvel </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    I'd like to say that I've been using a very similar strategy for backing up my FSFS Svn Repository (going on about 2 GB total data, 4800+ revisions).&nbsp; I've restored this from backup, and it works fine.&nbsp; No corruption issues that anyone is complaining about, even with a "live" system that I've TRIED to corrupt - ie making a large (~1500 files) checkin while the backup was in process.&nbsp; Yes, when I restored the backup (to a third server), the latest update (the ~1.5k files) wasn't there, but I expected that to happen.&nbsp; re-synching after the update, however, did give me the files I was expecting, and the update I expected.<br />
<br />
Since my SVN repo is running on a windows machine, I can't use rsync.&nbsp; But I CAN use winscp's scripting capability.&nbsp; The commands are essentially the same:<br />
<br />
=== begin winscp scriptfile ===<br />
option batch on<br />
option confirm off<br />
option transfer binary<br />
option include current<br />
synchronize remote c:\mytemprepo /backup/location<br />
option include clear<br />
option exclude transactions<br />
option exclude current<br />
synchronize remote c:\mytemprepo /backup/location<br />
exit<br />
=== end winscp script ===<br />
called with:<br />
winscp.com &lt;session_id&gt; /script=winscpscript &gt; logfile<br />
<br />
Now a backup takes a whopping &lt; 5 minutes to run (well, the first one was very long).
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1212000787.83">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> backup subversion fsfs with rsync </dc:title>
  <dc:creator> jonvel </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    I'd like to say that I've been using a very similar strategy for backing up my FSFS Svn Repository (going on about 2 GB total data, 4800+ revisions).&nbsp; I've restored this from backup, and it works fine.&nbsp; No corruption issues that anyone is complaining about, even with a "live" system that I've TRIED to corrupt - ie making a large (~1500 files) checkin while the backup was in process.&nbsp; Yes, when I restored the backup (to a third server), the latest update (the ~1.5k files) wasn't there, but I expected that to happen.&nbsp; re-synching after the update, however, did give me the files I was expecting, and the update I expected.<br />
<br />
Since my SVN repo is running on a windows machine, I can't use rsync.&nbsp; But I CAN use winscp's scripting capability.&nbsp; The commands are essentially the same:<br />
<br />
=== begin winscp scriptfile ===<br />
option batch on<br />
option confirm off<br />
option transfer binary<br />
option include current<br />
synchronize remote c:\mytemprepo /backup/location<br />
option include clear<br />
option exclude transactions<br />
option exclude current<br />
synchronize remote c:\mytemprepo /backup/location<br />
exit<br />
=== end winscp script ===<br />
called with:<br />
winscp.com &lt;session_id&gt; /script=winscpscript &gt; logfile<br />
<br />
Now a backup takes a whopping &lt; 5 minutes to run (well, the first one was very long).
  </content>
</rdf:Description>
</rdf:li>

  </rdf:Seq>
</rdf:Description>
</rdf:RDF>
