Trouble calling rsync from Java

Keith Schon keith.schon at cataphora.com
Thu Feb 10 04:19:51 GMT 2005


I'm writing a webapp to be used internally at my company over a LAN.  Users
can specify info on their computer that should be archived to a central
location, then a Java servlet calls Runtime.exec() to launch the following
script:

#!/bin/sh
from=$1
to=$2
mntName=$3
mount -f "$from" "/$mntName"
rsync -avz "/$mntName/" `cygpath "$to"`
umount "/$mntName"

This works fine on my development box, but when I moved everything to the
production environment, I get the following error every time:

pipe: Operation not permitted
rsync error: error in IPC code (code 14) at
/home/lapo/packaging/tmp/rsync-2.6.0/pipe.c(109)

Both my box and the production box are running Windows 2000 with Cygwin
installed, and in both cases I'm running Apache Tomcat with JRE 1.5.  The
actual command that's run is (for example):

C:\cygwin\bin\sh -c "/cygdrive/i/intake_home/copy.sh '<path1>' '<path2>'
'<randomly generated mount name>'"

Funny thing is, if I run the same command from a dos prompt, it works.
I've also tried mounting the drive before starting the server, then calling
rsync directly instead of via the script, with and without invoking the
shell.  I get the same results any way I try it.

Is there an environment variable that I need to give the spawned process?
If so, why is it different on 2 similarly configured computers?  Any help
would be much appreciated.
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list