Encrypted, compressed, distributed backups
C++ QMake Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
net
util Dedicated serialization thread for file upload Oct 21, 2015
.gitignore
CMakeLists.txt Dedicated serialization thread for file upload Oct 21, 2015
README.md
archive.cpp
archive.h
archivefile.cpp
archivefile.h
commands.cpp Upload sorted by path, not by hash Oct 21, 2015
commands.h
compression.cpp
compression.h
crypto.cpp
crypto.h
deployment.pri Refactor command handling out of main Oct 15, 2015
filetime.cpp
filetime.h
folderdb.cpp
folderdb.h
main.cpp
node.cpp Refactor ThreadedWorker serializations into Node Oct 18, 2015
node.h
nodedb.cpp
nodedb.h
pathhash.cpp
pathhash.h 7x faster 'folder show' operations for sources Oct 21, 2015
protocol.txt Refactor command handling out of main Oct 15, 2015
serialize.cpp
serialize.h
server.cpp
server.h
servercommands.cpp Fix type mismatch in auth check Oct 18, 2015
settings.cpp
settings.h
sighandlers.cpp
sighandlers.h
source.cpp 7x faster 'folder show' operations for sources Oct 21, 2015
source.h
sourcefile.cpp
sourcefile.h 7x faster 'folder show' operations for sources Oct 21, 2015
threadedworker.cpp Dedicated serialization thread for file upload Oct 21, 2015
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.