Managing SSH chroots to backup a lot of machines
Go to file
Patrick Marchand f6755170ce Forgot to delete old man(1) instructions 2018-12-29 04:35:04 +01:00
docs Swich source documentation from markdown to mdoc(7) 2018-12-28 22:16:17 -05:00
test Add bats test for generate jails with different times 2018-05-30 18:33:36 +02:00
tpl Use touch instead of lastlog in sshrc 2017-08-30 17:24:45 +02:00
.gitignore Add a Vagrantfile for test with Vagrant 2018-03-05 14:15:23 +01:00
LICENSE fix file name 2017-08-05 17:33:00 -04:00
README.md Forgot to delete old man(1) instructions 2018-12-29 04:35:04 +01:00
Vagrantfile Check if disk is mounted in bkctld check 2018-11-29 17:04:40 +01:00
bash_completion Add stats subcommands 2018-06-13 15:22:21 +02:00
bkctld btrfs is now in /bin 2018-12-04 16:11:00 +01:00
bkctld.8 Swich source documentation from markdown to mdoc(7) 2018-12-28 22:16:17 -05:00
bkctld.conf Swich source documentation from markdown to mdoc(7) 2018-12-28 22:16:17 -05:00
bkctld.conf.5 Swich source documentation from markdown to mdoc(7) 2018-12-28 22:16:17 -05:00
bkctld.sysvinit Extract debian dir from ustream repo 2017-01-19 15:02:11 +01:00
evobackup-incl.5 Swich source documentation from markdown to mdoc(7) 2018-12-28 22:16:17 -05:00
zzz_evobackup Swich source documentation from markdown to mdoc(7) 2018-12-28 22:16:17 -05:00

README.md

Bkctld (aka evobackup)

Bkctld is a shell script that creates and manages a backup server which can handle the backups of many other servers (clients). It is licensed under the AGPLv3.

It uses SSH chroots (called "jails" in the FreeBSD world) to sandbox every clients backups. Each client will upload it's data every day using rsync in it's chroot (using the root account). Prior backups are stored incrementally outside of the chroot using hard links or BTRFS snapshots. (So they can not be affected by the client).

Using this method, we can keep a large quantity of backups of each client securely and efficiently.

                                    Backup server
                                    ************
Server 1 ------ SSH/rsync ------->  * tcp/2222 *
                                    *          *
Server 2 ------ SSH/rsync ------->  * tcp/2223 *
                                    ************

This method uses standard tools (ssh, rsync, cp -al, btrfs subvolume) and has been used for many years by Evolix to backup hundreds of servers, totaling many terabytes of data, each day. bkctld has been tested on Debian Jessie and should be compatible with other Debian versions or derived distributions like Ubuntu.

A large enough volume must be mounted on /backup, we recommend the usage of BTRFS so you can use sub-volumes and snapshots. This volume can also be encrypted with LUKS.

Install

See the installation guide for instructions.

Testing

You can deploy test environments with Vagrant :

vagrant up

Deployment

Launch rsync-auto in a terminal for automatic synchronization of your local code with Vagrant VM :

vagrant rsync-auto

Bats

You can run bats tests with the test provision :

vagrant provision --provision-with test

Usage

See docs/usage.md or bkctld(8)

Client configuration

You can save various systems in the evobackup jails : Linux, BSD, Windows, MacOSX. The only prerequisite is the rsync command.

rsync -av -e "ssh -p SSH_PORT" /home/ root@SERVER_NAME:/var/backup/home/

An example synchronization script is present in zzz_evobackup, clone the evobackup repository and read the CLIENT CONFIGURATION section of the manual.

git clone https://forge.evolix.org/evobackup.git
cd evobackup
man ./docs/bkctld.8