evobackup/README.md

91 lines
2.5 KiB
Markdown
Raw Normal View History

2017-01-13 20:29:36 +01:00
Bkctld (aka evobackup)
=========
Bkctld is a shell script to create and manage a backup server which will
handle the backup of many servers (clients). Licence is AGPLv3.
The main principle uses SSH chroot (called "jails" in the FreeBSD
world) for each client to backup. Each client will upload his data every day
using rsync in his chroot (using root account).
Incrementals are stored outside of the chroot using hard links or btrfs snapshots.
(So incrementals are not available for clients). Using this method we can keep tens
of backup of each client securely and not using too much space.
2017-03-17 11:06:53 +01:00
~~~
2017-01-13 20:29:36 +01:00
Backup server
************
Server 1 ------ SSH/rsync -------> * tcp/2222 *
* *
Server 2 ------ SSH/rsync -------> * tcp/2223 *
************
2017-03-17 11:06:53 +01:00
~~~
2017-01-13 20:29:36 +01:00
This method uses standard tools (ssh, rsync, cp -al, btrfs subvolume). EvoBackup
is used for many years by Evolix for back up each day hundreds of servers which
uses many terabytes of data.
bkctld was test on Debian Jessie. It can be compatible with other Debian version
or derivated distribution like Ubuntu or Debian Wheezy.
A big size volume must be mount on /backup, we recommend usage of **btrfs** for
subvolume and snapshot fonctionnality.
This volume can be encrypted by **luks** for security reason.
## Install
A Debian package is available in Evolix repository
~~~
2017-02-10 11:31:08 +01:00
echo "http://pub.evolix.net/ jessie/" >> /etc/apt/sources.list
2017-01-13 20:29:36 +01:00
apt update
apt install bkctld
~~~
2017-05-17 16:44:47 +02:00
### Chroot dependency
Chroot jail use part of this package
~~~
apt install bash coreutils sed dash mount rsync openssh-server openssh-sftp-server libc6-i386 libc6
~~~
2017-01-13 20:29:36 +01:00
#### Install cron for incremental backup
Edit root crontab
~~~
crontab -e
~~~
Add this ligne
~~~
30 10 * * * /usr/sbin/bkctld inc && /usr/sbin/bkctld rm
~~~
> **Notes :**
> If you want mutiples backups in a day (1 by hour maximum) you can run `bkctld inc` multiples times
> If you want keep incremental backup **for ever**, you just need don't run `bkctld rm`
## Usage
~~~
man bkctld
~~~
#### Client configuration
You can save various systems on evobackup jail : Linux, BSD, Windows, MacOSX. Only prequisites is rsync command.
~~~
rsync -av -e "ssh -p SSH_PORT" /home/ root@SERVER_NAME:/var/backup/home/
~~~
2017-12-04 10:56:45 +01:00
An example script is present in zzz_evobackup, clone evobackup repo and read **CLIENT CONFIGURATION** section of the manual.
2017-01-13 20:29:36 +01:00
~~~
2017-02-09 09:48:38 +01:00
git clone https://forge.evolix.org/evobackup.git
2017-01-13 20:29:36 +01:00
cd evobackup
man ./docs/bkctld.8
2017-02-09 09:48:38 +01:00
~~~