#!/bin/sh

. config.sh

echo Zaloha databaze...

mkdir /tmp/backup
cd /tmp/backup

DB_NAME=forum
echo ${DB_NAME}
mysqldump --user=${DB_USER} --password=${DB_PASSWORD} ${DB_NAME} > ${DB_NAME}.sql
tar -c -z ${DB_NAME}.sql > ${DB_BACKUP_DIR}${DB_NAME}/${DB_NAME}_$(date +"%Y-%m-%d").tar.gz
unlink ${DB_NAME}.sql

DB_NAME=is
echo ${DB_NAME}
mysqldump --user=${DB_USER} --password=${DB_PASSWORD} ${DB_NAME} > ${DB_NAME}.sql
tar -c -z ${DB_NAME}.sql > ${DB_BACKUP_DIR}${DB_NAME}/${DB_NAME}_$(date +"%Y-%m-%d").tar.gz
unlink ${DB_NAME}.sql

DB_NAME=share
echo ${DB_NAME}
mysqldump --user=${DB_USER} --password=${DB_PASSWORD} ${DB_NAME} > ${DB_NAME}.sql
tar -c -z ${DB_NAME}.sql > ${DB_BACKUP_DIR}${DB_NAME}/${DB_NAME}_$(date +"%Y-%m-%d").tar.gz
unlink ${DB_NAME}.sql

rmdir /tmp/backup

echo Hotovo
