You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nicolas Vervelle <nv...@club-internet.fr> on 2005/01/30 13:55:43 UTC
Ant task scp or sftp
Hello,
I need to upload files to a server that accepts only secured connections
(scp, sftp).
I'm currently using the scp ant task to do the job, but this task lacks the
ability to upload only the newer files so it takes me a lot of time (30 mns
now but increasing because more files are added) to upload when only a few
files really need to be uploaded.
Is there a way to upload only newer files ?
The ftp task has a "depends" or "newer" parameter to do this, but it is not
a secured ftp.
I looked for a sftp task but I didn't find it.
An other idea was to open a ssh connection before and then use the ftp task,
but I don't know how to open a ssh connection in ant either.
Any help will be appreciated.
Nicolas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant task scp or sftp
Posted by Rhino <rh...@sympatico.ca>.
----- Original Message -----
From: "Nicolas Vervelle" <nv...@club-internet.fr>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Sunday, January 30, 2005 8:42 AM
Subject: Re: Ant task scp or sftp
>
> ----- Original Message -----
> From: "Rhino" <rh...@sympatico.ca>
> > Have you tried using the sshexec task instead of scp? I've never tried
> > putting a 'copy' (or 'cp') in the command parameter but I assume it will
> > work. Then perhaps, you can copy only the desired files to the other
> > machine.
>
> AFAIK sshexec only runs a command on a remote machine.
> For me, it's like opening a shell window and typing a command in it.
> So, I don't see how I will have access to the local files. Am I missing
> something ?
>
Sorry, you're right. I was only just out of bed when I replied to your note
and wasn't thinking very clearly yet ;-) I had the thought that you could
pass a copy command to sshexec but that really doesn't help very much now
that I think about it.
I've just reread your question and I'm afraid I can't contribute much to
solving your problem. I'm not aware of any way to make scp recognize only
newer files and I don't know of any other core or optional tasks that will
do what you want to do. This mailing list is pretty dead on the weekend so
you should probably just be patient and hope that someone can suggest a
better alternative on Monday.
The only other alternative I see is that you could write your own task to
upload only newer files but that may be a lot more work than you want to do,
assuming you are capable of writing the code in the first place.
You could try Googling on 'ssh Ant' and see if there are some optional ssh
upload tasks for Ant that aren't documented in the Ant manual. There may
well be many such tasks out there - or none at all.
Rhino
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 25/01/2005
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant task scp or sftp
Posted by Nicolas Vervelle <nv...@club-internet.fr>.
----- Original Message -----
From: "Rhino" <rh...@sympatico.ca>
> Have you tried using the sshexec task instead of scp? I've never tried
> putting a 'copy' (or 'cp') in the command parameter but I assume it will
> work. Then perhaps, you can copy only the desired files to the other
> machine.
AFAIK sshexec only runs a command on a remote machine.
For me, it's like opening a shell window and typing a command in it.
So, I don't see how I will have access to the local files. Am I missing
something ?
Nicolas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant task scp or sftp
Posted by Rhino <rh...@sympatico.ca>.
----- Original Message -----
From: "Nicolas Vervelle" <nv...@club-internet.fr>
To: <us...@ant.apache.org>
Sent: Sunday, January 30, 2005 7:55 AM
Subject: Ant task scp or sftp
> Hello,
>
> I need to upload files to a server that accepts only secured connections
> (scp, sftp).
>
> I'm currently using the scp ant task to do the job, but this task lacks
the
> ability to upload only the newer files so it takes me a lot of time (30
mns
> now but increasing because more files are added) to upload when only a few
> files really need to be uploaded.
> Is there a way to upload only newer files ?
>
> The ftp task has a "depends" or "newer" parameter to do this, but it is
not
> a secured ftp.
> I looked for a sftp task but I didn't find it.
>
> An other idea was to open a ssh connection before and then use the ftp
task,
> but I don't know how to open a ssh connection in ant either.
>
> Any help will be appreciated.
> Nicolas
>
Have you tried using the sshexec task instead of scp? I've never tried
putting a 'copy' (or 'cp') in the command parameter but I assume it will
work. Then perhaps, you can copy only the desired files to the other
machine.
Rhino
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 25/01/2005
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant task scp or sftp
Posted by Nicolas Vervelle <nv...@club-internet.fr>.
From: "Stefan Bodewig" <bo...@apache.org>
> On Sun, 30 Jan 2005, Nicolas Vervelle <nv...@club-internet.fr>
> wrote:
>
> > Is there a way to upload only newer files ?
>
> Use a <modified> selector.
Thanks, works great :)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant task scp or sftp
Posted by Stefan Bodewig <bo...@apache.org>.
On Sun, 30 Jan 2005, Nicolas Vervelle <nv...@club-internet.fr>
wrote:
> Is there a way to upload only newer files ?
Use a <modified> selector.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org