VBackup - A modular backup utility
==================================

This is a collection of scripts that perform backup to systems.
It should support most of the unices out there (everything different should be
reported as a bug).

This version of vbackup can backup:

    * Postgresql databases
    * MySQL databases
    * Filesystems using GNU tar
    * XFS filesystems using xfsdump

The backup procedure is completely customizable and extendable by the user.

Requirements:
=============

 * GNU find
 * GNU tar - for the tar method
 * xfsdump - for the xfsdump method

Installation:
=============

# ./configure --sysconfdir=/etc
# make
# make install

This will install vbackup to /usr/local and assume the configuration files will
be placed at /etc/vbackup

Usage:
======

For usage run:
# vbackup --help

For a list of backup methods (scripts) run:
# vbackup --list

To get some information about a module run:
# vbackup --help <module>

example:
# vbackup --help xfsdump

Setup:
======

NOTE: You can skip this and just use the vbackup-wizard script.
      Take a look at the "Wizard" section.

Let's assume you want to
    * Backup to an NFS mounted space
    * Perform backup of two partitions using xfsdump (full and incremental)
    * Perform backup of directories using tar (full and incremantal)
    * Perform mysql and pgsql backup

1.  Go to /etc/vbackup and create a folder named rc.d. This will hold all the
    configuration scripts.
2.  Copy from the samples directory ($prefix/share/vbackup/samples) the
    following scripts to rc.d:
    * sample.nfsmount
    * sample.umount
    * sample.xfsdump
    * sample.mysql
    * sample.pgsql
    * sample.umount

3.  Rename sample.nfsmount to remote.nfsmount. (Any name with the extension
    .nfsmount will do) and edit it. Change the values of the variables to fit
    your needs.
4.  Rename sample.umount to remote.umount and edit it. Just set the mountpoint
    to umount.
5.  Rename sample.mysql to full.mysql and edit it. Read the note at the top of
    the script and set variables as needed.
6.  Rename sample.pgsql to full.pgsql and edit it.
7.  Copy sample.tar to level0.tar an edit it. Set the level to 0
8.  Rename sample.tar to level5.tar and edit it. Set the level to 5
9.  Copy sample.xfsdump to level0.xfsdump and edit it. Set the level to 0
10. Rename xfsdump to level5.xfsdump and edit it. Set the level to 5

11. Create two directories named backup.0 and backup.5 under /etc/vbackup
12. Enter backup.0 and create softlinks to the desired configuration files:
    # ln -s ../rc.d/remote.nfsmount 00-remote.nfsmount
    # ln -s ../rc.d/remote.umount 99-remote.umount
    # ln -s ../rc.d/full.mysql 10-full.mysql
    # ln -s ../rc.d/full.pgsql 10-full.pgsql
    # ln -s ../rc.d/level0.tar 20-level0.tar
    # ln -s ../rc.d/level0.xfsdump 30-level0.xfsdump
13. Enter backup.1 and create softlinks:
    # ln -s ../rc.d/remote.nfsmount 00-remote.nfsmount
    # ln -s ../rc.d/remote.umount 99-remote.umount
    # ln -s ../rc.d/level5.tar 20-level5.tar
    # ln -s ../rc.d/level5.xfsdump 30-level5.xfsdump
14. Copy to backup.0 and backup.1 the vbackup.conf.sample from the samples
    directory. Rename it to vbackup.conf and edit it as needed.
15. Check the configuration using:
    # vbackup --check 0
    # vbackup --check 5

To perform level 0 backup run
# vbackup 0

To perform level 5 backup run
# vbackup 5

Basic setup using the wizard:
=============================

There is a wizard script that will help you create basic configuration files.
Most probably you will want to use this one the first time. For more advanced
configuration and fine-tunning you will have to adjust the configuration files
yourself. Read the rest of this file to fully understand how you can use
vbackup.

To launch the wizard run:
# vbackup-wizard

and just answer its questions. The wizard also serves as an introduction.

How it works:
=============

When you run:
# vbackup 0

The script enters directory /etc/vbackup/backup.0 and searches for files named
XX-name.module, where <XX> is a number and <module> is a backup module/method.
All configurations are examined in an alphabetical order, so that the <XX>
prefix may be used to indicate the order. For each configuration file,
coresponding module (<module>) is executed using the configuration file
options. A module may be used from zero to many times.

This way you'll have to create configuration files once and perform various
types of backups, depending on your needs.

The verbosity of the backup procedure may be controlled using the -d parameter.
Level 7 is recommended.

Backups that fail will not stop the backup procedure. There are however some
errors that will stop everything (ex: when failing to mount a filesystem)

Available modules:
==================

The following modules are available:

mount:	    Mount a partition
nfsmount:   Mount an NFS share
umount:	    Umount a partition
exist:	    Check whether a file/dir exists
tar:	    Perform filesystem backup using GNU tar
xfsdump:    Perform filesystem backup using xfsdump
mysql:	    Dump mysql databases
pgsql:	    Dump pgsql databases
dpkg:	    Backup debian dpkg database
mbr:	    Backup MBRs and partition tables
scp:	    Copy a local file to a remote host using scp
rm:	    Remove a file

More:
=====

More information about how vbackup actually works can be found in README.dev

Copyright:
==========

    Copyright (c) 2006-2008 Harhalakis Stefanos

License:
========

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

Contact:
========

    For bug reports, recommendations or anything else, you can find me at
    v13@v13.gr. I'll be glad to hear from you.

    The latest vbackup can be found at:
    http://www.it.teithe.gr/~v13/

Extending:
==========

    If you're interested in extending vbackup, just read the README.dev and
    have a look at the existing modules (I recommend mount and tar/xfsdump).
    A template for new modules is available with the name 'skel' under the
    scripts/ directory of the source code.

    If you believe you've created something that will be usefull for others
    too, I'll be glad to include it in the distribution (preserving your
    copyright of course)

vim: set ts=8 sts=4 sw=4 noet formatoptions=rtcn textwidth=79:

