日期:2014-05-16 浏览次数:20501 次
#!/bin/bash #备份脚本 bakDir=/root/bak cd $bakDir dateDIR=`date +"%y-%m-%d"` mkdir -p $dateDIR/data for i in `mysql -uroot -proot -e "show databases" | grep -v "Database" | grep -v "_schema"` do mysqldump -uroot -proot $i > $bakDir/$dateDIR/data/${i}_${dateDIR}.sql done tar czvf $bakDir/$dateDIR/java_${dateDIR}.tar.gz -C /var/lib/tomcat7 webapps