1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>RExec Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="rexec">RExec</a></h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 | Task to automate a remote rexec session. Just like the Telnet task,
|
---|
14 | it uses nested <tt><read></tt> to indicate strings to wait for, and
|
---|
15 | <tt><write></tt> tags to specify text to send to the remote process.
|
---|
16 |
|
---|
17 | <p><b>Note:</b> This task depends on external libraries not included in the Ant distribution.
|
---|
18 | See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p>
|
---|
19 |
|
---|
20 | <h3>Parameters</h3>
|
---|
21 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
22 | <tr>
|
---|
23 | <th>Attribute</th>
|
---|
24 | <th>Values</th>
|
---|
25 | <th>Required</th>
|
---|
26 | </tr>
|
---|
27 | <tr>
|
---|
28 | <td>userid</td>
|
---|
29 | <td>the login id to use on the remote server.</td>
|
---|
30 | <td>Yes</td>
|
---|
31 | </tr>
|
---|
32 | <tr>
|
---|
33 | <td>password</td>
|
---|
34 | <td>the login password to use on the remote server.</td>
|
---|
35 | <td>Yes</td>
|
---|
36 | </tr>
|
---|
37 | <tr>
|
---|
38 | <td>server</td>
|
---|
39 | <td>the address of the remote rexec server.</td>
|
---|
40 | <td>Yes</td>
|
---|
41 | </tr>
|
---|
42 | <tr>
|
---|
43 | <td>command</td>
|
---|
44 | <td>the command to execute on the remote server.</td>
|
---|
45 | <td>Yes</td>
|
---|
46 | </tr>
|
---|
47 | <tr>
|
---|
48 | <td>port</td>
|
---|
49 | <td>the port number of the remote rexec server. Defaults to port 512 in BSD Unix systems.</td>
|
---|
50 | <td>No</td>
|
---|
51 | </tr>
|
---|
52 | <tr>
|
---|
53 | <td>timeout</td>
|
---|
54 | <td>set a default timeout to wait for a response. Specified in seconds. Default is no timeout.</td>
|
---|
55 | <td>No</td>
|
---|
56 | </tr>
|
---|
57 | </table>
|
---|
58 | <h3><a name="nested">Nested Elements</a></h3>
|
---|
59 | The input to send to the server, and responses to wait for, are
|
---|
60 | described as nested elements.
|
---|
61 |
|
---|
62 | <h4>read</h4>
|
---|
63 |
|
---|
64 | <p>declare (as a text child of this element) a string to wait for.
|
---|
65 | The element supports the timeout attribute, which overrides any
|
---|
66 | timeout specified for the task as a whole. It also has a <tt>string</tt>
|
---|
67 | attribute, which is an alternative to specifying the string as
|
---|
68 | a text element.
|
---|
69 | </p>
|
---|
70 | <i>It is not necessary to declare a closing <read> element like for the Telnet task. The connection is not broken until the command has completed and
|
---|
71 | the input stream (output of the command) is terminated.
|
---|
72 | </i>
|
---|
73 | <h4>write</h4>
|
---|
74 |
|
---|
75 | <p>describes the text to send to the server. The <tt>echo</tt> boolean
|
---|
76 | attribute controls whether the string is echoed to the local log;
|
---|
77 | this is "true" by default
|
---|
78 | </p>
|
---|
79 | <h3>Example</h3>
|
---|
80 | A simple example of connecting to a server and running a command.
|
---|
81 |
|
---|
82 | <blockquote><pre>
|
---|
83 | <rexec userid="bob" password="badpass" server="localhost" command="ls"/>
|
---|
84 | </pre></blockquote>
|
---|
85 |
|
---|
86 | The task can be used with other ports as well:
|
---|
87 | <blockquote><pre>
|
---|
88 | <rexec port="80" userid="bob" password="badpass" server="localhost" command="ls"/>
|
---|
89 | </pre></blockquote>
|
---|
90 |
|
---|
91 | <hr>
|
---|
92 | <p align="center">Copyright © 2003-2004 The Apache Software Foundation. All rights
|
---|
93 | Reserved.</p>
|
---|
94 |
|
---|
95 | </body>
|
---|
96 | </html>
|
---|
97 |
|
---|