Sie sind hier: Backup » rsback » Konfiguration
Deutsch
English

Konfigurationsbeispiel

rsback erwartet eine Konfigurationsdatei, in der globale Einstellungen festgelegt sind und für jede Backup-Aufgabe (task) die notwendigen Parameter enthalten sind.

Hier eine Konfigurationsdatei mit einigen typischen Beispielen:

Konfigurationsdatei - Beispiel
# rsback sample configuration
#
# This file is expected as /etc/rsback/rsback.conf by default.
#
# If you want to have it somewhere else, use
#
#   rsback.pl -c <config-file> ...
#
# or change the path of the default configuration file
# in rsback ($rsback_conf).
#
# hjb -- 2007-11-25

#-----------------------------------------------------
#
# global parameters
#

[global]

#
# location of some commands we need
#
rsync_cmd = /usr/bin/rsync
cp_cmd = /bin/cp
mv_cmd = /bin/mv
rm_cmd = /bin/rm
mkdir_cmd = /bin/mkdir


#
# List of backup tasks
#
# For each backup tree you specify here there must exist a corresponding section
# describing the individual backup tasks. E.g., if you define
#   backup = work-daily work-weekly libs
# the sections [work-daily], [work-weekly] and [libs] must follow.

tasks = vs-work-daily vs-work-weekly \
        vs-work2-daily vs-work2-weekly \
        stoffel stoffel2 \
        vs-mail-daily vs-mail-daily-update

# The directory where the lock files will be created.
# Specify a directory by giving an absolute path without a
# trailing slash
#
lock_dir = /var/lock

#
# additional rsync options used in backup mode 'rsync'
#
# options used in any case are: -al --delete --delete-excluded --exclude-from=...
#
;rsync_options = -v --stats
rsync_options = -val --delete --delete-excluded --stats --numeric-ids


#
# File patterns to exclude from backup regardless of the backup task
#
# -optional-
exclude_file = /etc/rsback/global.exclude

#
# If the current task is locked by an other task (see lock_dir above)
# then this parameter may be used to try to restart the task after some
# time of delay.
# The default delay value is 10 minutes.
#
# -optional-
if_locked_retry = 3 10m

#
# This defines how to proceed if a system command used by rsback
# fails. A value of 'no' means that subsequent tasks given on the
# command line are skipped (this is the default behaviour). If this
# parameter is set to 'yes' then only the actual task is aborted but
# following tasks, given on the command line, are started as if no error
# has occured.
#
# -optional-
if_error_continue = yes

#
# use rsync's --link-dest option
# 
# Do not use '--link-dest' as an explicit rsync_option below!
#
# -optional-
use_link_dest = yes

#
# ignore these rsync error codes at all
#
# -optional-
# used here:
#   10: Error in socket I/O
#   12: Error in rsync protocol data stream
#   24: Partial transfer due to vanished source files
ignore_rsync_errors = 10 12 24


#-----------------------------------------------------
#
# backup of VServer work on the remote host 'mother'
#

[vs-work-daily]
#
# rsync runs on the remote host mother as a daemon.
# We are connected to mother via an OpenVPN tunnel,
# so we dont't have to use encryption.
#
source = rsback@mother::vs-work
destination = /BACKUP1/mother/vservers/work
rotate = daily 10
mode = rsync
rsync_options = -al --delete --delete-excluded --stats  --password-file /etc/rsback/mother/secret

[vs-work-weekly]
#
# The weekly backup is taken from the most recent daily backup set in the local repository.
# We use hard-links (mode = link) for weekly backups to save disk space.
#
source = /BACKUP1/mother/vservers/work/daily.1/
destination = /BACKUP1/mother/vservers/work
rotate = weekly 12
mode = link

#......................................................
#
# duplicate the backups from above on the second backup disk mounted to /BACKUP2
#

[vs-work2-daily]
source = /BACKUP1/mother/vservers/work/daily.1/
destination = /BACKUP2/mother/vservers/work
rotate = daily 10
mode = rsync
rsync_options = -al --delete --delete-excluded --stats

[vs-work2-weekly]
source = /BACKUP2/mother/vservers/work/daily.1/
destination = /BACKUP2/mother/vservers/work
rotate = weekly 12
mode = link

#-----------------------------------------------------
#
# Backup data storage from remote host stoffel
#

[stoffel]
#
# stoffel is connected to the internet via DSL dialup-link.
# Therefore we limit the bandwidth used by rsync to keep the
# dial-up link usable for some other services on stoffel.
# We connect as user 'rsback' via ssh to the remote system
# using rsback's private key (no password required). 
# The user rsback@stoffel is allowed to run rysnc as root on the remote system.
# To skip some special files, we use an additional exclude file here.

source = rsback@stoffel.our-dynamic-dns-provider.net:/var/projects/data/
destination = /BACKUP1/stoffel/data
rotate = backup 12
mode = rsync
exclude_file = /etc/rsback/stoffel/data.exclude
rsync_options = -al --safe-links --delete --delete-excluded --stats --numeric-ids --bwlimit=25 \
                -e "ssh -i /root/.ssh/stoffel-rsback.id_rsa -p 22022" --rsync-path='sudo rsync'

[stoffel2]
#
# duplicate backup above on the second backup disk
#
source = /BACKUP1/stoffel/data/backup.1/
destination = /BACKUP2/stoffel/data
rotate = backup 12
mode = rsync
rsync_options = -al --delete --delete-excluded --stats

#-----------------------------------------------------
#
# Local backup of virtual server using two tasks
#
#-----------------------------------------------------
#
# first task: backup running server
#
[vs-mail-daily]

source = /vservers/mail/
destination = /BACKUP/vservers/mail
rotate = daily 10
mode = rsync
rsync_options = -al --delete --delete-excluded --stats --numeric-ids
exclude_file = /etc/rsback/vservers.exclude
use_link_dest = yes
lock = vs-mail-daily-update

# second task: backup stopped server
# Run this task immediately after task [vs-mail-daily], as soon as
# vserver has stopped.

[vs-mail-daily-update]

# Use same parameters as in task [vs-mail-daily] but don't rotate.
# This will update the most recent backup archive mail/daily.1
update = vs-mail-daily