bakonf home page is http://www.nongnu.org/bakonf/. The project is hosted at http://savannah.nongnu.org/projects/bakonf/.
You can regard bakonf as a rescue archive creator. It creates an archive of configuration files and metadata information about the system. By metadata, I mean data which is not found anywhere in the filesystem as simple files: partition table layout, hardware configuration, kernel version, etc.
Table 1. Archive layout
Filename | Description | Created when |
---|---|---|
README | A file which contains informations about the archive: when it was generated, with wich options and on what host | Always |
unarchived_files.lst | A file which contains details about which files couldn't be backed up; this can happen when bakonf is not run as root, or when it scans NFS directories | When filesystem backup has been performed |
commands_with_errors.lst | A file which contains details about which commands have exited with non-zero status. Their output is still stored in the archive, though. | When metadata backup has been performed |
filesystem/ | Under this path are stored the files backed up. | When filesystem backup has been performed |
metadata/ | Under this path are stored the files resulted from metadata backup. | When metadata backup has been performed |
Bakonf can be operated in two modes: level 0, level 1. In level 0, it archives all of the specified configuration files and registers the state of those configuration files in a database (called virtuals database), of type Berkley DB. In level 1, it archives only the files modified since the last level 0 backup; it does this by comparing the virtuals database with the filesystem.
Here is how bakonf treats files
they won't be archived if they don't contain files to be backed up. On the other hand, for each file to be backed up, bakonf will also backup (non-recursively) its parent directories (except root) so that you have the user, group, mtime and permissions of each directory. For example, if /usr/local/etc/myconfig has been selected for archiving, bakonf will actually archive this list of items: /usr, /usr/local, /usr/local/etc, /usr/local/etc/myconfig.
regular files will be archived by bakonf if they aren't excluded by the noscan configuration directive. In case this is a partial backup (as opossed to a full backup), bakonf will make the following tests:
size of file saved in database ≠ actual file size? if true, the file will be backed up;
md5 hash saved ≠ actual md5 hash? if true, file will be backed up;
sha hash save ≠ actual sha hash? if true file will be backed up;
file will not be backed up.
Here we could introduce another form of backup, only file metadata backup, in case file contents hasn't changed, but file mode (permissions, owner) have.
bakonf doesn't follow symbolic links ever; it treats a symbolic link like a configuration file (its configration value resided in its name and its target). The tests made by bakonf are, in order:
link target must be equal, or the file is backed up
user and group ownership must be equal, or the file is backed up
permission bits must be equal, or the file is backed up
the file is not backed up
bakonf always selects these to backed up. Of course, some of them won't be backed up by tar, but regarding bakonf, it will select those for backup.
in this case, bakonf always selects the file for archiving
Metadata allows you to have more information about a system than is available in the filesystem. The current implementation allows you to store output of shell commands. Suggestions about other items are welcome.
The most important metadata item is partition table about your disks, in the eventuality that you have a data error in partition table. The command to back this up varies, for example:
OS: GNU/Linux
Command: sfdisk -d /dev/hda
OS: FreeBSD
Command: fdisk /dev/ad0
Having the device list is and their hardware configuration is useful in order to have a quick overview if you want to clone the configuration from one system to another (to see corespondece between config files and hardware config). Examples of scanning the configuration:
OS: GNU/Linux
Command(s): lspci -vv; lsusb -vv
OS: FreeBSD
Command(s): pciconf -lv; usbdevs -v
At least for:
Configuration rollback. Since the archives are small, you can keep many versions, but unlike in differential backup, here one archive contains all the needed data.
Configuration cloning. You can take a bakonf-generated archive from one system to another and 'clone' as much of the settings as you want.
Quick restore of a server in case of catastrofic harddisk failure. Just reinstall the OS and put the config files back.
To use bakonf, you must have the following:
a Unix-like operating system (with compatible filesystem layout)
python version 2.2 or higher
optik - command line parser for python, version 1.3 or higher
tarfiel - tar module for python (it is expected to be include in python 2.3)
bz2 bzip interface module for python, only if you want bzip2-compressed archives
xml parsing support for python, in order to use python's xml.dom.minidom; feel free to hack bakonf to change the configuration system if you want so