UberBackup

UberBackup aims to be a highly configurable multi-target backup solution for Unix-like operating systems where simpler approaches just aren't good enough.

Features

Multiple archives

Define one or more backup archives. An archive can backup any number of paths you specify, as well as excluding particular paths. No need to try and bundle everything into one big all-inclusive archive. Combine this with multiple targets to backup different files to different places.

Multiple targets

Backing up data isn't always simple, with various constraints such as importance, disk space and (for offsite backups) bandwidth. Multiple targets let you store different archives in different places, and even the same archive in more than one place. Got some data that is extremely important? You can easily back it up to several remote locations meaning it will even survive local disasters. Got large files to backup that aren't so important? Uploading them to a remote location probably isn't feasible, but you can still protect them by backing up to another machine on your network or a removable hard drive.

Command hooks

Specify commands to run before and after backing up a particular archive. This is especially useful for network mounts or removable hard drives.

Example configuration

This example configuration is probably the best way to explain the use of the features of UberBackup:

<UberBackup>
 
    <!--
        DEFAULT OPTIONS
 
        These control things such as file name and 'tar' options, and can be
        overridden per-archive by specifying the same elements within <Archive>
        blocks.  These options all represent the defaults and can be omitted if
        they do not need to be changed.
    -->
 
    <!-- Base path for non-relative paths -->
    <BasePath>/</BasePath>
    <!-- Directory to build the archives in -->
    <BuildPath>/tmp</BuildPath>
    <!-- Default filename format -->
    <Format>%(hostname)-%(archivename)-%(date)-%(time)</Format>
    <!-- Stay in local filesystem? -->
    <OneFileSystem>false</OneFileSystem>
    <!-- Dereference symlinks? -->
    <Dereference>false</Dereference>
    <!-- Archive compression? 'none', 'gz' or 'bz2' -->
    <Compression>none</Compression>
 
 
    <!--
        TARGET DEFINITIONS
 
        A <Target> block defines a location where archives can be saved.  All
        Targets specified outside of <Archive> blocks must be given a unique 
        name so they can be used by Archives.
    -->
    <Target name="local" type="directory">
        <PreHook>mount /var/backups</PreHook>
        <PostHook>umount /var/backups</PostHook>
        <Path>/var/backups</Path>
    </Target>
 
    <Target name="iris" type="scp">
        <Host>iris.codescape.net</Host>
        <User>backups</User>
        <KeyFile>/root/id_rs_backup</KeyFile>
        <Path>/home/alan/backups</Path>
    </Target>
 
 
    <!--
        ARCHIVE DEFINITIONS
 
        An <Archive> block specifies what to backup and to where.  Each archive
        must have a unique name, which is used as part of its filename, and at
        least one Target.
    -->
 
    <!-- Backup multiple locations, with exclusions -->
    <Archive name="everything">
        <Include>/home</Include>
        <Include>/etc</Include>
        <Include>/var</Include>
 
        <Exclude>/var/apt/cache</Exclude>
        <Exclude>/var/tmp</Exclude>
 
        <!-- Use a pre-defined Target by its name -->
        <Target name="local" />
    </Archive>
 
    <!-- Backup /home, gzip-compressed -->
    <Archive name="home">
        <Compression>gz</Compression>
 
        <Include>/home</Include>
 
        <Target name="local" />
    </Archive>
 
    <!-- Backup /home/alan, but running a command before and after -->
    <Archive name="home-alan">
        <PreHook>find /home/alan/Videos > /home/alan/.video-list</PreHook>
        <PostHook>rm -f /home/alan/.video-list</PostHook>
 
        <Include>/home/alan</Include>
 
        <Target name="local" />
    </Archive>
 
    <!-- Backup some home directories, but use /home as the base path so it's
         not part of the hierarchy in the archive -->
    <Archive name="home-simple">
        <BasePath>/home</BasePath>
 
        <Include>alan</Include>
        <Include>somebody</Include>
 
    </Archive>
 
    <!-- Backup stuff listed in a file: <IncludeList> specifies a file that 
         contains newline-separated paths to include. -->
    <Archive name="home-alan">
        <IncludeList>/home/alan/.backup-list</IncludeList>
 
        <Target name="local" />
    </Archive>
 
    <!-- The same as above but for everybody -->
    <Archive name="home">
        <IncludeList>/home/*/.backup-list</IncludeList>
 
        <Target name="local" />
    </Archive>
 
    <!-- Backup projects directory both offsite and onsite -->
    <Archive name="projects">
        <Include>/home/alan/Projects</Include>
 
        <Target name="local" />
        <!-- Backup to a second location -->
        <Target name="iris" />
 
        <!-- ... and backup to a third location.  "Anonymous" <Target> blocks 
             can be specified within <Archive> blocks! -->
        <Target type="scp">
            <Host>somewhere.com</Host>
            <Port>443</Port>
            <User>someone</User>
            <KeyFile>/home/someone/id_rsa</KeyFile>
            <Path>/home/someone</Path>
        </Target>
    </Archive>
</UberBackup>
uberbackup/root.txt · Last modified: 2009/05/01 13:07 by alan
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki