From 5430e18aa198b619dd5e4a812dccc96751aba970 Mon Sep 17 00:00:00 2001 From: Amand Tihon Date: Tue, 6 Jan 2009 16:54:21 +0100 Subject: [PATCH] FTP support, less (or different) bugs, updated documentation. * Add FTP upload, requires lftp. * Correct a few bugs: - Don't use -a option with tar, since older versions don't understand it. * Small improvements - Use functions to set the final status (SUCCESS, WARNING, ERROR, CRITICAL) * Update documentation: - Document the FTP part. - Add a section about requirements. - Add a warning about REPODIR being on a backed up device. - Remove examples from the script itself, everything is in README. - Some cosmetic changes. - Renamed briochetab to briochetab.example. --- README | 125 ++++++++++++++++++++++--- README.html | 149 +++++++++++++++++++++++++----- TODO | 12 ++- brioche | 151 ++++++++++++++++++++++--------- brioche.conf | 21 +++-- briochetab => briochetab.example | 0 changelog | 18 ++++ 7 files changed, 382 insertions(+), 94 deletions(-) rename briochetab => briochetab.example (100%) diff --git a/README b/README index 74652af..21e198e 100644 --- a/README +++ b/README @@ -6,10 +6,15 @@ Brioche Backup :Author: Amand Tihon :Contact: -:Version: 1.0 +:Version: 1.1 :Date: Jan 5th, 2008 :Copyright: GNU GPL, see copyright file. +.. sectnum:: + +.. contents:: Table of contents + :backlinks: none + Abstract ======== @@ -18,8 +23,8 @@ Brioche is yet another backup shell script. Its main features are - Full and differential backups - LVM snapshots -- Xen+paravirt oriented (somehow) -- Soon: Upload to a distant FTP server. +- Xen oriented (somehow) +- Upload to a distant FTP server. Rationale @@ -45,17 +50,35 @@ Getting Brioche =============== You can download the tarball from http://www.alrj.org/projects/brioche -or get the latest development version with the following git command:: +or get the latest development version with the following git command: :: git clone http://git.alrj.org/git/brioche.git +A gitweb interface is also available at http://git.alrj.org/ + + +Requirements +============ + +Brioche relies on a few easily available free software : + +- In any case, Brioche will require GNU tar, which is able to deal with + incremental backups. Don't even try it with any other tar implementation. + Tested with version 1.16. +- For LVM snapshots, lvm2 will obviously be needed. +- FTP backups, if they're used, will require lftp. + +See the `References`_ section for links to the aforementioned softwares. + Installation ============ Copy the three files ``brioche``, ``brioche.conf`` and ``briochetab`` where you like, and set the ``CONFIG_FILE`` variable in the ``brioche`` script -accordingly. If needed, run ``chmod +x /path/to/brioche``. +accordingly. If needed, run ``chmod +x /path/to/brioche``. In a typical setup, +the ``brioche`` script will be put in ``/usr/local/bin`` with the other two +files under ``/etc``. Using Brioche @@ -95,9 +118,10 @@ COMPRESS TAR_OPTS Additionnal options that you may want to pass to tar. A typical value could - be ``"--one-filesystem -S"``. 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. + be ``"--one-file-system -S"``. 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. SNAPSHOT_MOUNTPOINT Sets the directory where the temporary LVM snapshots must be mounted. @@ -110,7 +134,20 @@ SNAPSHOT_SIZE are available. USE_FTP - Still TODO. + If set to "yes", Brioche will upload the backups on an FTP server. + See the `Using FTP`_ section for more information about this feature. + +FTP_HOST + The address of the FTP server. + +FTP_DIR + The base directory on the FTP server under which all the archives will be + stored. Brioche will never touch anything that is not below this directory. + +FTP_KEEP + Tells Brioche to keep a certain amount of older runs on the FTP. A *run* is + a full backup plus all its subsequent differential backups. See the `Using + FTP`_ section for a more detailed explanation. Defining backups @@ -118,7 +155,7 @@ Defining backups The backups are defined in the file ``birochetab``. Here is a typical example for a Xen config where cottman is the dom0 and syrtis, kadarin, valeron are -domUs :: +domUs: :: # Partition or LV Snapshot Host name Volume name # --------------------------------------------------------------- @@ -149,8 +186,11 @@ 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 REPODIR_, 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 :: +in the fourth column. Grouping by domUs' hostnames is only a suggestion, it can +be completely different and adapted to suit your needs. + +For instance, a full and a differential backup for the host valeron of the +previous example would lead to the following structure: :: user:/REPODIR$ ls -l valeron/ total 356544 @@ -159,13 +199,68 @@ valeron would lead to the following structure :: -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 ++--------------------------------------------------------------------------+ +| **WARNING !** | +| | +| In case your REPODIR_ is not on a distinct device, it will be included | +| in the backup if you've included the device in your ``briochetab``. | +| | +| To avoid this issue, you can either exclude it explicitely by adding an | +| "``--exclude=...``" option in TAR_OPTS, or simply specify in your | +| ``briochetab`` file which directories need to be archived. | ++--------------------------------------------------------------------------+ + + +Using FTP +--------- + +With the help of lftp, Brioche is able to store an history of backups on an FTP +server. This is mainly usefull when no other distant repository is available. +If possible, consider using an CIFS, NFS, sshfs or any other kind of remote +mountpoint for your REPODIR_. + +The archives present in the local REPODIR_ will be mirrored to the FTP server +after each backup, be it a full or a differential one. + +Since there is no way to hide the credentials if they are passed to lftp on the +command line, the authentication relies on your ``.netrc`` file. See ``man +netrc(5)`` for more information. In the home directory of the user that runs +Brioche (typically root's), create the ``.netrc`` file with the following +lines: :: + + machine ftp.example.com + login username + password SikRet + +Don't forget to secure it with ``chmod 600 .netrc`` or lftp will refuse to use +it. The machine name must match the FTP_HOST configuration directive in +``brioche.conf``. + +On the FTP server, Brioche will keep a configurable amount of *runs*. +Each *run* consists of a full backup and all the differential backups that are +based on it. Before doing a full backup, Brioche will rotate the +*runs* and keep only the configured number of older backups. The current +backups can always be found under ``/FTP_DIR/hostname/latest/``. Older ones +will be under ``/FTP_DIR/hostname/run-X/`` with *X* equal to 1 for the previous +run, 2 for the one before and so forth, up to the value of FTP_KEEP. + +Here's what happens during the rotation: + +- the oldest run is removed +- all the ``run-X/`` directories are shifted (``run-3/`` becomes ``run-4/``, + etc) +- the ``latest/`` directory is renamed to ``run-1/`` +- a new, empty, ``latest/`` directory is created, ready to accept the new files. + + Running Brioche --------------- Brioche understands the following arguments: --f, --full Do a full backup (by default, brioche will do a differential). +-f, --full Do a full backup (by default, brioche will try to do a + differential). -h, --help Show a very limited help. When everything is ready, execute the ``brioche`` script as root. The @@ -174,7 +269,7 @@ 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. 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 :: +weekly full backup on Sunday, with differential during the weekdays: :: # Daily incremental backup 30 3 * * 1-6 /usr/local/bin/brioche > /var/log/backup.`date "+%a"`.log 2>&1 @@ -199,7 +294,7 @@ References - GNU tar documentation : http://www.gnu.org/software/tar/manual/ - LVM documentation and links : http://sourceware.org/lvm2/ - +- lftp homepage : http://lftp.yar.ru/ diff --git a/README.html b/README.html index 1c27382..160a982 100644 --- a/README.html +++ b/README.html @@ -298,7 +298,7 @@ ul.auto-toc { Contact: <amand.tihon@alrj.org> Version: -1.0 +1.1 Date: Jan 5th, 2008 Copyright: @@ -306,18 +306,37 @@ ul.auto-toc { +
-

Abstract

+

1   Abstract

Brioche is yet another backup shell script. Its main features are

  • Full and differential backups
  • LVM snapshots
  • -
  • Xen+paravirt oriented (somehow)
  • -
  • Soon: Upload to a distant FTP server.
  • +
  • Xen oriented (somehow)
  • +
  • Upload to a distant FTP server.
-

Rationale

+

2   Rationale

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 hard-linking. If the only remote location available to @@ -336,23 +355,38 @@ incremental, which are based upon the last (full or incremental) backup.

-

Getting Brioche

+

3   Getting Brioche

You can download the tarball from http://www.alrj.org/projects/brioche or get the latest development version with the following git command:

 git clone http://git.alrj.org/git/brioche.git
 
+

A gitweb interface is also available at http://git.alrj.org/

+
+
+

4   Requirements

+

Brioche relies on a few easily available free software :

+
    +
  • In any case, Brioche will require GNU tar, which is able to deal with +incremental backups. Don't even try it with any other tar implementation. +Tested with version 1.16.
  • +
  • For LVM snapshots, lvm2 will obviously be needed.
  • +
  • FTP backups, if they're used, will require lftp.
  • +
+

See the References section for links to the aforementioned softwares.

-

Installation

+

5   Installation

Copy the three files brioche, brioche.conf and briochetab where you like, and set the CONFIG_FILE variable in the brioche script -accordingly. If needed, run chmod +x /path/to/brioche.

+accordingly. If needed, run chmod +x /path/to/brioche. In a typical setup, +the brioche script will be put in /usr/local/bin with the other two +files under /etc.

-

Using Brioche

+

6   Using Brioche

-

Configuration

+

6.1   Configuration

Edit the file brioche.conf to suit your needs. Each option is commented inline and will be detailed here.

@@ -379,9 +413,10 @@ archives. Possible values are "gz", "bz2" and "lzma&quo not be available with older versions of GNU tar.
TAR_OPTS
Additionnal options that you may want to pass to tar. A typical value could -be "--one-filesystem -S". 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.
+be "--one-file-system -S". 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.
SNAPSHOT_MOUNTPOINT
Sets the directory where the temporary LVM snapshots must be mounted.
SNAPSHOT_NAME
@@ -390,14 +425,24 @@ that must be archived). The second one will try to deal with sparse files.
Set the size of the snapshot volume. The same suffix than for lvcreate(8) are available.
USE_FTP
-
Still TODO.
+
If set to "yes", Brioche will upload the backups on an FTP server. +See the Using FTP section for more information about this feature.
+
FTP_HOST
+
The address of the FTP server.
+
FTP_DIR
+
The base directory on the FTP server under which all the archives will be +stored. Brioche will never touch anything that is not below this directory.
+
FTP_KEEP
+
Tells Brioche to keep a certain amount of older runs on the FTP. A run is +a full backup plus all its subsequent differential backups. See the Using +FTP section for a more detailed explanation.
-

Defining backups

+

6.2   Defining backups

The backups are defined in the file birochetab. Here is a typical example for a Xen config where cottman is the dom0 and syrtis, kadarin, valeron are -domUs

+domUs:

 # Partition or LV           Snapshot    Host name     Volume name
 # ---------------------------------------------------------------
@@ -425,8 +470,10 @@ the backup of a logical volume.

files will be stored, and how they'll be named. The destination directory will be created under the REPODIR, 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

+in the fourth column. Grouping by domUs' hostnames is only a suggestion, it can +be completely different and adapted to suit your needs.

+

For instance, a full and a differential backup for the host valeron of the +previous example would lead to the following structure:

 user:/REPODIR$ ls -l valeron/
 total 356544
@@ -435,9 +482,61 @@ total 356544
 -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
 
+ +++ + + + + +

WARNING !

+

In case your REPODIR is not on a distinct device, it will be included +in the backup if you've included the device in your briochetab.

+

To avoid this issue, you can either exclude it explicitely by adding an +"--exclude=..." option in TAR_OPTS, or simply specify in your +briochetab file which directories need to be archived.

+
+
+
+

6.3   Using FTP

+

With the help of lftp, Brioche is able to store an history of backups on an FTP +server. This is mainly usefull when no other distant repository is available. +If possible, consider using an CIFS, NFS, sshfs or any other kind of remote +mountpoint for your REPODIR.

+

The archives present in the local REPODIR will be mirrored to the FTP server +after each backup, be it a full or a differential one.

+

