backup mysql data
riqi=$(date +%Y-%m-%d)
mysqldump -h50.100.13.2 -uroot -ptenx#cloud999 -P3306 -A --lock-tables=0 | gzip > /opt/mysql-data-backup/all-data-$riqi.sql.gz
clean old 30 *.sql file
find /opt/mysql-data-backup/ -maxdepth 1 -type f -mtime +30 -name "*.sql.gz" -exec rm -rf {} ;
标签:mysql,backup,备份,30,天前,sql,data From: https://www.cnblogs.com/putaoo/p/17057245.html