Differences

This shows you the differences between the selected revisions of the page.

2006-09-21 2006-09-21
continuation (martin) finish (martin)
Line 70: Line 70:
  get <file> [ [ <file2> ... ] <directory>\[ <newname> ] ]   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.+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]].
Line 76: Line 76:
Alias: ''recv'' Alias: ''recv''
-Effective [[script_commands#option|options]]: transfer, confirm, exclude, include+Effective [[script_commands#option|options]]: ''transfer'', ''confirm'', ''exclude'', ''include''
Examples: Examples:
Line 111: Line 111:
Note: Overwrite confirmations are always off for the command. Note: Overwrite confirmations are always off for the command.
-Effective [[script_commands#option|options]]: transfer, synchdelete, exclude, include+Effective [[script_commands#option|options]]: ''transfer'', ''synchdelete'', ''exclude'', ''include''
Examples: Examples:
Line 159: Line 159:
  lpwd   lpwd
-··+
===== ls ===== ===== ls =====
Lists the contents of specified directory. Lists the contents of specified directory.
Line 202: Line 202:
mv *.html /home/backup/*.bak mv *.html /home/backup/*.bak
</code> </code>
 +
 +===== open =====
 +Establishes new connection.
 +
 +  open <stored session>
 +  open [ sftp|scp:// ][ <user> [ :password ] @ ] <host> [ :<port> ]
 +
 +Establishes connection to given host. Use either name of the ''[[ui_login_stored_sessions|stored session]]'' or specify ''host'', ''username'', ''port'' and protocol directly.
 +
 +Examples:
 +<code winscp>
 +open sftp://martin@example.com:2222
 +open martin@example.com
 +open example.com
 +open
 +</code>
 +
 +===== option =====
 +Shows or sets value of script options.
 +
 +  option [ <option> [ <value> ] ]
 +
 +If no parameters are specified, lists all script options and their values. When one parameter is specified only, shows value of the option. When two parameters are specified sets value of the option. Initial values of some options are taken from application configuration, however modifing the options does not change the application configuration.
 +
 +Options are:
 +^ Option          ^ Values and description ^
 +| ''batch''      | ''%%on|off|abort|continue%%'' \\ Toggles batch mode (all prompts are automatically replied negatively). When ''on'', it is recommended to set ''confirm'' to ''off'' to allow overwrites. With ''abort'' script is aboted when any error occurs. With ''continue'' all errors are ignored. \\ Commands affected: nearly all |
 +| ''confirm''    | ''%%on|off%%'' \\ Toggles confirmations (overwrite, etc.). \\ Commands affected: ''[[script_commands#get|get]]'', ''[[script_commands#put|put]]'' |
 +| ''transfer''    | ''%%binary|ascii|automatic%%'' \\ [[transfer_mode|Transfer mode]]: binary, ascii (text), automatic (by extension). \\ Commands affected: ''[[script_commands#get|get]]'', ''[[script_commands#put|put]]'', ''[[script_commands#synchronize|synchronize]]'', ''[[script_commands#keepuptodate|keepuptodate]]'' |
 +| ''synchdelete'' | ''%%on|off%%'' \\ Should obsolete files be deleted during [[task_synchronize|synchronisation]]? \\ Commands affected: ''[[script_commands#synchronize|synchronize]]'', ''[[script_commands#keepuptodate|keepuptodate]]'' |
 +| ''exclude'' \\ ''include''    | ''%%clear | <mask> [ ; <mask2> ... ]%%'' \\ Sets [[ui_transfer#other_options|exclusion or inclusion]] [[file_mask|masks]] (only one can be set at time). \\ Commands affected: ''[[script_commands#get|get]]'', ''[[script_commands#put|put]]'', ''[[script_commands#synchronize|synchronize]]'', ''[[script_commands#keepuptodate|keepuptodate]]'' |
 +
 +Aliases: ''ascii'' (for ''option transfer ascii''), ''binary'' (for ''option transfer binary'')
 +
 +Examples:
 +<code winscp>
 +option transfer
 +option confirm off
 +option include "*.html; */"
 +option
 +</code>
 +
 +===== put =====
 +[[task_upload|Uploads]] one or more files from local directory to remote directory.
 +
 +  put <file> [ [ <file2> ... ] <directory>/[ <newname> ] ]
 +
 +If only one parameter is specified uploads the file to remote working directory. If more parameters are specified, all except the last one specify set of files to upload. The last parameter specifies target remote directory and optionally [[operation_mask|operation mask]] to store file(s) under different name. Destination directory must end with slash. Filename can be replaced with [[file_mask|wildcard]] to select multiple files. To upload more files to current working directory use ''./'' as the last parameter.
 +
 +Use [[script_commands#option|option]] command to set [[transfer_settings|transfer options]].
 +
 +Alias: ''send''
 +
 +Effective [[script_commands#option|options]]: ''transfer'', ''confirm'', ''exclude'', ''include''
 +
 +Examples:
 +<code winscp>
 +put index.html
 +put index.html about.html ./
 +put index.html about.html /home/martin/public_html/
 +put d:\www\index.html about.*
 +put *.html *.png /home/martin/backup/*.bak
 +</code>
 +
 +===== pwd =====
 +Prints current remote working directory for active session.
 +
 +  pwd
 +
 +===== rm =====
 +Removes one or more remote files.
 +
 +  rm <file> [ <file2> ... ]
 +
 +If [[ui_login_environment#recycle_bin|remote recycle bin]] is configured, moves file to the bin instead of deleting it. Filename can be replaced with [[file_mask|wildcard]] to select multiple files.
 +
 +Examples:
 +<code winscp>
 +rm index.html
 +rm index.html about.html
 +rm *.html
 +</code>
 +
 +===== rmdir =====
 +Removes one or more remote directories.
 +
 +  rmdir <directory> [ <directory2> ... ]
 +
 +If [[ui_login_environment#recycle_bin|remote recycle bin]] is configured, moves directory to the bin instead of deleting it.
 +
 +Example:
 +<code winscp>
 +rmdir public_html
 +</code>
 +
 +===== session =====
 +Manages opened sessions.
 +
 +  session [ <session> ]
 +
 +Makes session specified by its number active. When session number is not specified, lists connected sessions.
 +
 +Examples:
 +<code winscp>
 +session 1
 +session
 +</code>
 +
 +===== synchronize =====
 +[[task_synchronize_full|Synchronizes directories]].
 +
 +  synchronize local|remote|both [ <local directory> [ <remote directory> ] ]
 +
 +When the first parameter is ''local'' synchronises local directory with remote one. When the first parameter is ''remote'' synchronises remote directory with local one. When the first parameter is ''both'' synchronises directories one against the other.
 +
 +When directories are not specified, current working directories are synchronized.
 +
 +Obsolete files are deleted, if [[script_commands#option|option]] ''synchdelete'' is on. Note: Overwrite confirmations are always off for the command.
 +
 +Effective [[script_commands#option|options]]: ''transfer'', ''synchdelete'', ''exclude'', ''include''
 +
 +Examples:
 +<code winscp>
 +synchronize remote
 +synchronize both d:\www /home/martin/public_html
 +</code>
 +