NAME
katarina - rsync based multi profile, multi servers backup system
SYNOPSIS
help mode :
[-h] [-H]
backup mode :
-t backup -n cyclename -p profilename [-m]
retry mode :
-t retry -n cyclename -p profilename [-m]
verify clients mode :
-t check -p profilename
use: -t mode :
backup : to actualy backup
check : to verify clients availability
use: -h : to read this
use: -H : to read perldoc
use: -m : report by mail
use: -s : report on screen
use: -n : to specify cycle name (daily, weekly...)
use: -p profilename : to specify $config_dir/profilename.kat
DESCRIPTION
katarina is a perl backup system.
It reads its config in a text file (perl syntax) to determine global parameters a list of targets with specific parameters
Remote data is backed up using rsync. An rsync agent must be running on the remote system and available for the katarina server.
When using copy mode, data directories are rotated using cp -la which means data is deduplicated server by server (not between different servers). Old directories are recycled if possible to avoid re-creation of the last rotated backup.
When using snap mode, you should have a volume for backup_dir. Snaphosts will then be created globaly and not server by server. Links will be made to keep the same kind of access to backup history for each server.
Global parameters in config file can be :
active : 0 or 1 to globaly (de)activate the profile
mail : email address of the Katarina administrators
forks : number of concurrent backup threads
backup_dir : root directory for backups
rotate_mode : rotation mode : "copy" or "snap"
copy will use cp -la like command (default value)
snap will use zfs snapshot or custom command
premounted : abort if this filesystem is not mounted in order
to not fill wrong partitions
cycle : hash of different cycles and the time to keep data
before expiration. This can be used to define daily
profiles, weekly or much more complicated policies.
See EXAMPLES below.
exclude : array of remote directories to exclude
bwlimit : bandwith limit (in kByte) to be applied to every
server
rmcmd : rm command. For example : ionice -c 3 /bin/rm
cpcmd : cp command. For example : ionice -c 3 /bin/cp
rsynccmd : rsync command. For example :
ionice -c 3 /usr/local/bin/rsync
snap_create_cmd : snapshot creation command. For example : zfs snapshot
snap_remove_cmd : snapshot remove command. For example : zfs destroy
snap_sub_dir : snapshots subdirectory. For example :
.zfs/snapshot/ (relative to $backup_dir)
rsyncretries : number of rsync tries if it fails
Specific server parameters in config file can be :
active : 0 or 1 to to (de)activate the server
ip : IP address (v4 or v6) to use to connect to server if
servername is not an FQDN
module : name of the rsync module to use on remote server. If
not specified, it will be "katarina"
exclude : array of remote directories to exclude (in addition to
those given in global parameter)
bwlimit : bandwith limit (in kByte). Replace the provided global
value (if provided)
Rotation modes
Note that there is no data conversion between copy mode and snapshot mode You need to start from your last daily (or whatever cycle you have defined) clean links, directories and/or snapshots up.
EXAMPLES
Configuration files should be placed in /etc/katarina
Here is a .kat example configuration file :
our %globals = (
"mail" => "root@example.com",
"active" => 1,
"forks" => 2,
# 2 threads will be used to backup in parallel
"backup_dir" => "/backup/test",
# directory used to write servers data
"premounted" => "/backup",
# abort if this filesystem is not mounted in order
# to not fill wrong partitions
"rotate_mode"=> "copy",
"cycles" => {
"daily" => {
"method" => "rsync",
"retention" => (7 * 86400) },
# Keep up daily backups younger than 7 days
"weekly" => {
"method" => "use daily",
# Do not rsync to the server for this backup : use
# the existing "daily" archives to build last "weekly"
"retention" => (30 * 86400) },
# Keep up weekly backups younger than 30 days
},
"exclude" => [
"lost+found/", "tmp/", "proc/", "sys/",
"selinux/", "dev/",
"media/", "lib/init/rw" ],
);
our %targets = (
"server1.example.com" => {
"active" => 1,
"exclude" => [
"/backup",
],
},
"server2.example.com" => {
"active" => 1,
"ip" => 192.168.42.42,
},
"server3.example.com" => {
"active" => 0,
# This one is in maintenance: no backup will be done
},
"server4.example.com" => {
"active" => 1,
"ip" => 192.168.42.43,
"module" => "export",
# rsyncd.conf on the backuped host specifies "export" as
# a rsync module.
},
);
For this configuration file the following crons could be used :
# Daily backup 0 6 * * * root katarina.pl -t backup -m -p test -n daily # Weekly backup 0 6 * * 0 root katarina.pl -t backup -m -p test -n weekly
A scheduler is provided in order to handle daily like launch when you have to backup a lot of profiles on the same server. See katarina-scheduler.
Here is a rsyncd.conf configuration that can be used on the backed-up clients :
pid file=/var/run/rsyncd.pid [katarina] comment = Katarina Backup path = / use chroot = no lock file = /var/lock/rsyncd read only = yes list = yes uid = root gid = root ignore errors = no ignore nonreadable = no transfer logging = no timeout = 600 refuse options = checksum dry-run hosts allow = 192.168.0.1
Cycles can be freely defined :
"cycles" => {
"minutly" => {
"method" => "rsync",
"retention" => 60 },
# Keep up daily backups younger than 1 minute
"what_I_want" => {
"method" => "use minutly",
# Use the las "minutly" backup to generate the last
# "what_I_want" backup
"retention" => (42 * 60) },
# Keep up backups younger than 42 minutes
},
AUTHOR
Cyril Bellot <jcpp@users.sourceforge.net>