Bug with Comparison Criteria

Advertisement

BoffinBrain
BoffinBrain avatar
Joined:
Posts:
12
Location:
United Kingdom

Bug with Comparison Criteria

Hi again!

This has happened to me a few times in the last few months. It's still present in 5.7.2 but I'm not sure when it first manifested itself.

By default, I choose to compare by both modification date and file size when doing a sync. However, I've found occasions when one or two files haven't been synced when they should have been. When I have detected this, I have experimented by just using file size as my comparison criteria, and only then did it detect the difference.

I'm wondering if the comparison criteria is doing a logical AND instead of a logical OR for these differences. I think it's implicit that if you have moth criteria checked, WinSCP should consider a file as different if either the timestamp OR file size is different, not both.

Can you confirm this observation?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Bug with Comparison Criteria

WinSCP is doing OR.

Please attach a full log file showing the problem (using the latest version of WinSCP). Note a name of a file that should be considered different and was not.

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

BoffinBrain
BoffinBrain avatar
Joined:
Posts:
12
Location:
United Kingdom

I'm uploading a log file. I removed the 'session upkeep' lines to make it easier to read.

I enabled debug level 2 in the logging window and then performed 3 synchronizations:

The first one used both criteria and returned no results.
The second used modification date only and returned no results.
The third one used file size only, and returned one result. I then synchronized the file.

This file, orderConfirmation.asp, has a different file size AND a different modification date, so it should have shown for all three synchronizations.
  • comparisonlog.txt (82.64 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

You are using local-to-remote synchronization.

The local (source) file orderConfirmation.asp is older than the remote (target) file.

So clearly when using "time" criteria only, the file is not updated.
With "time or size" criteria, it's not that obvious. Because it not really "newer or different-size", but "newer or (same-age but different-size)". So again, the file is not updated, because it's older.
See https://winscp.net/eng/docs/ui_synchronize#criteria

If you want to update file on any difference, not only when the file is newer, use Mirror files mode.
See https://winscp.net/eng/docs/task_synchronize_full#mode

Reply with quote

BoffinBrain
BoffinBrain avatar
Joined:
Posts:
12
Location:
United Kingdom

Okay, that's strange, because the local file should have been 5 minutes newer than the remote version. This was showing correctly in the file panels too. Is there a timezone issue on the server side?

Mirror mode might be a viable workaround, but it would be nice to know why the timestamps weren't working for me on this occasion.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

The scripting should use the same timestamps as the GUI.
Can you attach a screenshot of the panels, corresponding complete (!) session log file and complete scripting session log file?

Reply with quote

Advertisement

You can post new topics in this forum