Differences
This shows you the differences between the selected revisions of the page.
| scriptcommand_call 2014-02-28 | scriptcommand_call 2025-03-06 (current) | ||
| Line 1: | Line 1: | ||
| - | ====== call ====== | + | ====== call command ====== |
| With [[protocols|SFTP and SCP protocols]], executes arbitrary [[remote_command|remote shell command]]. | With [[protocols|SFTP and SCP protocols]], executes arbitrary [[remote_command|remote shell command]]. | ||
| - | With FTP protocol, executes a protocol command. | + | With FTP protocol, executes a protocol command. Not supported with WebDAV and S3 protocols. |
| ===== Syntax ===== | ===== Syntax ===== | ||
| Line 7: | Line 7: | ||
| call <command> | call <command> | ||
| - | ===== Remarks ===== | + | ===== [[remarks]] Remarks ===== |
| With SFTP protocol, that does not allow execution of arbitrary remote command, separate [[shell session]] will be automatically opened. | With SFTP protocol, that does not allow execution of arbitrary remote command, separate [[shell session]] will be automatically opened. | ||
| Line 13: | Line 13: | ||
| The command must not require user input. | The command must not require user input. | ||
| - | It is an error, if the command has any error output, but no standard output. To circumvent that redirect error output to ''nul'' (''2>/dev/null'') or to standard output (''2>&1''). | + | It is an error, if the command has any error output, but no standard output. To circumvent that redirect the error output to ''null'' (''2>/dev/null'') or to the standard output (''2>&1''). |
| + | |||
| + | If the command execution takes long, you may hit a session timeout. If you need to execute long-running commands, increase the session timeout using the ''[[scriptcommand_open#timeout|-timeout]]'' switch of the ''[[scriptcommand_open|open]]'' command. | ||
| Alias: ''!'' | Alias: ''!'' | ||
| Line 22: | Line 24: | ||
| <code winscp> | <code winscp> | ||
| call mysqldump --opt -u USERNAME --password=PASSWORD --all-databases > all_databases.sql | call mysqldump --opt -u USERNAME --password=PASSWORD --all-databases > all_databases.sql | ||
| + | </code> | ||
| + | <code winscp> | ||
| call gzip -c all_databases.sql > all_databases.gz | call gzip -c all_databases.sql > all_databases.gz | ||
| </code> | </code> | ||
| - | ===== Converting to .NET Assembly ===== | + | ===== [[net]] Converting to .NET Assembly ===== |
| When [[library_from_script|converting script to .NET Assembly]], map ''call'' command to ''[[library_session_executecommand|Session.ExecuteCommand]]'' method. | When [[library_from_script|converting script to .NET Assembly]], map ''call'' command to ''[[library_session_executecommand|Session.ExecuteCommand]]'' method. | ||
| Parameters mapping: Command parameter ''command'' maps to method parameter ''command''. | Parameters mapping: Command parameter ''command'' maps to method parameter ''command''. | ||