FTP Problems in 1.7.0
Can anyone help me with the Ant optional ftp task? I'm finally using Ant again for the first time in a couple of years and running into some problems. I'm using Ant 1.7.0 and my build is basically working fine, aside from some issues with the ftp task. My mkdir and send actions are working fine so I know that this is not an installation issue, such as missing jars. Here are my problems: 1. I keep getting a MalformedPatternException when I try to do an ftp with action="list". It seems to be objecting to the listing parameter. I have tried all the variations I can imagine but nothing works. 2. My action="send" operations work fine as long as I omit the depends="yes" parameter. When I include depends="yes", I get MalformedPatternException on the line containing the remotedir parameter. Here is code illustrating the first problem: password="${password}" description="List contents of directory" remotedir="${servername}/zzz" listing="ftp.listing"> - Here is code illustrating the second problem; if I omit the depends parameter, the send works perfectly: - password="${password}" depends="yes" description="Upload files for main directory" remotedir="${servername}/zzz"> - I tried finding some additional examples in the MARC archive but I'm darned if I can figure out the syntax for the search feature. I keep getting hits that don't contain my search arguments and don't seem to bear any relation to what I want. Can anyone tell me how to search on all posts that contain: action="list"? Also, with respect to the listing parameter of action="list", can someone please clarify whether the file identified in the listing parameter is on the server or the remote machine? The documentation is not clear on this point. I've looked on both machines and can't find the file on either one; it would save me a bit of time if I knew I didn't have to look on one of the two machines. -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FTP Problems in 1.7.0
NOTE: I never saw this reply in my email client for some reason so I went into MARC and copied and pasted it in here, then reformatted it so that it now looks approximately right. >> Reinhardt Christiansen wrote: >> Can anyone help me with the Ant optional ftp task? I'm finally using Ant >> again for the first time in a couple of years and running into some >> problems. >> I'm using Ant 1.7.0 and my build is basically working fine, aside from >> some issues with the ftp task. My mkdir and send actions are working >> fine so I know that this is not an installation issue, such as missing >> jars. the usual thing that breaks FTP is a weird directory listing at the far end. > What server/language are you using and what does a listing look like? (we do warn about this at the top of the task, but maybe the language > there could be clearer) What do you mean when you ask for the server/language? I don't understand the question. Are you asking for the hostname? The operating system? And how can I determine the answer? My friend uses a hosting service for his private files and he's given me a bit of play space for a project I'm doing; that's where I'm trying to send the files. I currently use SmartFTP 3.0 to upload/download from the server and it works fine as an interactive tool. I'm simply trying to write some Ant scripts to automate some of the more repetitive tasks that I need to do. I'm not sure what O/S this server is running but I chose "Show Raw Listing" in SmartFTP and it gave me this for one small directory containing a single file and a folder: drwxr-xr-x 3 sfl pg598770 4096 May 22 06:49 . drwxr-xr-x 8 sfl pg598770 4096 Jun 8 07:24 .. -rw-r--r-- 1 sfl pg598770 6546 May 22 07:49 150.css drwxr-xr-x 2 sfl pg598770 4096 May 22 07:37 media This looks like some form of Unix/Linux but I'm not sure how to tell the exact O/S if that's what you're asking. Does this answer your question? If not, please tell me where to get the information to answer it. >> Here are my problems: >> 1. I keep getting a MalformedPatternException when I try to do an ftp >> with action="list". It seems to be objecting to the listing >> parameter. I have tried all the variations I can imagine but >> nothing works. could be the response from the far end. Try running at -debug and posting the relevant output as a bug report. >> 2. My action="send" operations work fine as long as I omit the >> depends="yes" parameter. When I include depends="yes", I get >> MalformedPatternException on the line containing the remotedir >> parameter. > Same game. Its trying to parse the date at the far end and failing. What date? There's no date in the Ant script. Or do you mean data? >> Also, with respect to the listing parameter of action="list", can >> someone please clarify whether the file identified in the listing >> parameter is on the server or the remote machine? The documentation is >> not clear on this point. I've looked on both machines and can't find the >> file on either one; it would save me a bit of time if I knew I didn't >> have to look on one of the two machines. > remotedir: base directory from which files are listed > fileset: the remote files located under the remotedir matching the include/exclude patterns of the fileset so, the nested files are the things to list. That's not really what I was asking. If the file named in the listing parameter is called xyz.txt, where will xyz.txt appear: on my local computer or on the remote computer? And _where_ on that computer will it appear? The root directory? Or some other directory? If it's not going to appear in the root, how can I determine where it will appear? > -steve -- Steve Loughran http://www.1060.org/blogxter/publish/5 Author: Ant in Action http://antbook.org/ -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SCP/SSHEXEC tasks: Download of jsch-0.1.39 jar
I am having trouble getting the jar file needed to support the scp/sshexec tasks. I am running Ant 1.7.0 in Eclipse Europa. The manual says that I need any version of the jsch jar, version 0.1.28 or above. The JCraft page shows the current version is 0.1.39. Both a zip and a jar is available for download but, unfortunately, something is messed up with the link for the jar. When I try to download the jar, it takes me to sourceforge.net but gives me the zip file, not the jar. The zip file does NOT include the jar so it is useless to me. I've also tried downloading the zip file, thinking the links might be reversed, but it ALSO gives me the zip file. Does anyone know another place to get the jsch jar? I've already send JCraft an email identifying the problem but who knows how responsive they are to email? It could be days, weeks, or months before they read their email and fix the bad link. If anyone can direct me to another source of the jsch jar, I'd appreciate it. It doesn't need to be 0.1.39; I'll live with any version that works with Ant 1.7.0. (I have jsch-0.1.18 in an old version of Eclipse but that isn't new enough for my purposes.) If anyone could point me to another place to get that jar, I'd appreciate it! -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SCP/SSHEXEC tasks: Download of jsch-0.1.39 jar
Hi Kevin, You're brilliant! I tried another mirror, this time in Berlin rather than in San Jose, and this time the link took me to the jar and I downloaded the file just fine. It never occurred to me that sourceforge.net has mirrors; I never noticed the mirror name amidst the rest of the clutter on the page. I should have thought of it myself, I suppose, but you saved me the trouble ;-) Thanks a lot, Kevin! -- Rhino Kevin Jackson wrote: Hi, The manual says that I need any version of the jsch jar, version 0.1.28 or above. The JCraft page shows the current version is 0.1.39. Both a zip and a jar is available for download but, unfortunately, something is messed up with the link for the jar. When I try to download the jar, it takes me to sourceforge.net but gives me the zip file, not the jar. The zip file does NOT include the jar so it is useless to me. I've also tried downloading the zip file, thinking the links might be reversed, but it ALSO gives me the zip file. Does anyone know another place to get the jsch jar? I've already send JCraft an email identifying the problem but who knows how responsive they are to email? It could be days, weeks, or months before they read their email and fix the bad link. In my experience, the JCraft devs are excellent and very responsive, so I doubt your wait will be measured in months/years. That said I just tested the download and the jar did download correctly for me (I used the http://www.nchc.org.tw/ taiwan mirror for sourceforge as I live in Vietnam and that one seems to be pretty fast for me). Perhaps you should try again and choose a different mirror? Kev - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: /home /home/abc /home/abc/css /home/abc/images /home/abc/images/thumbnails /home/abc/images/thumbnails/new /home/abc/images/fullsize /home/abc/text /home/abc/text/foo /home/abc/text/foo/old /home/abc/text/foo/new /home/abc/text/bar /home/abc/text/baz 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: c:\backups\abc c:\backups\abc\css c:\backups\abc\images c:\backups\abc\images\thumbnails c:\backups\abc\images\thumbnails\new c:\backups\abc\images\fullsize c:\backups\abc\text c:\backups\abc\text\foo c:\backups\abc\text\foo\old c:\backups\abc\text\foo\new c:\backups\abc\text\bar c:\backups\abc\text\baz 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: file="[EMAIL PROTECTED]:${remote.root.dir}/images/*" trust="true" keyfile="${remote.keyfile}" passphrase="${passphrase}" todir="${local.dir}/images"/> 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. -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about scp
I see. Well, it's nice to know that it wasn't a case of me being stupid. It's a shame that it has to be that complicated to copy a tree from the remote Linux machine to my PC but that's life, I suppose. Thanks for the information. -- Rhino Anderson, Rob (Global Trade) wrote: 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 [mailto:[EMAIL PROTECTED] 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: /home /home/abc /home/abc/css /home/abc/images /home/abc/images/thumbnails /home/abc/images/thumbnails/new /home/abc/images/fullsize /home/abc/text /home/abc/text/foo /home/abc/text/foo/old /home/abc/text/foo/new /home/abc/text/bar /home/abc/text/baz 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: c:\backups\abc c:\backups\abc\css c:\backups\abc\images c:\backups\abc\images\thumbnails c:\backups\abc\images\thumbnails\new c:\backups\abc\images\fullsize c:\backups\abc\text c:\backups\abc\text\foo c:\backups\abc\text\foo\old c:\backups\abc\text\foo\new c:\backups\abc\text\bar c:\backups\abc\text\baz 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: file="[EMAIL PROTECTED]:${remote.root.dir}/images/*" trust="true" keyfile="${remote.keyfile}" passphrase="${passphrase}" todir="${local.dir}/images"/> 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. -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about scp
Actually, I'd love to participate in something like that. But, unfortunately, I simply don't have the time. I'm not sure if I have quite enough skill either. But I might check in again in a few months to ask about volunteer opportunities, assuming things slow down a bit by then. -- Rhino Anderson, Rob (Global Trade) wrote: You could write a selector if you would like. You are probably not the first to have a need/desire for this functionality. The Ant project is a great example of users filling their needs while contributing to make the project better. I encourage you to participate. Some would even call it fun :) -Rob Anderson -Original Message- From: Reinhardt Christiansen [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2008 6:37 AM To: Ant Users List Subject: Re: Question about scp I see. Well, it's nice to know that it wasn't a case of me being stupid. It's a shame that it has to be that complicated to copy a tree from the remote Linux machine to my PC but that's life, I suppose. Thanks for the information. -- Rhino Anderson, Rob (Global Trade) wrote: 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 [mailto:[EMAIL PROTECTED] 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: /home /home/abc /home/abc/css /home/abc/images /home/abc/images/thumbnails /home/abc/images/thumbnails/new /home/abc/images/fullsize /home/abc/text /home/abc/text/foo /home/abc/text/foo/old /home/abc/text/foo/new /home/abc/text/bar /home/abc/text/baz 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: c:\backups\abc c:\backups\abc\css c:\backups\abc\images c:\backups\abc\images\thumbnails c:\backups\abc\images\thumbnails\new c:\backups\abc\images\fullsize c:\backups\abc\text c:\backups\abc\text\foo c:\backups\abc\text\foo\old c:\backups\abc\text\foo\new c:\backups\abc\text\bar c:\backups\abc\text\baz 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: file="[EMAIL PROTECTED]:${remote.root.dir}/images/*" trust="true" keyfile="${remote.keyfile}" passphrase="${passphrase}" todir="${local.dir}/images"/> 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. -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create remote directory without using ftp?
Raffaele wrote: Hi all, I'm running ANT from Maven, and I would like to create some directory on a server. I have seen scp task which helped me to do remote file copy, very well. Now, I'm not understanding how to create a directory on my server, scp doesn't do this, is it right? I've tried also with this: But it is saying "Connecting..." and it remains blocked indefinetely. My server is Windows and I've installed on it OpenSSH. Any advices or ideas? Here is an example from an Ant build that creates a directory on a remote Linux server; I don't have an example for creating a remote directory on a Windows machine: keyfile="C:\Documents and Settings\mykeyfile" passphrase="mypassphrase" failonerror="false" command="mkdir /home/mysubdir/mysubsubdir/css"/> I've used literals for all the parameters, just to make it straightforward. The Linux server is using a passphrase (stored on the local Windows machine) rather than a password but passwords should work, too. I assure you that this code works fine. I hope this helps. -- Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]