mysql备份脚本、备份函数

#!/bin/sh
backupdir=/home/mysql_backup/beifen/
time=`date +%Y_%m_%d`
#time=$(date +%Y_%m_%d)
mkdir /home/mysql_backup/beifen/$time
#mkdir /mnt/hgfs/syjgw_oracle_backup/$time
db_user=root    
db_pass=123456


mysqldump -R -E userplatform > $backupdir$time/userplatform$time.sql
mysqldump -R -E wxmg > $backupdir$time/wxmg$time.sql

#find $backupdir -mtime +15 -exec rm -rf {} \;
#tar -cf  $backupdir$time.tar.gz  $backupdir$time;
#rm -rf /home/mysql_backup/back_zips/*;
#mv $backupdir$time.tar.gz  /home/mysql_backup/back_zips;
#cp /home/mysql_backup/beifen/$time/* /mnt/hgfs/syjgw_oracle_backup/
#find $backupdir -name '*' -type d  -mtime +7 |xargs rm -rf ;

你可能感兴趣的:(mysql备份脚本、备份函数)