Encrypted, compressed, distributed backups
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
net
util
.gitignore
CMakeLists.txt
README.md
archive.cpp
archive.h
archivefile.cpp
archivefile.h
commands.cpp
commands.h
compression.cpp
compression.h
crypto.cpp
crypto.h
deployment.pri
filetime.cpp
filetime.h
folderdb.cpp
folderdb.h
main.cpp
node.cpp
node.h
nodedb.cpp
nodedb.h
pathhash.cpp
pathhash.h
protocol.txt
serialize.cpp
serialize.h
server.cpp
server.h
servercommands.cpp
settings.cpp
settings.h
sighandlers.cpp
sighandlers.h
source.cpp
source.h
sourcefile.cpp
sourcefile.h
threadedworker.cpp
threadedworker.h

README.md

tbak

A simple yet somewhat powerful backup tool I made in a weekend after my hard drive crashed. The main thing I use it for is backing up source code. It supports compression, encryption, and per-backup synchronisation accross several nodes.

There are two concepts, Folders and Nodes.

A folder is a self-contained backup, it can be either a source or an archive. A source folder contains just some metadata, whereas an archive folder contains metadata plus a compressed and encrypted copy of your files.

A node is a computer running tbak, when you add a remote node to your own local node, you basically grant that remote node full powers over your own node's backups, so only connect two nodes if you trust both of them.

Folders can be synchronised accross multiple nodes, and only the last compressed and encrypted version of every file will be backed-up on each node. Each node has a full copy of each folder, but only the node that owns the source folder has the keys to decrypt the files.

Example usage

Assuming that your local node is already linked to some remote nodes (the remote node added you, and you added it), then this is how you would create a new backup and broadcast it to other nodes :

tbak folder add-source /some/folder/somewhere
tbak folder push /some/folder/somewhere

Then you would just run tbak folder push /some/folder/somewhere any time you want to synchronise your folder with other nodes, this can for example be done as a cron job.

Compiling

This code is not portable C++, it was written for Linux and uses several advanced non-portable features not available in standard C++ like directories and sockets...

The libraries used are libbrotli for compression, libsodium for encryption and Boost Lockfree. The project uses CMake as a build system, version 3.1 minimum.