Thanks for your persistence with this!
By way of explanation for log panes, my current workspace consists of a left pane (my local site directory structure) and a right pane (the remote site directory structure). Both structures have sync nav on. In the right (site) pane, I also have the log view open, so I see all the NOPs and so on.
I reset the default file exists rule to "Ask" to try and help me figure out how SFTP is identifying the duplicate files, but that's just confused me more, as the overwrite prompt only shows the date/time have changed (they haven't, the server's date/time and timezone setting is just different to mine), there's no indication that the content is identical, and the checkbox value is ignored (i.e. the "Ask" setting in the site's preferences isn't reset by the checkbox). So I'll skip that for now.
Using the "Default Rules" setting, I get *exactly* the same prompts and commands as using "Ask" and selecting "Overwrite". I haven't changed any default rules that I'm aware of, the only things I've tried to change are the favourite's rules in the favourite's property settings, and I only modify those when I'm not connected to the site.
I can see there seems to be a problem in the transfer queue log, with the MDTM and MFMT commands, but I have no idea why the MDTM works in the main log command stream, but not in the tq log stream.
First, I'll transfer the exact same file I just transferred less than a minute ago.
In the right pane log view, when I select the duplicate file for transfer to the remote site, I see:
[08:08:30] SIZE TEST_FILE_A.txt
[08:08:30] 213 11
[08:08:30] MDTM TEST_FILE_A.txt
[08:08:30] 213 20090610080709
[08:08:31] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
The transfer queue log is:
8< snip login details >8
[08:08:37] PASV
[08:08:37] 227 Entering Passive Mode (1,1,1,1,1,154).
[08:08:37] Opening data connection to 1.1.1.1 Port: 41114
[08:08:37] STOR TEST_FILE_A.txt
[08:08:37] 150 Opening BINARY mode data connection for TEST_FILE_A.txt
[08:08:37] 11 bytes transferred. (239 bytes/s) (46 ms)
[08:08:37] 226 Transfer complete.
[08:08:37] MDTM 20090609220748 TEST_FILE_A.txt
[08:08:37] 550 20090609220748 TEST_FILE_A.txt: No such file or directory
[08:08:37] MFMT 20090609220748 TEST_FILE_A.txt
[08:08:37] 500 MFMT not understood
[08:08:37] SITE UTIME TEST_FILE_A.txt 20090609220748 20090609220748 20090609220748 UTC
[08:08:38] 500 'SITE UTIME' not understood
[08:08:38] SITE UTIME 20090609220748 TEST_FILE_A.txt
[08:08:38] 500 'SITE UTIME' not understood
[08:08:38] SIZE TEST_FILE_A.txt
[08:08:38] 213 11
And then in the site log pane, I see:
[08:08:38] SIZE TEST_FILE_A.txt
[08:08:38] 213 11
[08:08:38] MDTM TEST_FILE_A.txt
[08:08:38] 213 20090610080739
[08:08:38] STAT TEST_FILE_A.txt
[08:08:38] 211-Status of TEST_FILE_A.txt:
[08:08:38] -rw-r--r-- 1 username group 11 Jun 10 08:07 TEST_FILE_A.txt
[08:08:38] 211 End of Status
(N.B. I DON'T see the failed commands from the transfer log in the site log and vice-versa, so I'm not just cutting and pasting the bits I think are important, the only data I've removed is the login and IP/user details, and the IPs are modified to protect the innocent
Now, transferring a
different file, but with exactly the same size and
local date/time stamp as the previous file, in the site log pane I see:
[08:13:00] SIZE TEST_FILE_A.txt
[08:13:00] 213 11
[08:13:00] MDTM TEST_FILE_A.txt
[08:13:01] 213 20090610080739
Again, there is no indication of the content being changed, only the same type of date/time stamp mismatch as with the original file I transferred previously.
Anyway, in the transfer queue log, I now get:
8< snip login details >8
[08:13:16] PASV
[08:13:16] 227 Entering Passive Mode (1,1,1,1,160,196).
[08:13:16] Opening data connection to 1.1.1.1 Port: 41156
[08:13:16] STOR TEST_FILE_A.txt
[08:13:16] 150 Opening BINARY mode data connection for TEST_FILE_A.txt
[08:13:16] 11 bytes transferred. (239 bytes/s) (46 ms)
[08:13:16] 226 Transfer complete.
[08:13:16] MDTM 20090609220759 TEST_FILE_A.txt
[08:13:16] 550 20090609220759 TEST_FILE_A.txt: No such file or directory
[08:13:16] MFMT 20090609220759 TEST_FILE_A.txt
[08:13:16] 500 MFMT not understood
[08:13:16] SITE UTIME TEST_FILE_A.txt 20090609220759 20090609220759 20090609220759 UTC
[08:13:16] 500 'SITE UTIME' not understood
[08:13:16] SITE UTIME 20090609220759 TEST_FILE_A.txt
[08:13:16] 500 'SITE UTIME' not understood
[08:13:16] SIZE TEST_FILE_A.txt
[08:13:17] 213 11
And finally in the site log :
[08:13:17] SIZE TEST_FILE_A.txt
[08:13:17] 213 11
[08:13:17] MDTM TEST_FILE_A.txt
[08:13:17] 213 20090610081218
[08:13:17] STAT TEST_FILE_A.txt
[08:13:17] 211-Status of TEST_FILE_A.txt:
[08:13:18] -rw-r--r-- 1 username grooup 11 Jun 10 08:12 TEST_FILE_A.txt
[08:13:18] 211 End of Status
I'm sorry to keep saying this, but the time/date and size checks are completely irrelevant to me. I ONLY want to overwrite files with the
same name that have
different content.
Using the hash option for identical files in the favourite's identical file settings page, doesn't appear to do anything - there are no extra commands visible in either log pane when that option is checked.
So I still can't seem to find a way to use any of the rules in a meaningful way. If I choose "no matter" for size and time, I only get the option to overwrite or skip, and SFTP doesn't seem to take the file content into consideration, so the rule matching bypasses the content check.
OTOH, if I use "unknown" for the size/time checks, the rule always fails, as the time and size CAN be determined, and the remote file is overwritten or skipped - again, regardless of the content!
If I use any
other combination of size and/or time rules, again, the content check is skipped, and ONLY the SIZE or the TIME are used to determine the action.
So
the SFTP overwrite/skip logic always seems to bypass the file content, which is the
only variable I want to base the uploads on. Or am I missing something much more obvious and simple?
I don't mind the performance penalty involved with determining file contents with identical sizes with the hash algorithm - I don't want a
FAST site update, I want a
CORRECT site update! I hope that makes sense.
Since I manage a few different client sites with different ISPs, all the servers are slightly different, and all have different date/time settings, so I CAN'T just use a single time/date offset, as that won't work across daylight savings changes, and I can't use a per-site offset, as that is invalidated by server rebuilds and daylight savings and so on. Since I have no control over the remote servers, the time and date stamps are completely irrelevant and useless. That's why I want to use the content/size as the criteria for overwriting.
If you would like me to set up and try some site rules to see if we can get SFTP working the way I need, please let me know and I'll get back to you asap.
I should also note that when renaming a file in my local files pane using SFTP, SFTP displays the modified date and time, but the "modified" timestamp for the file on the NTFS volume doesn't change. But that's another issue for later I guess! One step at a time...
I'm also happy to continue trying to find out why the default rules don't seem to work the way I expect, if it helps sort someone else out too that's no problem.
But my immediate focus is getting SFTP working with my client sites, as I'm currently doing bulk uploads for ALL the sites!
Cheers,
PCPete