You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

rexec.html 3.2 KiB

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