This is an old revision of the document!
keepuptodate
Watches for changes in local directory and reflects them on remote one.
Advertisement
Syntax
keepuptodate [ <local directory> [ <remote directory> ] ]
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 option batch continue
before starting.
Note: Overwrite confirmations are always off for the command.
Switches:
Switch | Description |
---|---|
-delete |
Delete obsolete files. |
-permissions=<mode> |
Set permissions (SFTP and SCP protocols only). |
-nopermissions |
Keep default permissions. |
-speed=<kbps> |
Limit transfer speed (in KB/s). |
-transfer=<mode> |
binary|ascii|automatic Transfer mode: binary, ascii (text), automatic (by extension). |
-filemask=<mask> |
<mask>[;<mask2>...] Sets file mask. |
-resumesupport=<state> |
on|off|<threshold> Configures automatic resume/transfer to temporary filename. |
-rawtransfersettings setting1=value1 setting2=value2 … |
Allows configuring any transfer settings using 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. |
Advertisement
Effective options: reconnecttime
XML log elements: upload
, touch
, mkdir
, chmod
(with -permissions
), rm
(with -delete
)
Examples
keepuptodate -delete
keepuptodate d:\www /home/martin/public_html
keepuptodate -filemask="|*.bak; *.tmp"
Converting to .NET Assembly
There is no equivalent for keepuptodate
command in .NET assembly.
You can make use of System.IO.FileSystemWatcher
to run non-recursive synchronization using Session.SynchronizeDirectories
, when change in local directory occurs.