mysql备份脚本

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

posted @ 2018-11-13 17:37  (!物喜)&(!己悲)  阅读(114)  评论(0编辑  收藏  举报