<pre name="code" class="sql">. ~/.bash_profile
TODAY_DIR=`date +%Y%m%d`
cd /data02/database_backup
rm -rf $old_dir
rm -rf $old_dir.tar.gz
if [ -f "${TODAY_DIR}.tar.gz" ]
then
tar -zxvf ${TODAY_DIR}.tar.gz
cd /data02/database_backup/20150511/zjzc
mysql -uroot -p'R0511' -D zjzc<zjzc_${TODAY_DIR}.sql
if [ $? -eq "0" ]
then
smail.pl zjzc
fi
cd /data02/database_backup/20150511/quartz
mysql -uroot -p'R511' -D quartz<quartz_${TODAY_DIR}.sql
if [ $? -eq "0" ]
then
smail_2.pl quartz
echo ok
fi
fi