First, thanks for your software! :)
I am using SynchronizeDirectories to sync local files to Ubuntu server, and vica versa using SFTP Protocol. When syncing to SFTP server, the SynchronizationResult.Removals have list of removed files. When syncing from SFTP server to local, the Removals are empty list.
I have reduced this to very simple test case. One side has an empty folder, other - one file. I have enabled logging, and also capturing .xml file by placing break-point at XML file deleting in Session.cs file:
Logger.WriteLine("Deleting XML log file [{0}]", XmlLogPath);
try
{
File.Delete(XmlLogPath);
}
When syncing from local to SFTP, the XML file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="MY_SERVER_NAME" start="2019-07-18T13:36:17.488Z">
<group name="sftp://ubuntu@MY_SERVER_NAME:22 -hostkey="ssh-rsa 2048 *************************=" -privatekey="C:\key.ppk" -timeout=60 -passphrase=***" start="2019-07-18T13:36:20.219Z">
</group>
<group name="" start="2019-07-18T13:36:21.029Z">
<cwd>
<cwd value="/home/ubuntu" />
<result success="true" />
</cwd>
</group>
<group name="remote -delete -nopermissions -preservetime -transfer="binary" -resumesupport="off" -criteria="either" -- "c:\test case\" "/home/ubuntu/the test directory/"" start="2019-07-18T13:36:21.108Z">
<rm>
<filename value="/home/ubuntu/the test directory/first file.txt" />
<result success="true" />
</rm>
</group>
<group name="" start="2019-07-18T13:36:21.942Z">
</group>
</session>
There is entry
rm
in the XML file, and
SynchronizationResult.Removals
have one entry. So far so good. Now I try sync in other direction. Capturing XML file:
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="ubuntu@MY_SERVER_NAME" start="2019-07-18T13:06:40.914Z">
<group name="sftp://ubuntu@MY_SERVER_NAME:22 -hostkey="ssh-rsa 2048 *************************=" -privatekey="C:\some_key.ppk" -timeout=60 -passphrase=***" start="2019-07-18T13:06:43.509Z">
</group>
<group name="" start="2019-07-18T13:06:43.611Z">
<cwd>
<cwd value="/home/ubuntu" />
<result success="true" />
</cwd>
</group>
<group name="local -delete -nopermissions -preservetime -transfer="binary" -resumesupport="off" -criteria="either" -- "c:\test case\" "/home/ubuntu/the test directory/"" start="2019-07-18T13:06:43.692Z">
</group>
<group name="" start="2019-07-18T13:06:44.555Z">
</group>
</session>
There is no entry for
rm
, and
Removals
are also empty. However, the file is synced correctly (deleted), and other log file also have clue that file was deleted:
> 2019-07-18 16:06:44.067 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
> 2019-07-18 16:06:44.067 04,00,00,04,04,00,00,00,04,00,00,00,00,
. 2019-07-18 16:06:44.067 Sent 17 bytes
. 2019-07-18 16:06:44.067 There are 0 bytes remaining in the send buffer
. 2019-07-18 16:06:44.067 Looking for network events
. 2019-07-18 16:06:44.067 Timeout waiting for network events
. 2019-07-18 16:06:44.067 .;d;0;2019-07-18T13:02:37.000Z;3;"ubuntu" [1000];"ubuntu" [1000];rwxrwxr-x;0
. 2019-07-18 16:06:44.067 ..;d;0;2019-07-18T13:02:37.000Z;3;"ubuntu" [1000];"ubuntu" [1000];rwxr-xr-x;0
. 2019-07-18 16:06:44.067 Local file 'c:\test case\first file.txt' [2019-07-18T13:06:33.882Z] [1] is new
< 2019-07-18 16:06:44.067 Script: Synchronizing...
. 2019-07-18 16:06:44.067 Synchronizing local directory 'c:\test case\' with remote directory '/home/ubuntu/the test directory/', params = 0x403 (Delete, NoConfirmation, BySize)
< 2019-07-18 16:06:44.068 Script: Local 'c:\test case' <= Remote '/home/ubuntu/the test directory'
< 2019-07-18 16:06:44.140 Script: 'c:\test case\first file.txt' deleted
. 2019-07-18 16:06:44.187 Session upkeep
. 2019-07-18 16:06:44.187 Looking for network events
. 2019-07-18 16:06:44.187 Detected network event
. 2019-07-18 16:06:44.187 Enumerating network events for socket 1324
. 2019-07-18 16:06:44.187 Enumerated 1 network events making 1 cumulative events for socket 1324
. 2019-07-18 16:06:44.187 Handling network read event on socket 1324 with error 0
. 2019-07-18 16:06:44.187 Received 28 bytes (0)
> 2019-07-18 16:06:44.555 Script: exit
. 2019-07-18 16:06:44.555 Session upkeep
Am I doing something wrong? If you need more information, I will gladly provide it.
Thanks in advance! :)