Keeping dir up to date: frequent changes of the same file

Advertisement

Ydriuf
Joined:
Posts:
11

Keeping dir up to date: frequent changes of the same file

If "Keeping remote directory up to date" for an FTP server is active and a specific file is updated frequently (which happens a lot while e.g. testing remote application), WinSCP fails to update it more often than once in a minute (of local time) on some servers.

It looks this way in the log:

22:23:06 Scanning 'Z:\Business\MBurda.com\_Site' for subdirectories...
22:23:06 Watching for changes in 18 directories...

(first change, file gets uploaded)
22:23:19 Change in 'Z:\Business\MBurda.com\_Site' detected.
22:23:20 File 'Z:\Business\MBurda.com\_Site\index.php' uploaded.
22:23:20 Change in 'Z:\Business\MBurda.com\_Site' detected.

(second change that minute, no action)
22:23:54 Change in 'Z:\Business\MBurda.com\_Site' detected.
22:23:54 Change in 'Z:\Business\MBurda.com\_Site' detected.

(new minute starts, third change occurs and the file gets uploaded again)
22:24:01 Change in 'Z:\Business\MBurda.com\_Site' detected.
22:24:02 File 'Z:\Business\MBurda.com\_Site\index.php' uploaded.
22:24:03 Change in 'Z:\Business\MBurda.com\_Site' detected.
22:24:03 File 'Z:\Business\MBurda.com\_Site\index.php' uploaded.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,478
Location:
Prague, Czechia

Re: Keeping dir up to date: frequent changes of the same fil

Ydriuf wrote:

If "Keeping remote directory up to date" for an FTP server is active and a specific file is updated frequently (which happens a lot while e.g. testing remote application), WinSCP fails to update it more often than once in a minute (of local time) on some servers.
Usually with FTP, the server reports file timestamp with minute-precision only. Hence WinSCP when comparing time of local and remote time is not able to detect the change, if it happens the same minute as the last one.

Use SFTP is possible.

Reply with quote

Ydriuf
Joined:
Posts:
11

I understand.
However, I know a regular FTP server that does not cause that problem even though it lists timestamps with minute precision only.

Here a sample of its raw file list:
150 Opening ASCII mode data connection for file list
drwxr-xr-x 2 xxdyfit-www www 112 Apr 3 10:47 style
-rw-r--r-- 1 bodyfit-www www 4 Jun 16 07:43 test.txt
[...]

And a sample of monitoring log from this server:
10:00:04 Scanning 'Z:\Business\xxdyfit\_site' for subdirectories...
10:00:04 Watching for changes in 46 directories...
(first change)
10:00:06 Change in 'Z:\Business\xxdyfit\_site\trener' detected.
10:00:07 File 'Z:\Business\xxdyfit\_site\trener\test.txt' uploaded.
10:00:08 Change in 'Z:\Business\xxdyfit\_site\trener' detected.
10:00:09 File 'Z:\Business\xxdyfit\_site\trener\test.txt' uploaded.
(second change)
10:00:12 Change in 'Z:\Business\xxdyfit\_site\trener' detected.
10:00:12 File 'Z:\Business\xxdyfit\_site\trener\test.txt' uploaded.
10:00:13 Change in 'Z:\Business\xxdyfit\_site\trener' detected.
10:00:14 File 'Z:\Business\xxdyfit\_site\trener\test.txt' uploaded.
(it looks like here every file is uploaded twice but no idleness issue arises)

Therefore I think the problem might also be in something else than remote timestamp precision.

Another thing is that to effectively monitor local changes WinSCP needs only to remember original local timestamps and to upload files that it knows have changed (when their local timestamps have changed) regardless of whether they have the same timestamp remotely or not.

Reply with quote

martin
Site Admin
martin avatar

Ydriuf wrote:

However, I know a regular FTP server that does not cause that problem even though it lists timestamps with minute precision only.
Isn't that caused by timezone difference? If you compare times in local and remote panel, do you see the same times?

Reply with quote

Advertisement

Ydriuf

Actually this is the case. And this seems to solve the problem (on that server).
Maybe keeping dirs up to date would work better if there was no local-to-remote timestamp comparing for regular FTP servers. Or, at least, if there was an option for turning such comparisons off.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,478
Location:
Prague, Czechia

Ydriuf wrote:

Actually this is the case. And this seems to solve the problem (on that server).
OK, but that WinSCP will upload whole directory with every change, because the timestamps differ.

Maybe keeping dirs up to date would work better if there was no local-to-remote timestamp comparing for regular FTP servers. Or, at least, if there was an option for turning such comparisons off.
WinSCP gets notification from Windows about change. But only about change in a directory. It does not know a file which has changed. Hence it needs to find yout itself (by comparing timestamps).

Reply with quote

Ydriuf
Joined:
Posts:
11

Sometimes it may be acceptable and more convenient to have a whole directory uploaded (in case of small-sized directories, e.g. ones with text files) instead of having to wait for a new minute to be able to upload a file.

However, I see a solution for binary transfers. When the timestamp is the same, file sizes could be compared. It solves the problem in most cases.

With a little more effort, sizes could also be compared in text mode (with remote file size being local file size minus number of CRLFs in it).

Reply with quote

Advertisement

JXT
Guest

Hey, any progress on that issue? :cry: It's very important for me. I want to watch local dir with more than one file changes within a minute and to use FTP protocol for uploading.
Is there any estimate when we can expect improvement on "keep remote dir" feature?

Reply with quote

AGTY
Guest

Hi,

I was wondering if any progress was being made with this, I use a SFTP to a cloud storage solution and when I am working on the files I like them to update the cloud copy with each save.

My problem is that the service I use does not allow timestamps to be modified, which means that each save does send the file to the server but also causes WinSCP to display an error.

Regards
Allan

Reply with quote

martin
Site Admin
martin avatar

AGTY wrote:

I was wondering if any progress was being made with this, I use a SFTP to a cloud storage solution and when I am working on the files I like them to update the cloud copy with each save.
No progress yet, as can be seen on the tracker.

Reply with quote

Advertisement

You can post new topics in this forum