rsync杂谈


初始化的时候同步219到146上


rsync -aSvh /spmwls/bea9/appspm/html/portlet/ext/errandsExpense/upload/ [email protected]:/spmwls/bea9/appspm/html/portlet/ext/errandsExpense/upload/

rsync -aSvh  /spmwls/bea9/appspm/html/portlet/ext/pccw/spmupload/ [email protected]:/spmwls/bea9/appspm/html/portlet/ext/pccw/spmupload/  --0.02G

rsync -aSvh  /spmwls/bea9/appspm/html/portlet/ext/pccw/upload_new/ [email protected]:/spmwls/bea9/appspm/html/portlet/ext/pccw/upload_new/  --20.91G

rsync -aSvh  /spmwls/bea9/appspm/html/portlet/ext/pccw/upload/ [email protected]:/spmwls/bea9/appspm/html/portlet/ext/pccw/upload/   --53.55G

rsync -aSvh  /spmtest/bea/appcmb/pr_attachment/ [email protected]:/spmtest/bea/appcmb/pr_attachment/     --4.66G

rsync -aSvh  /spmtest/bea/appcmb/spmdocuments/ [email protected]:/spmtest/bea/appcmb/spmdocuments/       --21.49G

rsync -aSvh  /spmtest/bea/appcmb/spmdocuments/contracttext/ [email protected]:/spmtest/bea/appcmb/spmdocuments/contracttext/



在146上执行一个sh,将146上的文件同步到72上去

 

nohup /data/spmbak/bea9_bak/Server.sh >/data/spmbak/bea9_bak/bea9_sysnc.log &

 

tail -f -n 1000 /data/spmbak/bea9_bak/bea9_sysnc.log

 

 批量修改属主

--有问题

 cat appspm_219.log |awk '{printf "%s ",$0}'|xargs chown -R appspm.spmgroup

--优化

cat spmfawu_219.log |awk '{printf "\"%s\" ",$0}'|xargs chown spmfawu.spmgroup

cat $2appspm_219.log |awk '{printf "\"%s\" ",$0}'|xargs chown $2appspm.spmgroup

 --之后

find /spmtest/bea/appcmb/spmdocuments/ -user spmfawu|wc -l 


--查看当前的weblogic进程的线程,并将其存入log

LOFFILE_SUBFIX="`date +%Y%m%d_%H_%M_%S`.log"

 ps -ef|grep java|grep cmbServer|awk '{printf "%s ",$2}'|xargs jstack -F $2>$LOFFILE_SUBFIX


--求出30天内更新的文件(去掉了文件夹)

find  /spmwls/bea9_prd/* -ctime -30 -type f |awk '{printf "\"%s\" ",$0}'|xargs du -smc


怎样把140上的文件同步到146上?

0)以下几步均未在140上证实

1)在146上 vi /home/appspm/rsync.conf

2)在146上 rsync --daemon --config=/home/appspm/rsync.conf

3)140上安装inotify-tools-3.14.tar.gz

4)140上/spmwls/rsync_weblogic146.sh,试试吧.之后

 

查看linux的cpu 内存信息

http://hi.baidu.com/mumachuntian/item/a401368dbe8a66cab07154e8 


查看线程的堆栈信息

kill -3 <pid>

jstack <pid>  >/spmwls/cmbServer_threadDump.log

查看heapdump的消息(sun)

jmap -dump:file=heap.bin <pid>


来源: <http://10.4.119.140:12501/axis2/axis2-web/HappyAxis.jsp>

 export CLASSPATH=/spmwls/weblogic1036/user_projects/domains/cmb/lib/antlr-2.7.6.jar:/spmwls/weblogic1036/user_projects/domains/cmb/lib/portlet.jar:/spmwls/weblogic1036/user_projects/domains/cmb/lib/orai18n.jar:/spmwls/weblogic1036/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/spmwls/weblogic1036/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/java/jdk1.6.0_45/lib/tools.jar:/spmwls/weblogic1036/wlserver_10.3/server/lib/weblogic_sp.jar:/spmwls/weblogic1036/wlserver_10.3/server/lib/weblogic.jar:/spmwls/weblogic1036/modules/features/weblogic.server.modules_10.3.6.0.jar:/spmwls/weblogic1036/wlserver_10.3/server/lib/webservices.jar:/spmwls/weblogic1036/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/spmwls/weblogic1036/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/spmwls/weblogic1036/wlserver_10.3/common/derby/lib/derbyclient.jar:/spmwls/weblogic1036/wlserver_10.3/server/lib/xqrl.jar




java weblogic.Admin -url t3://10.4.119.72:7001 -username weblogic -password weblogic123 PING 1 1



查看系统日志:


grep "2013-10-25 08:49:"  cmb*.*





windows下安装一个rsync服务,之后146的机器上执行同步命令

rsync -aSvh /spmwls/bea9/ -av rsync://10.4.101.89:8899/test

(将146上的文件传到89的windows上去)



windows下从指定服务器上接收文件的命令


rsync -av rsync://10.4.101.89:8899/test /cygdrive/c/crgwin/work


该命令在虚拟机对虚拟机自己的机器上已经试验成功

/cygdrive/c/crgwin/work 对应的是:C:\crgwin\work



windows与146的试验:

C:\Program Files\cwRsyncServer\bin>rsync -av [email protected]:/spmwls/bea9 /c

ygdrive/c/crgwin/work

该命令也成功了,只是要输入密码


在140上下载146的命令,测试成功:

rsync -av --password-file=/etc/inburst.pass  rsync://[email protected]:1025/inburst /data/test2



虚拟机上的windows的命令:


C:\Program Files\cwRsyncServer\bin>rsync -av --password-file=inburst.pass $2 rsync://[email protected]:1025/inburst /cygdrive/c/work



虚拟机的linux作为服务端的配置:

[root@localhost etc]# vi /etc/rsyncd.conf

uid = root

gid = root

use chroot = no

max connections = 4


#pid file = /var/run/rsyncd.pid

lock file = /var/run/rsync.lock

log file = /var/log/rsyncd.log

#hosts allow = 10.4.119.72

hosts allow = *


port = 1025


#secrets file = /etc/inburst.pass


[inburst]

path = /data/test

 #the dir need be mirror

comment = BACKUP CLIENT IS REDHAT ADVANCE SERVER 3.0

read only = no

list = yes

#auth users = appspm

secrets file =/etc/rsyncd.secrets

auth users=appspm


之后运行

rsync --daemon --config=/etc/rsyncd.conf


关闭redhat 的防火墙

/etc/init.d/iptables stop 

之后在虚拟机windows上执行


C:\Program Files\cwRsyncServer\bin>rsync -av --password-file=inburst.pass  rsync

://[email protected]:1025/inburst /cygdrive/c/work

receiving file list ... done

./

1.log

cmbServer2.log

cmbServer2.out

log.txt


sent 199 bytes  received 67067891 bytes  1253609.16 bytes/sec

total size is 67059332  speedup is 1.00



cat /var/log/messages






你可能感兴趣的:(rsync杂谈)