【问题标题】:WinSCP Keep up to date command stuck on checking for changesWinSCP保持最新命令停留在检查更改上
【发布时间】:2020-03-09 12:16:06
【问题描述】:

我目前正在本地环境中测试keepuptodate 命令,以便在服务器上部署正确的完整命令,但keepuptodate 出现问题。

我在 Windows 10 上使用“Xlight FTP Server”作为测试服务器,我在 WinSCP 上将访问保存为“test_local”(我知道这不是一个好习惯,但这只是一个测试)

我在shell中写的命令是

WinSCP.exe test_local /Console /Script=script.txt

script.txt 包含

option batch on
option confirm off
option transfer automatic
keepuptodate -delete F:\mirror_test /
close
exit

我还尝试通过启用日志记录来记录脚本

/log="F:\WinSCP.log"

选项,这是日志

. 2020-03-08 15:07:06.590 --------------------------------------------------------------------------
. 2020-03-08 15:07:06.590 Using FTP protocol.
. 2020-03-08 15:07:06.590 Doing startup conversation with host.
> 2020-03-08 15:07:06.591 PWD
< 2020-03-08 15:07:06.690 257 "/"
. 2020-03-08 15:07:06.691 Getting current directory name.
. 2020-03-08 15:07:06.691 Startup conversation with host finished.
< 2020-03-08 15:07:06.691 Script: Active session: [1] anonymous@192.168.1.81
> 2020-03-08 15:07:06.692 Script: option transfer binary
< 2020-03-08 15:07:06.692 Script: transfer        binary    
> 2020-03-08 15:07:06.693 Script: keepuptodate F:\mirror_test /
< 2020-03-08 15:07:06.693 Script: Checking for changes started, press 'Ctrl-C' to stop...
< 2020-03-08 15:07:06.694 Script: Looking for subfolders in 'F:\mirror_test'...
. 2020-03-08 15:07:06.694 Keep up to date: Looking for subfolders in 'F:\mirror_test'...
< 2020-03-08 15:07:06.705 Script: Checking for changes in folder 1...
. 2020-03-08 15:07:06.707 Keep up to date: Checking for changes in folder 1...
. 2020-03-08 15:07:36.532 Sending dummy command to keep session alive.
> 2020-03-08 15:07:36.532 TYPE A
< 2020-03-08 15:07:37.032 200 Type set to A.

然后一切都卡住了。

【问题讨论】:

    标签: windows powershell ftp winscp


    【解决方案1】:

    keepuptodate 命令仅在某些情况发生变化时才会执行某些操作。如果目录未同步,则在命令启动时它不会同步目录。

    要同步目录,请使用synchronize command

    如果您仍想持续同步更改,您可以通过 keepuptodate 关注。

    【讨论】:

      猜你喜欢
      • 2011-05-19
      • 2018-04-17
      • 1970-01-01
      • 2019-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-12
      相关资源
      最近更新 更多