rsync sync failure (win08--->ubuntu12.04)
Source data server for windows2008, install Cwrsyncserver, regular sync process card die do not quit, the script to solve this problem
#!/bin/bash
Pri=/root/rsync.pwd
Ist=/root/ign.list
Sf=root@223.*.*.*::test
Dt=/var/www
Log=/var/log/cdhome_rsync.log
Pid=/tmp/cdhome_rsync.pid
Fi=/tmp/cdh_test
date= "Date +%y-%m-%d~%k:%m:%s"
sync= "/usr/bin/rsync-vuzrtogp--bwlimit=512--port=8073"
[!-F "$FI"] &&/usr/bin/touch $FI
Cdh_sync () {
echo $$ > $PID
$SYNC--exclude-from= $IST--password-file= $PRI $SF $DT
echo "' $DATE ' sync OK" >> $LOG
RM-RF $PID
Exit 0
}
if [!-F "$PID"]; then
echo $$ > $PID
Cdh_sync
Fi
Tid= ' Cat $PID '
Lid= ' PS aux|grep $TID |grep-v grep '
[-Z "$LID"] && Cdh_sync
Zid= ' Cat $FI '
if [[-N ' $LID ' &&-n ' $ZID ']];then
Kill-9 $TID
/usr/bin/killall rsync &>/dev/null
Ard= (' ps-c Rsync|awk ' {print} ' |grep-v PID ')
For d in ${ard[@]};d o
[Z $d] && continue
If PS aux|grep $d |grep-v grep; then
Kill-9 $d
Fi
Done
echo $$ > $PID
RM-RF $FI
Cdh_sync
Fi
[-N ' $LID] && echo 1 > $FI && echo ' $DATE '--> Warning!!! <--">> $LOG && exit 0
This article from the "Self-Improvement" blog, please be sure to retain this source http://mos1989.blog.51cto.com/4226977/1302195
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/zs/