2018-12-21 11:20:43 +01:00
|
|
|
<!DOCTYPE html>
|
2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
2019-05-25 13:41:47 +02:00
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
2006-09-11 04:19:00 +00:00
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2018-12-21 11:20:43 +01:00
|
|
|
<html lang="en">
|
2003-05-13 14:37:04 +00:00
|
|
|
|
|
|
|
<head>
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2003-05-13 14:37:04 +00:00
|
|
|
<title>RExec Task</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h2 id="rexec">RExec</h2>
|
2003-05-13 14:37:04 +00:00
|
|
|
<h3>Description</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Task to automate a remote rexec session. Just like the <code>Telnet</code> task, it uses
|
|
|
|
nested <code><read></code> to indicate strings to wait for, and
|
|
|
|
<code><write></code> tags to specify text to send to the remote
|
|
|
|
process.</p>
|
2003-05-13 14:37:04 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p><strong>Note</strong>: This task depends on external libraries not included in the Apache Ant
|
|
|
|
distribution. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more
|
|
|
|
information.</p>
|
2003-05-13 14:37:04 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>You can specify the commands you want to execute as nested elements or via the <var>command</var>
|
|
|
|
attribute, we recommend you use the <var>command</var> attribute. If you use the <var>command</var>
|
|
|
|
attribute, you must use the <var>username</var> and <var>password</var> attributes as well.</p>
|
2005-03-14 08:56:48 +00:00
|
|
|
|
2003-05-13 14:37:04 +00:00
|
|
|
<h3>Parameters</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2003-05-13 14:37:04 +00:00
|
|
|
<tr>
|
2018-05-15 10:29:27 +02:00
|
|
|
<th scope="col">Attribute</th>
|
|
|
|
<th scope="col">Values</th>
|
|
|
|
<th scope="col">Required</th>
|
2003-05-13 14:37:04 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>userid</td>
|
|
|
|
<td>the login id to use on the remote server.</td>
|
2005-03-14 08:56:48 +00:00
|
|
|
<td>No</td>
|
2003-05-13 14:37:04 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>password</td>
|
|
|
|
<td>the login password to use on the remote server.</td>
|
2005-03-14 08:56:48 +00:00
|
|
|
<td>No</td>
|
2003-05-13 14:37:04 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>server</td>
|
|
|
|
<td>the address of the remote rexec server.</td>
|
|
|
|
<td>Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>command</td>
|
|
|
|
<td>the command to execute on the remote server.</td>
|
2005-03-14 08:56:48 +00:00
|
|
|
<td>No</td>
|
2003-05-13 14:37:04 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>port</td>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>the port number of the remote rexec server.</td>
|
|
|
|
<td>No; defaults to <q>512</q> in Unix</td>
|
2003-05-13 14:37:04 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>timeout</td>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>set a default timeout to wait for a response, specified in seconds.</td>
|
|
|
|
<td>No; default is no timeout</td>
|
2003-05-13 14:37:04 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2018-03-05 17:35:30 +01:00
|
|
|
<h3 id="nested">Parameters specified as nested elements</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The input to send to the server, and responses to wait for, are described as nested elements.</p>
|
2003-05-13 14:37:04 +00:00
|
|
|
|
|
|
|
<h4>read</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>declare (as a text child of this element) a string to wait for. The element supports
|
|
|
|
the <var>timeout</var> attribute, which overrides any timeout specified for the task as a whole. It
|
|
|
|
also has a <var>string</var> attribute, which is an alternative to specifying the string as a text
|
|
|
|
element.</p>
|
|
|
|
<p><em>It is not necessary to declare a closing <code><read></code> element like for
|
|
|
|
the <code>Telnet</code> task. The connection is not broken until the command has completed and the
|
|
|
|
input stream (output of the command) is terminated.</em></p>
|
|
|
|
|
2003-05-13 14:37:04 +00:00
|
|
|
<h4>write</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>describes the text to send to the server. The <var>echo</var> boolean attribute controls whether
|
|
|
|
the string is echoed to the local log; this is <q>true</q> by default.</p>
|
2003-05-13 14:37:04 +00:00
|
|
|
<h3>Example</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>A simple example of connecting to a server and running a command.</p>
|
|
|
|
|
|
|
|
<pre><rexec userid="bob" password="badpass" server="localhost" command="ls"/></pre>
|
2003-05-13 14:37:04 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The task can be used with other ports as well:</p>
|
2003-05-13 14:37:04 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<pre><rexec port="80" userid="bob" password="badpass" server="localhost" command="ls"/></pre>
|
2003-05-13 14:37:04 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|