Thanks for providing the example of exec. I have questions: Which system is the ant script running on? Is the <exec> also executing on that system?
I am looking for a way to remotely execute ant code on multiple systems and with multiple executions per system. I have gotten sshexec to work (once per script). rexec has issues, too. --glenn On 12/19/05, Rebhan, Gilbert <[EMAIL PROTECTED]> wrote: > > > Hi, Rhino > > -----Original Message----- > From: Rhino [mailto:[EMAIL PROTECTED] > Sent: Sunday, December 18, 2005 3:30 PM > To: Ant Users List > Subject: Re: Question re sshexec task > > /* > Could you possibly post a small example of the technique you're using? > I'm > not sure how to combine exec with ssh/scp. You can disguise the server > name, > user id, passphrase and so forth. The example doesn't need to do > anything > fancy; a simple 'pwd' and 'mkdir' would be fine. > > It would really help me revise my script so that it works again! > */ > > I suppose you want to work on a unix box, as i do ?! > On a windows box you could use the free putty client, which has also > a command line interface. > > What i did before writing the script = > > i went to our unix admins and said i want to use ssh/scp without > password, > so my script runs without hardcoded passwords or any kind of interaction > (prompts for password). > > they had to fiddle in the /home/.ssh directory, > your unix admins should know what to do ;-) > > My script transfers all stuff to one unix machine and does > all the rest - copy and delete on other unix machines - > via scp / ssh > > here's a part of a script using ssh / scp = > > [ ... ] > > <assert name="[EMAIL PROTECTED]" execute="true"> > <for list="[EMAIL PROTECTED]" param="delfile"> > <sequential> > <echo message="Deleting File -> > ${target}/@{Lum}/opt/[EMAIL PROTECTED]" /> > > *** Kornshell ksh , you may have another shell on your box > <exec executable="ksh" failonerror="true"> > > *** rm > with Flag -r you're able delete files _and_ directories(even if not > empty) > with Flag -f you don't get any error messages, i.e. when the file > doesn't > exist on one of the nodes > with Flag -e you get a message on stdout when a file is deleted > > *** ssh > you have to put the whole line between ' ' and the rm command > between " " > just use your commands, i.e. pwd or mkdir in the same manner > > <arg value='ssh @{server} "rm -r -f -e > ${target}/@{Lum}/opt/[EMAIL PROTECTED]"'/> > </exec> > </sequential> > </for> > </assert> > > <assert name="[EMAIL PROTECTED]" execute="true"> > <for list="[EMAIL PROTECTED]" param="copyfile"> > <sequential> > <echo message="Copy File -> @{copyfile}" /> > <exec executable="ksh" failonerror="true"> > > *** scp > with Flag -p the timestamps are preserved > with Flag -r you may copy files _and_ directories > > *** the syntax with the 5 '@' has to be written that way because of > using ant-contrib for task > > *** normally there's no linefeed after ${target}/ in my script > > <arg value="scp -p -r ./@{Lum}/[EMAIL PROTECTED] > svcscmcs@@@@@{server}:${target}/@{Lum}/opt/[EMAIL PROTECTED]" /> > </exec> > </sequential> > </for> > </assert> > [ ... ] > > > HTH > > Regards, Gilbert > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >