How can you get "File or folder '***\import_list_rows_917613.txt' does not exist." during synchronization? Does the file disappear during the operation?
- martin
Dim session As New Session
Try
' Upload files options
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary
' Setup session options
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = remote.Protocol
.HostName = remote.HostName
.UserName = remote.UserName
.Password = remote.Password
.PortNumber = remote.PortNumber
.GiveUpSecurityAndAcceptAnySshHostKey = remote.GiveUpSecurityAndAcceptAnySshHostKey
.SshHostKeyFingerprint = remote.SshHostKeyFingerprint
.TimeoutInMilliseconds = 4 * 60 * 1000 ' min * sec * millisec
.Timeout = TimeSpan.FromMinutes(4)
End With
' Will continuously report console
AddHandler session.OutputDataReceived, AddressOf OutputDataReceived
' Will continuously report progress of synchronization
AddHandler session.FileTransferred, AddressOf FileTransferred
' Connect
session.Open(sessionOptions)
' Synchronize files
Dim synchronizationResult As SynchronizationResult
synchronizationResult = session.SynchronizeDirectories(SynchronizationMode.Remote, local_path, remote_path, False, True, SynchronizationCriteria.Time)
' Throw on any error
synchronizationResult.Check()
Log("End syncronize", "SUCCESS", Color.Green)
Catch _e As Exception
Log(_e.Message, "ALERT", Color.Red)
Finally
session.Close()
End Try
10/01/2017 18:47:32 - INFO - File or folder '***\import_list_rows_917613.txt' does not exist.
10/01/2017 18:47:32 - INFO - System Error. Code: 2.
10/01/2017 18:47:32 - INFO - Impossibile trovare il file specificato
10/01/2017 18:47:37 - INFO - (A)bort, (R)etry, (S)kip, Ski(p) all: Abort
10/01/2017 18:49:45 - ALERT - Timeout waiting for WinSCP to respond