Differences

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

scriptcommand_keepuptodate 2013-04-15 scriptcommand_keepuptodate 2023-08-21 (current)
Line 1: Line 1:
-====== keepuptodate ======+====== keepuptodate command ======
[[task_keep_up_to_date|Watches for changes]] in local directory and reflects them on remote one. [[task_keep_up_to_date|Watches for changes]] in local directory and reflects them on remote one.
 +
 +===== Syntax =====
  keepuptodate [ <local directory> [ <remote directory> ] ]   keepuptodate [ <local directory> [ <remote directory> ] ]
-When directories are not specified, current working directories are synchronized. To stop watching for changes press ''Ctrl-C''.+===== Remarks ===== 
 + 
 +When directories are not specified, current working directories are synchronized. To stop watching for changes press ''Ctrl+C''
 + 
 +If you do not want the synchronization to be aborted or interrupted by errors, use command ''[[scriptcommand_option#batch|option batch continue]]'' before starting.
Note: Overwrite confirmations are always off for the command. Note: Overwrite confirmations are always off for the command.
Line 10: Line 16:
Switches: Switches:
^ Switch                  ^ Description ^ ^ Switch                  ^ Description ^
-| ''-delete''              | Delete obsolete files  | +| ''-==delete==''              | Delete obsolete files.  | 
-| ''-permissions=<mode>''  | Set permissions ([[SFTP]] and [[SCP]] protocols only) | +| ''-==permissions===<mode>''  | Set permissions ([[SFTP]] and [[SCP]] protocols only).
-| ''-nopermissions''      | Keep default permissions | +| ''-==nopermissions==''      | Keep default permissions.
-| ''-speed=<kibps>'' ······| Limit transfer speed | +| ''-==speed===<kbps>'' ·······| Limit transfer speed (in KB/s).
-| ''-transfer=<mode>''    | ''%%binary|ascii|automatic%%'' \\ [[transfer_mode|Transfer mode]]: binary, ascii (text), automatic (by extension). |  +| ''-==transfer===<mode>''    | ''%%binary|ascii|automatic%%'' \\ [[transfer_mode|Transfer mode]]: binary, ascii (text), automatic (by extension). |  
-| ''-filemask=<mask>''    | ''%%<mask>[;<mask2>...]%%'' \\ Sets [[file_mask|file mask]]. |  +| ''-==filemask===<mask>''    | ''%%<mask>[;<mask2>...]%%'' \\ Sets [[file_mask|file mask]]. |  
-| ''-resumesupport=<state>'' | ''%%on|off|<threshold>%%'' \\ Configures [[resume#automatic|automatic resume/transfer to temporary filename]]. &amp;beta_feature | +| ''-==resumesupport===<state>'' | ''%%on|off|<threshold>%%'' \\ Configures [[resume#automatic|automatic resume/transfer to temporary filename]]. |  
 +| ''-==rawtransfersettings== setting1=value1 setting2=value2 ...'' | Allows configuring any transfer settings using [[rawtransfersettings|raw format]] as in an INI file. E.g. to enable preserving of directory timestamps, use ''-rawtransfersettings PreserveTimeDirs=1''. The switch should come only after other parameters. |
-Effective [[scriptcommand_option|options]]: ''reconnecttime''+Effective [[scriptcommand_option|options]]: ''[[scriptcommand_option#reconnecttime|reconnecttime]]''
-XML log elements: ''[[logging_xml#upload|upload]]'', ''[[logging_xml#touch|touch]]'', ''[[logging_xml#chmod|chmod]]'' (with ''-permissions''), ''[[logging_xml#rm|rm]]'' (with ''-delete'')+XML log elements: ''[[logging_xml#upload|upload]]'', ''[[logging_xml#touch|touch]]'', ''[[logging_xml#mkdir|mkdir]]'', ''[[logging_xml#chmod|chmod]]'' (with ''[[#permissions|-permissions]]''), ''[[logging_xml#rm|rm]]'' (with ''[[#delete|-delete]]'')
===== Examples ===== ===== Examples =====
<code winscp> <code winscp>
keepuptodate -delete keepuptodate -delete
 +</code>
 +<code winscp>
keepuptodate d:\www /home/martin/public_html keepuptodate d:\www /home/martin/public_html
 +</code>
 +<code winscp>
keepuptodate -filemask="|*.bak; *.tmp" keepuptodate -filemask="|*.bak; *.tmp"
</code> </code>
 +===== [[net]] Converting to .NET Assembly =====
 +There is no equivalent for ''keepuptodate'' command in [[library|.NET assembly]].
 +You can make use of ''[[dotnet>System.IO.FileSystemWatcher]]'' to run non-recursive synchronization using ''[[library_session_synchronizedirectories|Session.SynchronizeDirectories]]'', when change in local directory occurs.

Last modified: by martin