Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1041037
  • 博文数量: 239
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 3618
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-12 13:17
文章分类

全部博文(239)

文章存档

2021年(1)

2016年(1)

2015年(30)

2014年(91)

2013年(116)

分类: LINUX

2013-09-03 16:47:57

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分钟自动同步一次)

阅读(709) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~