ssh配置
主机A:192.168.1.210
主机B:192.168.1.200
需要配置主机A无密码登录主机A,主机B
先确保所有主机的防火墙处于关闭状态。
在主机A下执行:
#cd /root/.ssh
#ssh-keygen -t rsa
#cp id_rsa.pub authorized_keys
#scp authorized_keys 192.168.1.200:/root/.ssh
在主机B下执行:
#chmod 600 authorized_keys
在主机A下执行
#cd /usr/bin
#vi update.sh加入要同步的内容(将/opt换成cms附件的目录)
rsync -av /opt/* 192.168.1.200:/opt
rsync -av 192.168.1.200:/opt/* /opt
rsync -av /wcmdata/icitic/WebSphere/AppServer/profiles/custom02/installedApps/wasdmgrCell/icms_20130613_war.ear/icms_20130613.war/resource/ewebeditor/uploadfile/* was01.xacbank.com:/wcmdata/icitic/WebSphere/AppServer/profiles/custom01/installedApps/wasdmgrCell/icms_20130613_war.ear/icms_20130613.war/resource/ewebeditor/uploadfile/
rsync -av was01.xacbank.com:/wcmdata/icitic/WebSphere/AppServer/profiles/custom01/installedApps/wasdmgrCell/icms_20130613_war.ear/icms_20130613.war/resource/ewebeditor/uploadfile/* /wcmdata/icitic/WebSphere/AppServer/profiles/custom02/installedApps/wasdmgrCell/icms_20130613_war.ear/icms_20130613.war/resource/ewebeditor/uploadfile/
#chmod +x update.sh
#crontab -e
加入
*/10 * * * * /usr/bin/update.sh(表示10分钟自动同步一次)
阅读(746) | 评论(0) | 转发(0) |