Note | |
---|---|
Older bakonf versions (< 0.5) had an entirely different config file. If you upgraded, be sure to forward you changes to the new config files. |
bakonf uses a main configuration file /etc/bakonf/bakonf.xml, which does some standard settings and tells bakonf what other files to include. These additional files are usually located in /etc/bakonf/sources and tell bakonf how to handle some special cases.
The configuration file is written in XML, and must have the document tag bakonf.
The file can contain the following tags:
tells bakonf to also parse any files which match the given shell pattern. These are files which modify bakonf's own behavior, and are usually located in /etc/bakonf/sources. These are not directories to be backed up! (Altough, if modified, they will be, since are located under /etc usually).
Starts declarations about files to be backed up, and can contain:
tells bakonf to add any file or directory which matched shell pattern PATTERN to its include list. These can be files or directories. Bakonf will descend directories, but will not follow symbolic links! The symlinks are considered configuration items also, so they will be backeup up themselves.
tells bakonf to ignore any file or directory which matches the regular expression REGEXP from the archive; it won't even open or analise those files.
Starts declarations about metainformations to be included in the archive, and can contain:
Tells bakonf to execute the given SHELL-COMMAND and include its output in a file named metadata/PATH IN ARCHIVE in the created archive. For example, the element:
<storeoutput command="cat /proc/version" destination="proc/version"/>will create a file in the archive with the name metadata/proc/version which will contain the /proc/version file.
The order of precedence for scan/noscan is:
bakonf will start scanning all items defined with scan
if at any point in the filesystem scan, the current file/directory mathes any one of noscan REGEXPs, the scan will ignore it. For directories, that means ignoring all the files they contain, so please be careful about it.
Using these, you can select where you want bakonf to look for files for archiving. The default config file includes /etc, /usr/etc, /usr/local/etc and some others (look in /etc/bakonf after installing).
Example main configuration file (the file included in the distribution):
<bakonf> <!-- Bakonf main configuration file. Tune to your system. See also the files in the sources subdirectory (included by default) --> <filesystem> <!-- Standard directories --> <scan path="/etc" /> <scan path="/usr/etc" /> <scan path="/usr/local/etc" /> <scan path="/var/lib/alternatives" /> </filesystem> <!-- Include by default the other configuration files --> <include path="/etc/bakonf/sources/*.xml" /> </bakonf>
Example GNU/Linux proc configuration file (included in the distribution):
<bakonf> <!-- File which contains hardware related informations, mostly extracted from the /proc filesystem (under GNU/Linux) --> <metadata> <!-- Proc values --> <storeoutput command="cat /proc/version" destination="proc/version"/> <storeoutput command="cat /proc/dma" destination="proc/dma"/> <storeoutput command="cat /proc/interrupts" destination="proc/interrupts"/> <storeoutput command="cat /proc/ioports" destination="proc/ioports"/> <storeoutput command="cat /proc/iomem" destination="proc/iomem"/> <storeoutput command="cat /proc/cpuinfo" destination="proc/cpuinfo"/> <storeoutput command="cat /proc/partitions" destination="proc/partitions"/> <!-- Also hardware information --> <storeoutput command="/sbin/lspci -vv" destination="lspci.txt"/> <storeoutput command="/sbin/lsusb -vv" destination="lsusb.txt"/> </metadata> </bakonf>
bakonf is composed of:
Main configuration file.
Configuration files for special cases (config files outside of etc dirs).
Main program
Cron file, by default it does not run bakonf, you must uncomment a line to run it.
Default directory for configuration file archives.
You must decide yourself what to do with the configuration archives after bakonf creates them! |