backup.sh
# Df's QQ : 573270407
#echo begin del old files
location="."
#find $location -mtime +30 -type f |xargs rm -f
find $location -mtime +15 -type f -name '*.zip' -exec rm -f {} \; #half month del
echo del old files complete
echo start backups
ac='root'
pw='xxxx'
db=mysql
/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
db=wdcpdb
/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
db=we7
/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
db=WZ2015
/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
db=df_db
/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
#/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
#/www/wdlinux/mysql-5.1.63/bin/mysqldump -u$ac -p$pw $db | zip > /back/df_${db}_$(date +%Y%m%d_%H%M%S).sql.zip
echo backups complete