--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
+<title>Brioche Backup</title>
+<meta name="author" content="Amand Tihon" />
+<meta name="date" content="Jan 5th, 2008" />
+<meta name="copyright" content="GNU GPL, see copyright file." />
+<style type="text/css">
+
+/*
+:Author: David Goodger (goodger@python.org)
+:Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
+:Copyright: This stylesheet has been placed in the public domain.
+
+Default cascading style sheet for the HTML output of Docutils.
+
+See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
+customize this style sheet.
+*/
+
+/* used to remove borders from tables and images */
+.borderless, table.borderless td, table.borderless th {
+ border: 0 }
+
+table.borderless td, table.borderless th {
+ /* Override padding for "table.docutils td" with "! important".
+ The right padding separates the table cells. */
+ padding: 0 0.5em 0 0 ! important }
+
+.first {
+ /* Override more specific margin styles with "! important". */
+ margin-top: 0 ! important }
+
+.last, .with-subtitle {
+ margin-bottom: 0 ! important }
+
+.hidden {
+ display: none }
+
+a.toc-backref {
+ text-decoration: none ;
+ color: black }
+
+blockquote.epigraph {
+ margin: 2em 5em ; }
+
+dl.docutils dd {
+ margin-bottom: 0.5em }
+
+/* Uncomment (and remove this text!) to get bold-faced definition list terms
+dl.docutils dt {
+ font-weight: bold }
+*/
+
+div.abstract {
+ margin: 2em 5em }
+
+div.abstract p.topic-title {
+ font-weight: bold ;
+ text-align: center }
+
+div.admonition, div.attention, div.caution, div.danger, div.error,
+div.hint, div.important, div.note, div.tip, div.warning {
+ margin: 2em ;
+ border: medium outset ;
+ padding: 1em }
+
+div.admonition p.admonition-title, div.hint p.admonition-title,
+div.important p.admonition-title, div.note p.admonition-title,
+div.tip p.admonition-title {
+ font-weight: bold ;
+ font-family: sans-serif }
+
+div.attention p.admonition-title, div.caution p.admonition-title,
+div.danger p.admonition-title, div.error p.admonition-title,
+div.warning p.admonition-title {
+ color: red ;
+ font-weight: bold ;
+ font-family: sans-serif }
+
+/* Uncomment (and remove this text!) to get reduced vertical space in
+ compound paragraphs.
+div.compound .compound-first, div.compound .compound-middle {
+ margin-bottom: 0.5em }
+
+div.compound .compound-last, div.compound .compound-middle {
+ margin-top: 0.5em }
+*/
+
+div.dedication {
+ margin: 2em 5em ;
+ text-align: center ;
+ font-style: italic }
+
+div.dedication p.topic-title {
+ font-weight: bold ;
+ font-style: normal }
+
+div.figure {
+ margin-left: 2em ;
+ margin-right: 2em }
+
+div.footer, div.header {
+ clear: both;
+ font-size: smaller }
+
+div.line-block {
+ display: block ;
+ margin-top: 1em ;
+ margin-bottom: 1em }
+
+div.line-block div.line-block {
+ margin-top: 0 ;
+ margin-bottom: 0 ;
+ margin-left: 1.5em }
+
+div.sidebar {
+ margin: 0 0 0.5em 1em ;
+ border: medium outset ;
+ padding: 1em ;
+ background-color: #ffffee ;
+ width: 40% ;
+ float: right ;
+ clear: right }
+
+div.sidebar p.rubric {
+ font-family: sans-serif ;
+ font-size: medium }
+
+div.system-messages {
+ margin: 5em }
+
+div.system-messages h1 {
+ color: red }
+
+div.system-message {
+ border: medium outset ;
+ padding: 1em }
+
+div.system-message p.system-message-title {
+ color: red ;
+ font-weight: bold }
+
+div.topic {
+ margin: 2em }
+
+h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
+h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
+ margin-top: 0.4em }
+
+h1.title {
+ text-align: center }
+
+h2.subtitle {
+ text-align: center }
+
+hr.docutils {
+ width: 75% }
+
+img.align-left {
+ clear: left }
+
+img.align-right {
+ clear: right }
+
+ol.simple, ul.simple {
+ margin-bottom: 1em }
+
+ol.arabic {
+ list-style: decimal }
+
+ol.loweralpha {
+ list-style: lower-alpha }
+
+ol.upperalpha {
+ list-style: upper-alpha }
+
+ol.lowerroman {
+ list-style: lower-roman }
+
+ol.upperroman {
+ list-style: upper-roman }
+
+p.attribution {
+ text-align: right ;
+ margin-left: 50% }
+
+p.caption {
+ font-style: italic }
+
+p.credits {
+ font-style: italic ;
+ font-size: smaller }
+
+p.label {
+ white-space: nowrap }
+
+p.rubric {
+ font-weight: bold ;
+ font-size: larger ;
+ color: maroon ;
+ text-align: center }
+
+p.sidebar-title {
+ font-family: sans-serif ;
+ font-weight: bold ;
+ font-size: larger }
+
+p.sidebar-subtitle {
+ font-family: sans-serif ;
+ font-weight: bold }
+
+p.topic-title {
+ font-weight: bold }
+
+pre.address {
+ margin-bottom: 0 ;
+ margin-top: 0 ;
+ font-family: serif ;
+ font-size: 100% }
+
+pre.literal-block, pre.doctest-block {
+ margin-left: 2em ;
+ margin-right: 2em }
+
+span.classifier {
+ font-family: sans-serif ;
+ font-style: oblique }
+
+span.classifier-delimiter {
+ font-family: sans-serif ;
+ font-weight: bold }
+
+span.interpreted {
+ font-family: sans-serif }
+
+span.option {
+ white-space: nowrap }
+
+span.pre {
+ white-space: pre }
+
+span.problematic {
+ color: red }
+
+span.section-subtitle {
+ /* font-size relative to parent (h1..h6 element) */
+ font-size: 80% }
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px }
+
+table.docinfo {
+ margin: 2em 4em }
+
+table.docutils {
+ margin-top: 0.5em ;
+ margin-bottom: 0.5em }
+
+table.footnote {
+ border-left: solid 1px black;
+ margin-left: 1px }
+
+table.docutils td, table.docutils th,
+table.docinfo td, table.docinfo th {
+ padding-left: 0.5em ;
+ padding-right: 0.5em ;
+ vertical-align: top }
+
+table.docutils th.field-name, table.docinfo th.docinfo-name {
+ font-weight: bold ;
+ text-align: left ;
+ white-space: nowrap ;
+ padding-left: 0 }
+
+h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
+h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
+ font-size: 100% }
+
+ul.auto-toc {
+ list-style-type: none }
+
+</style>
+</head>
+<body>
+<div class="document" id="brioche-backup">
+<h1 class="title">Brioche Backup</h1>
+<table class="docinfo" frame="void" rules="none">
+<col class="docinfo-name" />
+<col class="docinfo-content" />
+<tbody valign="top">
+<tr><th class="docinfo-name">Author:</th>
+<td>Amand Tihon</td></tr>
+<tr><th class="docinfo-name">Contact:</th>
+<td><<a class="reference external" href="mailto:amand.tihon@alrj.org">amand.tihon@alrj.org</a>></td></tr>
+<tr><th class="docinfo-name">Version:</th>
+<td>1.0</td></tr>
+<tr><th class="docinfo-name">Date:</th>
+<td>Jan 5th, 2008</td></tr>
+<tr><th class="docinfo-name">Copyright:</th>
+<td>GNU GPL, see copyright file.</td></tr>
+</tbody>
+</table>
+<!-- HTML version generated with rst2html -t README > README.html -->
+<div class="section" id="abstract">
+<h1>Abstract</h1>
+<p>Brioche is yet another backup shell script. Its main features are</p>
+<ul class="simple">
+<li>Full and differential backups</li>
+<li>LVM snapshots</li>
+<li>Xen+paravirt oriented (somehow)</li>
+<li>Soon: Upload to a distant FTP server.</li>
+</ul>
+</div>
+<div class="section" id="rationale">
+<h1>Rationale</h1>
+<p>Large numbers of backup solutions are freely available today, but when playing
+with incremental or differential backups, most of them rely on some filesystem
+capabilities, like <em>hard-linking</em>. If the only remote location available to
+store the backups is an FTP server, this is not a solution.
+Brioche relies on GNU tar's <tt class="docutils literal"><span class="pre">--listed-incremental</span></tt> option to create <em>real</em>
+differential <a class="footnote-reference" href="#diff" id="id1">[1]</a> archives.</p>
+<p>A second feature that makes Brioche interresting is the ability to use LVM
+snapshots. In the case of a Xen setup where the domUs use logical volumes as
+partitions, Brioche is able to backup everything from the dom0.</p>
+<table class="docutils footnote" frame="void" id="diff" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>Each differential backup is based upon the last <em>full</em> backup, unlike
+incremental, which are based upon the last (full or incremental) backup.</td></tr>
+</tbody>
+</table>
+</div>
+<div class="section" id="getting-brioche">
+<h1>Getting Brioche</h1>
+<p>You can download the tarball from <a class="reference external" href="http://www.alrj.org/projects/brioche">http://www.alrj.org/projects/brioche</a>
+or get the latest development version with the following git command:</p>
+<pre class="literal-block">
+git clone http://git.alrj.org/brioche.git
+</pre>
+</div>
+<div class="section" id="installation">
+<h1>Installation</h1>
+<p>Copy the three files <tt class="docutils literal"><span class="pre">brioche</span></tt>, <tt class="docutils literal"><span class="pre">brioche.conf</span></tt> and <tt class="docutils literal"><span class="pre">briochetab</span></tt> where
+you like, and set the <tt class="docutils literal"><span class="pre">CONFIG_FILE</span></tt> variable in the <tt class="docutils literal"><span class="pre">brioche</span></tt> script
+accordingly. If needed, run <tt class="docutils literal"><span class="pre">chmod</span> <span class="pre">+x</span> <span class="pre">/path/to/brioche</span></tt>.</p>
+</div>
+<div class="section" id="using-brioche">
+<h1>Using Brioche</h1>
+<div class="section" id="configuration">
+<h2>Configuration</h2>
+<p>Edit the file <tt class="docutils literal"><span class="pre">brioche.conf</span></tt> to suit your needs. Each option is commented
+inline and will be detailed here.</p>
+<dl class="docutils">
+<dt>BACKUPTAB</dt>
+<dd>Full absolute path to the briochetab file. This file describes which logical
+volumes and partitions must be backed up. Its format is explained in the
+<a class="reference internal" href="#defining-backups">Defining backups</a> section.</dd>
+<dt>MAILTO</dt>
+<dd>When the job is done, Brioche will send a summary of the operations by email.
+You can set it to any value that your <tt class="docutils literal"><span class="pre">mail</span></tt> command understands.</dd>
+</dl>
+<dl class="docutils" id="repodir">
+<dt>REPODIR</dt>
+<dd>Brioche will store all the generated archives in this directory.Note that
+before doing a full backup, Brioche will move all previous archives into an
+"undo" subdirectory, which will be removed only if the backup is successful.
+Make sure there's enough free space on the device where REPODIR is located.</dd>
+<dt>USAGE_WARN</dt>
+<dd>The report email will include a warning if the space used on REPODIR goes
+beyond the given threshold. The value must be an integer.</dd>
+<dt>COMPRESS</dt>
+<dd>This directive allows to specify the compression method to apply to the
+archives. Possible values are "gz", "bz2" and "lzma". <strong>Warning</strong> : lzma may
+not be available with older versions of GNU tar.</dd>
+<dt>TAR_OPTS</dt>
+<dd>Additionnal options that you may want to pass to tar. A typical value could
+be <tt class="docutils literal"><span class="pre">"--one-filesystem</span> <span class="pre">-S"</span></tt>. The first option will skip all other mointpoints
+(very usefull if you have /dev, /proc, /sys or REPODIR mounted under a device
+that must be archived). The second one will try to deal with sparse files.</dd>
+<dt>SNAPSHOT_MOUNTPOINT</dt>
+<dd>Sets the directory where the temporary LVM snapshots must be mounted.</dd>
+<dt>SNAPSHOT_NAME</dt>
+<dd>The name to use for the snapshot volumes.</dd>
+<dt>SNAPSHOT_SIZE</dt>
+<dd>Set the size of the snapshot volume. The same suffix than for lvcreate(8)
+are available.</dd>
+<dt>USE_FTP</dt>
+<dd>Still TODO.</dd>
+</dl>
+</div>
+<div class="section" id="defining-backups">
+<h2>Defining backups</h2>
+<p>The backups are defined in the file <tt class="docutils literal"><span class="pre">birochetab</span></tt>. Here is a typical example
+for a Xen config where cottman is the dom0 and syrtis, kadarin, valeron are
+domUs</p>
+<pre class="literal-block">
+# Partition or LV Snapshot Host name Volume name
+# ---------------------------------------------------------------
+/ no cottman root
+/usr no cottman usr
+
+/dev/vg00/valeron-root yes valeron root
+
+/dev/vg00/kadarin-root yes kadarin root
+/dev/vg00/kadarin-home yes kadarin home
+
+/dev/vg00/syrtis-root yes syrtis root
+/dev/vg00/syrtis-home yes syrtis home
+/dev/vg00/syrtis-usr yes syrtis usr
+/dev/vg00/syrtis-var yes syrtis var
+</pre>
+<p>Blank lines, or lines beginning with # are ignored.</p>
+<p>The first column defines the directory or logical volume to backup. In this
+example,the first two lines are plain directories, while the other ones point
+to LVM devices.</p>
+<p>The second column specify if the backup should be taken from an LVM snapshot or
+not. It <strong>must</strong> be set to "no" for the backup of a directory and to "yes" for
+the backup of a logical volume.</p>
+<p>The last two columns are more or less cosmetic, and define where the archive
+files will be stored, and how they'll be named. The destination directory will
+be created under the <a class="reference internal" href="#repodir">REPODIR</a>, and its name will be the value on the third
+column. Inside this directory, archive files will be named from the value given
+in the fourth column. For instance, a full and a differential backup for
+valeron would lead to the following structure</p>
+<pre class="literal-block">
+user:/REPODIR$ ls -l valeron/
+total 356544
+-rw-r--r-- 1 root root 363545613 Jan 3 03:10 root.full.20090103.tar.bz2
+-rw-r--r-- 1 root root 504722 Jan 3 03:10 root.full.snar
+-rw-r--r-- 1 root root 504725 Jan 4 04:06 root.incr.20090104.snar
+-rw-r--r-- 1 root root 160542 Jan 4 04:06 root.incr.20090104.tar.bz2
+</pre>
+</div>
+<div class="section" id="running-brioche">
+<h2>Running Brioche</h2>
+<p>Brioche understands the following arguments:</p>
+<table class="docutils option-list" frame="void" rules="none">
+<col class="option" />
+<col class="description" />
+<tbody valign="top">
+<tr><td class="option-group">
+<kbd><span class="option">-f</span>, <span class="option">--full</span></kbd></td>
+<td>Do a full backup (by default, brioche will do a differential).</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
+<td>Show a very limited help.</td></tr>
+</tbody>
+</table>
+<p>When everything is ready, execute the <tt class="docutils literal"><span class="pre">brioche</span></tt> script as root. The
+script is pretty verbose, so don't panic if you see lots of lines scrolling in
+your terminal. By default, Brioche will try to make differential backups, but
+will gracefully fall back and do a full backup if none is available.</p>
+<p>If all is fine, it can be added in the system crontab. Here's a suggestion for
+weekly full backup on Sunday, with differential during the weekdays</p>
+<pre class="literal-block">
+# Daily incremental backup
+30 3 * * 1-6 /usr/local/bin/brioche > /var/log/backup.`date "+%a"`.log 2>&1
+# Weekly full backup on Sunday
+30 3 * * 0 /usr/local/bin/brioche -f > /var/log/backup.`date "+%a"`.log 2>&1
+</pre>
+<p>The output of the script will be saved in /var/log/backup.DOW.log with DOW
+being the abbreviated day of the week (see man date(1) for the format).</p>
+</div>
+</div>
+<div class="section" id="bug-reporting">
+<h1>Bug reporting</h1>
+<p>There's no bugtracker for this project, your bug reports should be sent to the
+author : Amand Tihon <<a class="reference external" href="mailto:amand.tihon@alrj.org">amand.tihon@alrj.org</a>>. Please include as much information
+as possible in your report.</p>
+</div>
+<div class="section" id="references">
+<h1>References</h1>
+<ul class="simple">
+<li>GNU tar documentation : <a class="reference external" href="http://www.gnu.org/software/tar/manual/">http://www.gnu.org/software/tar/manual/</a></li>
+<li>LVM documentation and links : <a class="reference external" href="http://sourceware.org/lvm2/">http://sourceware.org/lvm2/</a></li>
+</ul>
+</div>
+</div>
+<div class="footer">
+<hr class="footer" />
+Generated on: 2009-01-05 19:27 UTC.
+
+</div>
+</body>
+</html>