File kolab-backup of Package kolab-scripts

#!/bin/bash
#
# Copyright 2014 Aeneas Jaissle <aj@ajaissle.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3 or, at your option, any later version
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin street, Fifth Floor, Boston, MA 02111-1301, USA.
#

kolabbackupd=/usr/share/kolab/backup.d

if   [[ "$1" == "config" ]]; then
    bash ${kolabbackupd}/backup-config.sh $2 $3
elif [[ "$1" == "imap" ]]; then
    bash ${kolabbackupd}/backup-imap.sh $2 $3
elif [[ "$1" == "ldap" ]]; then
    bash ${kolabbackupd}/backup-ldap.sh $2 $3
elif [[ "$1" == "sql" ]]; then
    bash ${kolabbackupd}/backup-sql.sh $2 $3
elif [[ "$1" == "--help" ]]; then
    echo "Usage: kolab-backup COMMAND [OPTIONS [ARGS...]"
    echo ""
    echo "Either none or one of the following commands are processed:"
    echo "  config [--restore [BACKUP FILE]]   Backup Kolab configuration files"
    echo "  imap                               Backup IMAP data"
    echo "  ldap                               Backup LDAP databases"
    echo "  sql                                Backup SQL databases"
    echo ""
    echo "Defaults to backup everything."
else
    echo "Option not recognized: $1"
fi
openSUSE Build Service is sponsored by