RSCMD Send remote server command |
Top Previous Next |
This command requires the server be the Robo-FTP Server from Serengeti Systems.
This command may be used under the appropriate conditions to issue Robo-FTP script commands for execution by the remote FTP server. Remote server commands enable total end-to-end automation within the FTP file transfer environment under client-side control.
Important Remote server commands are only permitted using Robo-FTP in concert with its companion Robo-FTP Server product - both products of Serengeti Systems Incorporated.
There are important security considerations related to the use of remote server commands that should not be taken lightly. Configuration of both Robo-FTP (on the client-side) and Robo-FTP Server (on the server) should be undertaken by a knowledgeable system administrator with these considerations in mind. For more information, see Issuing Remote Server Commands.
Individual script commands are submitted with this command. Scripts can be run on the server via the CALL or CHAIN script commands. Of course, script file(s) must exist on the server prior to running them. It is possible to upload a script to the server from Robo-FTP and then run it if that is appropriate for your application.
There are two ways script commands may be issued using this command which is controlled with the /wait option.
By default (i.e., when the /wait option is omitted) the server-side script command runs asynchronously with the local script. This mode may be referred to as non-blocking mode. In this mode, control is returned to the local script immediately (usually well before the server-side script command completes). This mode is normally used when launching scripts to run server-side or when launching individual commands (e.g., PGPDECRYPT ) that may take more then a few seconds to complete.
When command(s) are launched in non-blocking mode, the local script should use the RSCMDSTATUS script command to periodically check for completion of the server-side command(s). If the local script ascertains that the server-side script command(s) have not completed within an expected time period, the RSCMDCANCEL script command may be used to cancel the operation.
When the /wait option is used, the server-side script command runs synchronously with the local script. This mode may be referred to as blocking mode. In this mode, control is not returned to the local script until the server-side script command completes. This mode allows for simpler local scripts (i.e., no need to monitor for completion) but it should be avoided when issuing any server-side command(s) (especially CALL or CHAIN) PGPDECRYPT that may take more then a few seconds to complete.
Important The first RSCMD for a given session between Robo-FTP and Robo-FTP Server determines if the entire session is to be blocking or non-blocking. In other words, the mixing of RSCMD script commands with and without the /wait option is not allowed in the same session. Log off and back on again if you need to switch modes.
The /timeout option is especially important for blocking mode sessions. Consider this time-out to be a failsafe control for your script. This time-out permits Robo-FTP to recover if for some reason the RSCMD script command (either blocking or non-blocking) fails to return which may happen, for example, if the connection to the server fails. If the /timeout option is omitted, the default time-out is 30 seconds.
Consider the following example, where Robo-FTP zips some files and then requests that the zip archive be downloaded. This example also shows minimal error checking. This example uses non-blocking mode and similar logic should be used when issuing a CALL or CHAIN command to the server.
RSCMD "ZIP 'pdf_files.zip ' '*.pdf'" IFERROR $ERROR_RSCMD_INITIATED OKAY GOTO wait_zip GOTO no_zip_file :wait_zip PAUSE /for=1 IFERROR= $ERROR_RSCMD_IN_PROGRESS GOTO wait_zip IFERROR GOTO no_zip_file RCVFILE "pdf_files.zip" :no_zip_file
Consider the following example, where Robo-FTP sets the server-side working folder for script operation. This example uses blocking mode since the submitted command is expected to complete quickly.
RSCMD "WORKINGDIR 'client x'" /wait IFERROR= $ERROR_RSCMD_FAILED GOTO rscmd_failed
Related Command(s): RSCMDCANCEL , RSCMDSTATUS
|