Since there is no way to hide the credentials if they are passed to lftp on the +command line, the authentication relies on your .netrc file. See man +netrc(5) for more information. In the home directory of the user that runs +Brioche (typically root's), create the .netrc file with the following +lines:

+
+machine ftp.example.com
+login username
+password SikRet
+
+

Don't forget to secure it with chmod 600 .netrc or lftp will refuse to use +it. The machine name must match the FTP_HOST configuration directive in +brioche.conf.

+

On the FTP server, Brioche will keep a configurable amount of runs. +Each run consists of a full backup and all the differential backups that are +based on it. Before doing a full backup, Brioche will rotate the +runs and keep only the configured number of older backups. The current +backups can always be found under /FTP_DIR/hostname/latest/. Older ones +will be under /FTP_DIR/hostname/run-X/ with X equal to 1 for the previous +run, 2 for the one before and so forth, up to the value of FTP_KEEP.

+

Here's what happens during the rotation:

+
    +
  • the oldest run is removed
  • +
  • all the run-X/ directories are shifted (run-3/ becomes run-4/, +etc)
  • +
  • the latest/ directory is renamed to run-1/
  • +
  • a new, empty, latest/ directory is created, ready to accept the new files.
  • +
-

Running Brioche

+

6.4   Running Brioche

Brioche understands the following arguments:

@@ -445,7 +544,8 @@ total 356544 - + @@ -456,7 +556,7 @@ 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.

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

+weekly full backup on Sunday, with differential during the weekdays:

 # Daily incremental backup
 30  3  *  *  1-6  /usr/local/bin/brioche > /var/log/backup.`date "+%a"`.log 2>&1
@@ -468,22 +568,23 @@ being the abbreviated day of the week (see man date(1) for the format).

-

Bug reporting

+

7   Bug reporting

There's no bugtracker for this project, your bug reports should be sent to the author : Amand Tihon <amand.tihon@alrj.org>. Please include as much information as possible in your report.

-

References

+

8   References

diff --git a/TODO b/TODO index 8b4024c..7034459 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,10 @@ -* Implement FTP storage. -* Don't keep undo directory if FTP backup is used. -* Better yet, don't keep any archive and snar, except the full.snar if FTP backup is used. +Brioche to-do list, in random order. + +* No need to keep undo directory if FTP backup is used. +* Better yet, don't keep any archive and snar locally, except the full.snar if + FTP backup is used. +* Usage of FTP could be specified in briochetab for each backup. * Snapshot size specified in briochetab, or automatically determined. +* Implement hooks, in various parts of the script, that would allow to run + external commands (for instance, to freeze a database just before making a + snapshot). diff --git a/brioche b/brioche index cedd8ed..8e0597a 100755 --- a/brioche +++ b/brioche @@ -20,13 +20,6 @@ # # Note: This script relies on GNU tar specific options, # do not attempt to use it as-is with other tar implementations. -# -# -# Example of use, from crontab -# # 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 # Mandatory @@ -48,12 +41,10 @@ SNAPSHOT_NAME="backup-snap" SNAPSHOT_SIZE="5G" USAGE_WARN="80" -# TODO: Implement the storage on a distant FTP USE_FTP="no" -#FTP_HOST="ftpback.example.com" -#FTP_USER="username" -#FTP_PASS="password" -#FTP_KEEP="4" +FTP_HOST="ftpback.example.com" +FTP_DIR="/" +FTP_KEEP="4" # Ensure that we have a minimal PATH PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -86,6 +77,26 @@ summary() echo $@ >> $SUMMARY } +# Set final status to CRITICAL +set_critical() +{ + FINAL_STATUS="CRITICAL" +} + +set_error() +{ + if [ "$FINAL_STATUS" != "CRITICAL" ]; then + FINAL_STATUS="ERROR" + fi +} + +set_warning() +{ + if [ "$FINAL_STATUS" == "SUCCESS" ]; then + FINAL_STATUS="WARNING" + fi +} + finish() { # Check free space @@ -93,9 +104,7 @@ finish() log "${REPODIR} usage after backup: ${usage}%." if [ "$usage" -ge "$USAGE_WARN" ]; then - if [ "$FINAL_STATUS" = "SUCCESS" ]; then - FINAL_STATUS="WARNING" - fi + set_warning summary "Warning : Filesystem ${REPODIR} is ${usage}% full." fi @@ -240,23 +249,71 @@ make_incr_backup() fi # Prepare the copy of the snar file - cp $fullsnar $destsnar + cp "$fullsnar" "$destsnar" # Do the actual backup. Destination file name and snar are like # /backup/valeron/root.incr.20090105.tar.bz2 # /backup/valeron/root.incr.20090105.snar log "Running tar..." - tar -caf ${destfile} ${TAR_OPTS} ${COMPRESS_OPT} -g ${destsnar} $1 + tar -cf ${destfile} ${TAR_OPTS} ${COMPRESS_OPT} -g ${destsnar} $1 if [ ! "$?" = "0" ]; then - log "Error $?: Could not archive $hostname - $volumename" + log "Error $?: Could not archive $2 - $3" return 1 fi return 0 } +####################################################################### +# FTP functions +####################################################################### +# Push everything in the directory given in $1 to the FTP server, under +# /FTP_DIR/$2/latest +ftp_push() +{ + log "Mirror $1 on FTP (${FTP_HOST})." + local source="${1}" + local target="${FTP_DIR}/${2}/latest" + local command="mkdir -p ${target}; cd ${target}" + command="${command}; mirror --reverse --only-newer --verbose ${source}" + + lftp -e "${command}; exit" ${FTP_HOST} +} + +# Rotate old files on FTP +# Usage: ftp_rotate group +ftp_rotate() +{ + log "Rotating backups of $1 on FTP (${FTP_HOST})." + local lastrun="run-${FTP_KEEP}" + local target="${FTP_DIR}/${1}" + local commands="mkdir -p ${target}; cd ${target}" + + # Build commands + # Remove oldest run + if [ "$FTP_KEEP" != "0" ]; then + commands="$commands; rmdir ${lastrun}" + + # Move everything back + for run in `seq $FTP_KEEP -1 2`; do + local newer=$run + let "newer -= 1" + commands="$commands; mv run-$newer run-$run" + done + # Move "old latest" to run-1 + commands="$commands; mv latest run-1" + else + commands="$commands; rmdir latest" + fi + + # Create "new latest" directory + commands="$commands; mkdir latest; exit" + + # Run the commands on the FTP server + lftp -e "$commands" $FTP_HOST +} ####################################################################### # Start here ####################################################################### @@ -270,14 +327,14 @@ then source "${CONFIG_FILE}" else summary "Error: Unable to read configuration file ${CONFIG_FILE}. Aborting." - FINAL_STATUS="CRITICAL" + set_critical finish fi if [ ! -r "${BACKUPTAB}" ] then summary "Error: Unable to read ${BACKUPTAB}. Aborting." - FINAL_STATUS="CRITICAL" + set_critical finish fi @@ -315,6 +372,14 @@ esac # Parse backuptab file, call backup functions for each line ####################################################################### +# Rotate FTP groups on full +if [ "$USE_FTP" = "yes" -a "$DO_FULL_BACKUP" = "yes" ]; then + for group in `grep -v -E '^[[:space:]]*(#.*)?$' $BACKUPTAB | awk '{print $3}' | sort -u` + do + ftp_rotate $group + done +fi + # Ignore empty and commented lines grep -v -E '^[[:space:]]*(#.*)?$' $BACKUPTAB | tr -s [:space:]| while read line do @@ -332,7 +397,7 @@ do make_snapshot $vg $lv if [ "$?" != "0" ]; then summary "Could not take a snapshot of $device" - FINAL_STATUS="ERROR" + set_error continue # Next one fi @@ -341,10 +406,10 @@ do RETVAL="$?" if [ "$RETVAL" != "0" ]; then summary "Could not mount the snapshot of $device" - FINAL_STATUS="ERROR" + set_error if [ "$RETVAL" = "100" ]; then summary "Could not remove the snapshot !" - FINAL_STATUS="CRITICAL" + set_critical finish fi continue @@ -364,7 +429,7 @@ do summary "INCREMENTAL backup of $device done on `NOW`." elif [ "$RETVAL" = "1" ]; then summary "Error during incremental backup of $device" - FINAL_STATUS="ERROR" + set_error elif [ "$RETVAL" = "2" ]; then summary "Can't do an incremental backup without a full one being present." summary "Switching to full backup for $device" @@ -373,11 +438,11 @@ do summary "FULL backup of $device done on `NOW`." else summary "Error during full backup of $device" - FINAL_STATUS="ERROR" + set_error fi else summary "Unknown error during incremental backup of $device" - FINAL_STATUS="ERROR" + set_error fi else # Do a full backup make_full_backup ${BACKUP_SOURCE} $group $volume @@ -385,7 +450,7 @@ do summary "FULL backup of $device done on `NOW`." else summary "Error during full backup of $device" - FINAL_STATUS="ERROR" + set_error fi fi @@ -396,35 +461,31 @@ do unmount_snapshot $vg if [ "$?" != "0" ]; then summary "Could not unmount snapshot !" - FINAL_STATUS="CRITICAL" + set_critical finish fi remove_snapshot $vg if [ "$?" != "0" ]; then summary "Could not destroy the snapshot !" - FINAL_STATUS="CRITICAL" + set_critical finish fi fi + done -finish +# Push everything on the FTP +if [ "$USE_FTP" = "yes" ]; then + summary "" + for group in `grep -v -E '^[[:space:]]*(#.*)?$' $BACKUPTAB | awk '{print $3}' | sort -u` + do + ftp_push "$REPODIR/$group" $group + summary "Mirrored ${group} to ${FTP_HOST}." + done +fi -## Example Backup description table -## -## Can handle logical volumes, with snapshots, or plain mountpoints. -## Priority is not used yet. -# -## Partition or LV Snapshot Host name Volume name Priority -## ---------------------------------------------------------------------------- -#/ no cottman root 1 -#/dev/vg00/kadarin-root yes kadarin root 1 -#/dev/vg00/valeron-root yes valeron root 1 -#/dev/vg00/syrtis-root yes syrtis root 1 -#/dev/vg00/syrtis-home yes syrtis home 1 -#/dev/vg00/syrtis-usr yes syrtis usr 1 -#/dev/vg00/syrtis-var yes syrtis var 1 -#/dev/vg00/syrtis-srv yes syrtis srv 1 + +finish diff --git a/brioche.conf b/brioche.conf index b191bdb..fd82863 100644 --- a/brioche.conf +++ b/brioche.conf @@ -22,7 +22,7 @@ USAGE_WARN="80" COMPRESS="gz" # TAR_OPTS: Additionnal options to the tar invocation. -TAR_OPTS="--one-filesystem -S" +TAR_OPTS="--one-file-system -S" # SNAPSHOT_MOUNTPOINT: Where to mount the temporary LVM snaphot SNAPSHOT_MOUNTPOINT="/mnt/backup-snapshot" @@ -35,10 +35,17 @@ SNAPSHOT_NAME="brioche-snapshot" # automatically, rendering the backup unusable. SNAPSHOT_SIZE="5G" -# USE_FTP: Not yet implemented. -USE_FTP="no" +# USE_FTP: Mirror the local backup directory on a remote FTP +USE_FTP="yes" -# FTP_HOST="ftpback.example.com" -# FTP_USER="username" -# FTP_PASS="password" -# FTP_KEEP="4" +# FTP_HOST: address of the FTP server +FTP_HOST="ftp.example.com" + +# FTP_DIR: Target directory on the FTP server +FTP_DIR="/" + +# Authentication must be performed with .netrc to avoid giving login/password +# on the command line. + +# How many old full runs sould be kept on the FTP server +FTP_KEEP="4" diff --git a/briochetab b/briochetab.example similarity index 100% rename from briochetab rename to briochetab.example diff --git a/changelog b/changelog index 786edc5..9fbf98f 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,21 @@ +brioche 1.1 + + [ Amand Tihon ] + * Add FTP upload, requires lftp. + * Correct a few bugs: + - Don't use -a option with tar, since older versions don't understand it. + * Small improvements + - Use functions to set the final status (SUCCESS, WARNING, ERROR, CRITICAL) + * Update documentation: + - Document the FTP part. + - Add a section about requirements. + - Add a warning about REPODIR being on a backed up device. + - Remove examples from the script itself, everything is in README. + - Some cosmetic changes. + - Renamed briochetab to briochetab.example. + + -- Amand Tihon Mon, 6 Jan 2008 17:00:00 +0100 + brioche 1.0 [ Amand Tihon ] -- 2.39.2
-f, --fullDo a full backup (by default, brioche will do a differential).
Do a full backup (by default, brioche will try to do a +differential).
-h, --help Show a very limited help.