ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhardt Christiansen <>
Subject Question about scp
Date Sat, 12 Jul 2008 14:15:02 GMT
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 via:

          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:

View raw message