Differences
This shows you the differences between the selected revisions of the page.
2008-04-16 | 2008-04-21 | ||
4.1 bug 34 (martin) | no summary (85.180.154.39) (hidden) | ||
Line 1: | Line 1: | ||
- | ====== Script Commands ====== | + | ]] to select multiple files. To download more files to current working directory use ''.\'' as the last parameter. |
- | In its [[scripting|scripting]] functionality, WinSCP supports following commmands. | + | |
- | + | ||
- | You can see the very same help for the commands as shown here, if you type command ''[[script_commands#help|help <command>]]'' directly in console. | + | |
- | + | ||
- | You can use environment variables in the path, with syntax %NAME%. | + | |
- | + | ||
- | ===== call ===== | + | |
- | With [[protocols|SFTP and SCP protocols]], executes arbitrary [[remote_command|remote shell command]]. | + | |
- | With FTP protocol, executes a protocol command. | + | |
- | + | ||
- | call <command> | + | |
- | + | ||
- | If current session does not allow execution of arbitrary remote command separate [[shell session]] will be automatically opened. | + | |
- | + | ||
- | The command must not require user input. | + | |
- | + | ||
- | Alias: ''!'' | + | |
- | + | ||
- | Examples: | + | |
- | <code winscp> | + | |
- | call mysqldump --opt -u USERNAME --password=PASSWORD --all-databases > all_databases.sql | + | |
- | call gzip -c all_databases.sql > all_databases.gz | + | |
- | </code> | + | |
- | + | ||
- | ===== cd ===== | + | |
- | Changes remote working directory for active session. | + | |
- | + | ||
- | cd [ <directory> ] | + | |
- | + | ||
- | If ''directory'' is not specified, changes to home directory. | + | |
- | + | ||
- | Examples: | + | |
- | <code winscp> | + | |
- | cd /home/martin | + | |
- | cd | + | |
- | </code> | + | |
- | + | ||
- | ===== chmod ===== | + | |
- | [[task_properties|Changes permissions]] of one or more remote files. | + | |
- | + | ||
- | chmod <mode> <file> [ <file2> ... ] | + | |
- | + | ||
- | ''mode'' can be specified as three or four-digit octal number. | + | |
- | + | ||
- | Filename can be replaced with [[file_mask|wildcard]] to select multiple files. | + | |
- | + | ||
- | Examples: | + | |
- | <code winscp> | + | |
- | chmod 644 index.html about.html | + | |
- | chmod 1700 /home/martin/public_html | + | |
- | chmod 644 *.html | + | |
- | </code> | + | |
- | + | ||
- | ===== close ===== | + | |
- | Closes session. | + | |
- | + | ||
- | close [ <session> ] | + | |
- | + | ||
- | Closes session specified by its number. When ''session'' is not specified, closes currently selected session. | + | |
- | + | ||
- | Examples: | + | |
- | <code winscp> | + | |
- | close 1 | + | |
- | close | + | |
- | </code> | + | |
- | + | ||
- | ===== exit ===== | + | |
- | Closes all sessions and terminates the program. | + | |
- | + | ||
- | exit | + | |
- | + | ||
- | Alias: ''bye'' | + | |
- | + | ||
- | ===== get ===== | + | |
- | [[task_download|Downloads]] one or more files from remote directory to local directory. | + | |
- | + | ||
- | get <file> [ [ <file2> ... ] <directory>\[ <newname> ] ] | + | |
- | + | ||
- | Downloads one or more files from remote directory to local directory. If only one parameter is specified downloads the file to local working directory. If more parameters are specified, all except the last one specify set of files to download. The last parameter specifies target local directory and optionally [[operation_mask|operation mask]] to store file(s) under different name. Destination directory must end with backslash. Filename can be replaced with [[file_mask|wildcard]] to select multiple files. To download more files to current working directory use ''.\'' as the last parameter. | + | |
Use [[script_commands#option|option]] command to set [[transfer_settings|transfer options]]. | Use [[script_commands#option|option]] command to set [[transfer_settings|transfer options]]. |