ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <>
Subject RE: Question about scp
Date Tue, 15 Jul 2008 00:07:06 GMT
You need to use a nested fileset in your scp task. In order to do this
you would need to run ant on the host where the files reside. You cannot
use a nested fileset as a source for the copy when they are on a remote
host. I would setup cygwin sshd on the windows box and run ant on the
linux box.

-Rob Anderson

-----Original Message-----
From: Reinhardt Christiansen [] 
Sent: Saturday, July 12, 2008 7:15 AM
To: ant-user
Subject: Question about scp

I am successfully using the Ant (1.7.0) scp task in Ant 1.7.0 but I have

some questions that don't seem to be answered in the documentation.

With respect to scp, is it possible to copy a whole directory tree from 
a local machine to a remote machine?

Let's say I have this directory tree on my remote (Linux) machine:


Each directory contains files and most also contain subdirectories.

Now, I'd like to take a backup of this information on my local (Windows)

machine. That backup should replicate the structure on the remote 
machine, like this:


I'm finding that I can copy a partial directory tree from the remote 
machine to the local machine without any trouble. For example, if I want

to copy the /home/abc/images directory _and all of its subdirectories_ 
on the remote machine to the local machine, I can do it easily enough

          keyfile="${remote.keyfile}" passphrase="${passphrase}" 

However, when I try to copy a partial directory from the local machine 
to the remote machine, it only ever copies the highest level directory 
and won't recurse to the lower levels. For example, if I want to copy 
c:\backups\abc\text to the remote machine, It only copies the 
c:\backups\abc\text directory and never recurses down to any of the 
subdirectories below c:\backups\abc\text.

I'm guessing that I just haven't written the scp instructions correctly.

As is all too often the case, I'm finding that the examples in the Ant 
manual for a given command either don't show you an example of what 
you're trying to do or fail to explain it very well. In the case of scp,

the examples that show copying directories from a local machine to a 
remote machine don't indicate if they _can_ recurse, let alone how to 
make it recurse if it is possible.

Is it possible to recurse through subdirectories when copying from a 
directory on a local machine to a remote machine? If it is, could 
someone please tell me what I'd need to write to copy 
c:\backups\abc\text and all of its subdirectories to the remote machine?

I've tried it every way I can think of but it never recurses.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message