rsync雜談


初始化的時候同步219到146上html


rsync -aSvh /spmwls/bea9/appspm/html/portlet/ext/errandsExpense/upload/ appspm@10.4.119.146:/spmwls/bea9/appspm/html/portlet/ext/errandsExpense/upload/java

rsync -aSvh  /spmwls/bea9/appspm/html/portlet/ext/pccw/spmupload/ appspm@10.4.119.146:/spmwls/bea9/appspm/html/portlet/ext/pccw/spmupload/  --0.02Glinux

rsync -aSvh  /spmwls/bea9/appspm/html/portlet/ext/pccw/upload_new/ appspm@10.4.119.146:/spmwls/bea9/appspm/html/portlet/ext/pccw/upload_new/  --20.91Gweb

rsync -aSvh  /spmwls/bea9/appspm/html/portlet/ext/pccw/upload/ appspm@10.4.119.146:/spmwls/bea9/appspm/html/portlet/ext/pccw/upload/   --53.55Gapache

rsync -aSvh  /spmtest/bea/appcmb/pr_attachment/ appspm@10.4.119.146:/spmtest/bea/appcmb/pr_attachment/     --4.66Gwindows

rsync -aSvh  /spmtest/bea/appcmb/spmdocuments/ appspm@10.4.119.146:/spmtest/bea/appcmb/spmdocuments/       --21.49G服務器

rsync -aSvh  /spmtest/bea/appcmb/spmdocuments/contracttext/ spmfawu@10.4.119.146:/spmtest/bea/appcmb/spmdocuments/contracttext/app



在146上執行一個sh,將146上的文件同步到72上去dom

 

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

 

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 appspm@10.4.119.146:/spmwls/bea9 /c

ygdrive/c/crgwin/work

該命令也成功了,只是要輸入密碼


在140上下載146的命令,測試成功:

rsync -av --password-file=/etc/inburst.pass  rsync://appspm@10.4.119.146:1025/inburst /data/test2



虛擬機上的windows的命令:


C:\Program Files\cwRsyncServer\bin>rsync -av --password-file=inburst.pass $2 rsync://appspm@10.4.119.146: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

://appspm@10.4.101.37: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

相關文章
相關標籤/搜索