1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>RExec Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="rexec">RExec</a></h2>
|
---|
28 | <h3>Description</h3>
|
---|
29 | Task to automate a remote rexec session. Just like the Telnet task,
|
---|
30 | it uses nested <tt><read></tt> to indicate strings to wait for, and
|
---|
31 | <tt><write></tt> tags to specify text to send to the remote process.
|
---|
32 |
|
---|
33 | <p><b>Note:</b> This task depends on external libraries not included in the Ant distribution.
|
---|
34 | See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p>
|
---|
35 |
|
---|
36 | <p>You can specify the commands you want to execute as nested elements
|
---|
37 | or via the command attribute, we recommend you use the command
|
---|
38 | attribute. If you use the command attribute, you must use the
|
---|
39 | username and password attributes as well.</p>
|
---|
40 |
|
---|
41 | <h3>Parameters</h3>
|
---|
42 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
43 | <tr>
|
---|
44 | <td valign="top"><b>Attribute</b></td>
|
---|
45 | <td valign="top"><b>Description</b></td>
|
---|
46 | <td valign="top"><b>Required</b></td>
|
---|
47 | </tr>
|
---|
48 | <tr>
|
---|
49 | <td>userid</td>
|
---|
50 | <td>the login id to use on the remote server.</td>
|
---|
51 | <td>No</td>
|
---|
52 | </tr>
|
---|
53 | <tr>
|
---|
54 | <td>password</td>
|
---|
55 | <td>the login password to use on the remote server.</td>
|
---|
56 | <td>No</td>
|
---|
57 | </tr>
|
---|
58 | <tr>
|
---|
59 | <td>server</td>
|
---|
60 | <td>the address of the remote rexec server.</td>
|
---|
61 | <td>Yes</td>
|
---|
62 | </tr>
|
---|
63 | <tr>
|
---|
64 | <td>command</td>
|
---|
65 | <td>the command to execute on the remote server.</td>
|
---|
66 | <td>No</td>
|
---|
67 | </tr>
|
---|
68 | <tr>
|
---|
69 | <td>port</td>
|
---|
70 | <td>the port number of the remote rexec server. Defaults to port 512 in BSD Unix systems.</td>
|
---|
71 | <td>No</td>
|
---|
72 | </tr>
|
---|
73 | <tr>
|
---|
74 | <td>timeout</td>
|
---|
75 | <td>set a default timeout to wait for a response. Specified in seconds. Default is no timeout.</td>
|
---|
76 | <td>No</td>
|
---|
77 | </tr>
|
---|
78 | </table>
|
---|
79 | <h3><a name="nested">Nested Elements</a></h3>
|
---|
80 | The input to send to the server, and responses to wait for, are
|
---|
81 | described as nested elements.
|
---|
82 |
|
---|
83 | <h4>read</h4>
|
---|
84 |
|
---|
85 | <p>declare (as a text child of this element) a string to wait for.
|
---|
86 | The element supports the timeout attribute, which overrides any
|
---|
87 | timeout specified for the task as a whole. It also has a <tt>string</tt>
|
---|
88 | attribute, which is an alternative to specifying the string as
|
---|
89 | a text element.
|
---|
90 | </p>
|
---|
91 | <i>It is not necessary to declare a closing <code><read></code> element like for the Telnet task. The connection is not broken until the command has completed and
|
---|
92 | the input stream (output of the command) is terminated.
|
---|
93 | </i>
|
---|
94 | <h4>write</h4>
|
---|
95 |
|
---|
96 | <p>describes the text to send to the server. The <tt>echo</tt> boolean
|
---|
97 | attribute controls whether the string is echoed to the local log;
|
---|
98 | this is "true" by default
|
---|
99 | </p>
|
---|
100 | <h3>Example</h3>
|
---|
101 | A simple example of connecting to a server and running a command.
|
---|
102 |
|
---|
103 | <blockquote><pre>
|
---|
104 | <rexec userid="bob" password="badpass" server="localhost" command="ls"/>
|
---|
105 | </pre></blockquote>
|
---|
106 |
|
---|
107 | The task can be used with other ports as well:
|
---|
108 | <blockquote><pre>
|
---|
109 | <rexec port="80" userid="bob" password="badpass" server="localhost" command="ls"/>
|
---|
110 | </pre></blockquote>
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 | </body>
|
---|
115 | </html>
|
---|
116 |
|
---|