rsync failures through ssh tunnels

David Bear David.Bear at asu.edu
Thu Mar 9 18:36:57 GMT 2006


I attempted to write a script that would connect to the remote rsync
server and run rsync and then close the connection.

I am finding that sometimes the backgrounded ssh session works -- and
sometimes note. I following the syntax at:
http://rsync.samba.org/firewall.html

though there is NO middle system.

heres the script with the commands just echoing the commands to the
screen.  What I am finding is that even after ssh sets up the tunnels
that rsync sits in a sleep state forever.

Any pointers will be greatly appreciated.

#!/bin/sh
# by db
# date: 20060306
#
sshuser="sshuser"
rsyncuser="rsuser"
rhost="rhost.asu.edu"
pforward="8730"
rport="873"
sshoptions="-fN -L $pforward:localhost:$rport "
module="home"
dest="uc-sirc1/home/"
echo "Connecting to host $rhost"
echo /usr/bin/ssh $sshoptions $sshuser@$rhost
echo "beginning sync operation"
echo /usr/bin/rsync -av  rsync://localhost:$pforward/$module $dest
echo "all done rsyncing, now cleaning up backgrounded shell"
echo "Killing backgrounded shell  "
echo /bin/kill -9 `/usr/bin/pgrep -lf -u natjohn1 ssh | grep "$sshuser@$rhost" | cut -f1 -d " "`

-- 
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"


More information about the rsync mailing list