bKappa

bKappa is a 2009 experiment in crude but transparent and cross-platform incremental backup. bKappa backups are simple directory trees and lists of files. They are easy to browse and examine and do not use symbolic or hard links. It is crude in the sense that bKappa only tracks files by name, not by content. This means it cannot detect when a file has been renamed and makes full copies of renamed and partially changed files.

bKappa is written in Python. It generates standalone restore scripts for the POSIX shell and PowerShell 1.0 and later that do not require Python. The PowerShell scripts are cross-platform.

While bKappa 1.x saw some real use on the developer’s machines, it is not heavily-tested the way backup software should be. The 2024 update bKappa 2 was made to satisfy curiosity rather than for production. Do not trust bKappa to preserve important data.

You can download bKappa from SourceForge.

Requirements

bKappa requires Python 3.7 or later. Using evaluated settings requires Starlark-PyO3 to be installed. You can install Starlark-PyO3 in a venv.

Documentation

bkappa.sourceforge.io/old houses outdated documentation written for version 1.x.

bKappa creates snapshots in repositories. bKappa repositories are directories with a structure that bKappa recognizes. You can back up multiple source directories to a repository. Source directories are the top-level directories of your backups. A snapshot is a backup copy of any number of source directories that for every directory may reference previous snapshots of the same directory.

To avoid conflicts, back up only one source directory with a particular name per repository.

Only a single bKappa process should be using a repository at any time. In the current version it is up to the user to ensure this (for example, through locking in a cron job).

bKappa is configured with a text configuration file that can be one of two types. The first type contains lines with a source directory path followed by optional exclusion patterns. Each part of the line is separated with the pipe character |. This is called “non-evaluated settings”. The exclusion patterns are Python fnmatch patterns applied to whole paths.

/home/foo/Documents
/home/foo|*/Downloads/*|*/Documents/*

The second type contains lines with Python-like Starlark expressions that can reference built-in and environment variables. They are called “evaluated settings”. The following is an example of evaluated settings. It similar to the non-evaluated example but uses a variable for the home directory.

(home + "/Documents", [])
(home, ["*/Downloads/*", "*/Documents/*"])

bKappa defines these additional global variables for evaluated expressions:

Example

Here is how you can create and restore a snapshot on a POSIX system.

mkdir -p /tmp/bkappa/repo/
mkdir /tmp/bkappa/source/
echo '/tmp/bkappa/source' > /tmp/bkappa/repo/settings.ne
echo 'Hello, world!' > /tmp/bkappa/source/test-file
./backup.py /tmp/bkappa/repo/
./backup.py /tmp/bkappa/repo/ -r /tmp/bkappa/repo/*/restore.json -o /tmp/bkappa/restore/
cat /tmp/bkappa/restore/tmp/bkappa/source/test-file

Alternatives

Changelog

License

bKappa is free software distributed under the MIT License. See the file LICENSE for details.

SourceForge logo.