A服务器:192.168.0.102
B服务器:192.168.0.103
A服务器:
[[email protected] ~]# ssh-keygen -t rsa[[email protected] ~]# cat ~/.ssh/id_rsa.pub[[email protected] ~]# scp id_rsa.pub [email protected]:/root/.ssh/authorized_keysB服务器:
[[email protected] ~]# ssh-keygen -t rsa[[email protected] ~]# cat ~/.ssh/id_rsa.pub[[email protected] ~]# scp id_rsa.pub [email protected]:/root/.ssh/authorized_keysA服务器:
[[email protected] ~]## cat bak.sh #!/bin/bashmysqldump -uroot -p123456 ultrax > /root/dbbak/ultraxdate +%Y%m%d
date +%H:%M:%S
.sqlscp /root/dbbak/ultrax*.sql [email protected]:/tmp
A服务器:
[[email protected] ~]## sh bak.shA服务器:
[[email protected] ~]# crontab -l55 23 * /root/dbbak/bak.sh定时拷贝或者手动拷贝 都不要密码了.
精彩评论