#!/bin/bash
user="root"
pwd="pass"
bakdir=/data/webbak/db
date=$(date +%Y%m%d)
for i in {"a","b","c"}
do
/usr/bin/mysqldump -u$user -p$pwd $i > $bakdir/$i$date.sql
cd $bakdir
tar zcvf $i$date.tar.gz $i$date.sql
rm -rf $i$date.sql
done