6 :Contact: <amand.tihon@alrj.org>
9 :Copyright: GNU GPL, see copyright file.
15 Brioche is yet another backup shell script. Its main features are
17 - Full and differential backups
19 - Xen+paravirt oriented (somehow)
20 - Soon: Upload to a distant FTP server.
26 Large numbers of backup solutions are freely available today, but when playing
27 with incremental or differential backups, most of them rely on some filesystem
28 capabilities, like *hard-linking*. If the only remote location available to
29 store the backups is an FTP server, this is not a solution.
30 Brioche relies on GNU tar's ``--listed-incremental`` option to create *real*
31 differential[#diff]_ archives.
33 .. [#diff] Each differential backup is based upon the last *full* backup, unlike
34 incremental, which are based upon the last (full or incremental)
37 A second feature that makes Brioche interresting is the ability to use LVM
38 snapshots. In the case of a Xen setup where the domUs use logical volumes as
39 partitions, Brioche is able to backup everything from the dom0.
44 You can download the tarball from http://www.alrj.org/projects/brioche
45 or get the latest development version with the following git command::
47 git clone http://git.alrj.org/brioche.git
53 Copy the three files ``brioche``, `` brioche.conf`` and ``briochetab`` where
54 you like, and set the ``CONFIG_FILE`` variable in the ``brioche`` script
55 accordingly. If needed, run ``chmod +x /path/to/brioche``.
64 Edit the file ``brioche.conf`` to suit your needs. Each option is commented
65 inline and will be detailed here.
68 Full absolute path to the briochetab file. This file describes which logical
69 volumes and partitions must be backed up. Its format is explained in the
70 `Defining backups`_ section.
73 When the job is done, Brioche will send a summary of the operations by email.
74 You can set it to any value that your ``mail`` command understands.
79 Brioche will store all the generated archives in this directory.Note that
80 before doing a full backup, Brioche will move all previous archives into an
81 "undo" subdirectory, which will be removed only if the backup is successful.
82 Make sure there's enough free space on the device where REPODIR is located.
85 The report email will include a warning if the space used on REPODIR goes
86 beyond the given threshold. The value must be an integer.
89 This directive allows to specify the compression method to apply to the
90 archives. Possible values are "gz", "bz2" and "lzma". **Warning** : lzma may
91 not be available with older versions of GNU tar.
94 Additionnal options that you may want to pass to tar. A typical value could
95 be ``"--one-filesystem -S"``. The first option will skip all other mointpoints
96 (very usefull if you have /dev, /proc, /sys or REPODIR mounted under a device
97 that must be archived). The second one will try to deal with sparse files.
100 Sets the directory where the temporary LVM snapshots must be mounted.
103 The name to use for the snapshot volumes.
106 Set the size of the snapshot volume. The same suffix than for lvcreate(8)
116 The backups are defined in the file ``birochetab``. Here is a typical example
117 for a Xen config where cottman is the dom0 and syrtis, kadarin, valeron are
120 # Partition or LV Snapshot Host name Volume name
121 # ---------------------------------------------------------------
125 /dev/vg00/valeron-root yes valeron root
127 /dev/vg00/kadarin-root yes kadarin root
128 /dev/vg00/kadarin-home yes kadarin home
130 /dev/vg00/syrtis-root yes syrtis root
131 /dev/vg00/syrtis-home yes syrtis home
132 /dev/vg00/syrtis-usr yes syrtis usr
133 /dev/vg00/syrtis-var yes syrtis var
135 Blank lines, or lines beginning with # are ignored.
137 The first column defines the directory or logical volume to backup. In this
138 example,the first two lines are plain directories, while the other ones point
141 The second column specify if the backup should be taken from an LVM snapshot or
142 not. It **must** be set to "no" for the backup of a directory and to "yes" for
143 the backup of a logical volume.
145 The last two columns are more or less cosmetic, and define where the archive
146 files will be stored, and how they'll be named. The destination directory will
147 be created under the REPODIR_, and its name will be the value on the third
148 column. Inside this directory, archive files will be named from the value given
149 in the fourth column. For instance, a full and a differential backup for
150 valeron would lead to the following structure ::
152 user:/REPODIR$ ls -l valeron/
154 -rw-r--r-- 1 root root 363545613 Jan 3 03:10 root.full.20090103.tar.bz2
155 -rw-r--r-- 1 root root 504722 Jan 3 03:10 root.full.snar
156 -rw-r--r-- 1 root root 504725 Jan 4 04:06 root.incr.20090104.snar
157 -rw-r--r-- 1 root root 160542 Jan 4 04:06 root.incr.20090104.tar.bz2
163 Brioche understands the following arguments:
165 -f, --full Do a full backup (by default, brioche will do a differential).
166 -h, --help Show a very limited help.
168 When everything is ready, execute the ``brioche`` script as root. The
169 script is pretty verbose, so don't panic if you see lots of lines scrolling in
170 your terminal. By default, Brioche will try to make differential backups, but
171 will gracefully fall back and do a full backup if none is available.
173 If all is fine, it can be added in the system crontab. Here's a suggestion for
174 weekly full backup on Sunday, with differential during the weekdays ::
176 # Daily incremental backup
177 30 3 * * 1-6 /usr/local/bin/brioche > /var/log/backup.`date "+%a"`.log 2>&1
178 # Weekly full backup on Sunday
179 30 3 * * 0 /usr/local/bin/brioche -f > /var/log/backup.`date "+%a"`.log 2>&1
181 The output of the script will be saved in /var/log/backup.DOW.log with DOW
182 being the abbreviated day of the week (see man date(1) for the format).
188 There's no bugtracker for this project, your bug reports should be sent to the
189 author : Amand Tihon <amand.tihon@alrj.org>. Please include as much information
190 as possible in your report.
196 GNU tar documentation : http://www.gnu.org/software/tar/manual/
197 LVM documentation and links : http://sourceware.org/lvm2/