#!/bin/bash
d=`date +%d`
db=blog
datadir=/tmp/mysql
remotedir=192.168.0.108::backup
pass_wd=123456
mysqldump -uroot -p${pass_wd} $db > ${datadir}/$d.log
rsync -az ${datadir}/$d.log ${remotedir}/$d.log
原文:https://blog.51cto.com/13667909/2506072