backup.sh
#!/bin/bash
/usr/bin/mysqldump -uroot -proot -h127.0.0.1 --single-transaction -R --triggers -B xxx_admin >/app/backup/xxx`date +%F`ALL.SQL && find /app/backup/ -ctime +30 -type f -name "*SQL" -exec rm -rf {} ;
crontab -e
00 22 * * * /app/backup/backup.sh