Keeping remote directories up to date... doesn't

Advertisement

FodderMK
Joined:
Posts:
5

Keeping remote directories up to date... doesn't

I have the following directory structure:

Local
C:\Development\ferrets.mywebsite.net\
C:\Development\ferrets.mywebsite.net\templates\pages\
C:\Development\shared_library\

Remote
/home/html/ferrets.mywebsite.net/
/home/html/ferrets.mywebsite.net/templates/pages
/home/html/shared_library

I point WinSCP to C:\Development\ and /home/html/, then highlight the three directories listed on my local machine and click on "Keep remote directories up to date". The options I have selected are:

- Update subdirectories
- Existing files only
- Selected files only

I also use Subversion, so like I good boy should I have the following mask to help WinSCP ignore useless directories:

Exclude */.svn/

Now all is usually fine and good; I make changes and they are automatically transferred - as they should be. However I've noticed a problem when I try to update templates and scripts with the same name.

For example, lets pretend I have the following files:
C:\Development\ferrets.mywebsite.net\import_new_orders.php
C:\Development\ferrets.mywebsite.net\templates\pages\import_new_orders.tmpl

I can edit the .tmpl file as much as I like, and each time I save it is uploaded correctly. Then I decide to edit the .php file. No problem! That too is uploaded correctly when I save. But now! Whenever I edit the .tmpl file and save WinSCP does nothing. It doesn't report detecting a change in my \templates\pages\ directory and it doesn't upload the changed file.

I have confirmed that the timestamp in the templates file is being updated. I have also tested and retested the order of events. If I start "Keep remote ..." update the .php file and then update the template, the template does not upload. If I then stop and restart "Keep remote ..." and re-save the template it uploads fine.

So in summary: this only occurs when I modify a script file with the same name as a template file. This affects multiple machines I have on hand (3 in total, WinXP and Win2K) so I'm sure it isn't something specific to my main box.

Some other stats that may help you:
WinSCP is monitoring 94 directories and approx 600 files

Any help would be appreciated!

Reply with quote

Advertisement

duerra
Donor
Joined:
Posts:
45

I can also verify that there are problems with the auto-upload functionality in the latest release. It only happens when directories are being monitored, and not when an individual file has been opened for editing from the remote system.

I stopped using the auto-sync because of this, so I can verify that something should be looked at here.
_________________
When you put everything into something, it means everything to you.

Reply with quote

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

Re: Keeping remote directories up to date... doesn't

FodderMK wrote:

So in summary: this only occurs when I modify a script file with the same name as a template file. This affects multiple machines I have on hand (3 in total, WinXP and Win2K) so I'm sure it isn't something specific to my main box.
I have followed your instruction step by step. Unfortunatelly it works for me correctly. So there must be something else. When you edit the tmpl file, do you see at least the "change ... detected" message in the log? BTW, what version of WinSCP are you using?

Reply with quote

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

duerra wrote:

I can also verify that there are problems with the auto-upload functionality in the latest release. It only happens when directories are being monitored, and not when an individual file has been opened for editing from the remote system.

I stopped using the auto-sync because of this, so I can verify that something should be looked at here.
And what is it? :-)

Reply with quote

duerra
Donor

Well, I can tell you this much - it only appears to happen *after* I have already monitored a directory on the same connection previously. It seems to work just fine the first time. WinSCP also seems to know that a file was modified in the bottom panel, but the file doesn't appear to be uploaded.
_________________
When you put everything into something, it means everything to you.

Reply with quote

Advertisement

duerra
Donor
Joined:
Posts:
45

Here's a screenshot. I can get it to happen pretty much every time (except for the first time, it seems, but don't rely on that too much).

<invalid link removed>

And just to anticipate a question.... yes, those files should be the exact same size if it was uploaded properly (no funny line ending rewrite settings or anything like that), it's not on the exclude list, etc.

Reply with quote

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

duerra wrote:

Here's a screenshot. I can get it to happen pretty much every time (except for the first time, it seems, but don't rely on that too much).
From the screenshot I can see that the change time of local file is before the change time of remote file. Thus the file is naturally not uploaded. Have you any idea what may be cause for that?

Reply with quote

FodderMK
Joined:
Posts:
5

Re: Keeping remote directories up to date... doesn't

martin wrote:

I have followed your instruction step by step. Unfortunatelly it works for me correctly. So there must be something else. When you edit the tmpl file, do you see at least the "change ... detected" message in the log? BTW, what version of WinSCP are you using?
I am using version 3.7.6 build 306.

I do not see the "change ... detected" message, so I can only assume WinSCP is not seeing the change for some reason.

To help debug the problem I tried several tests. In each case I modified and saved the .php file first and then the .tmpl file. (Also in each case I tried modifying the .tmpl file, the .php file and then the .tmpl file, for every case the .tmpl file would copy over the first time) After each test I undid any changes to the main directory by refreshing it against my SVN repository.

1) Removed all but view_client.php and templates/pages/view_client.tmpl.
Result: .tmpl file did not transfer

2) Renamed the directories on the local and remote sites from ferrets.mywebsite.com to testing.mywebsite.net
Result: .tmpl file did not transfer

3) Copied the directory structure, resulting in a directory called ferrets.mywebsite.com2, copied this new directory to the remote site.
Result: .tmpl file did not transfer

4) Created a brand new directory called testing.mywebsite.net, created the files testing.php and templates/pages/testing.tmpl.
Result: .tmpl file did transfer.

5) Copied the files from the original ferrets.mywebsite.com to the directory testing.mywebsite.net created in test #4.
Result: .tmpl file did transfer.

That one confused me even more. So I wiped out the remote directory entirely, re-copied the files over and turned on the sync. The files transferred correctly.

Keeping in mind that my local files were still in their original state, I am no closer to figuring out why this works. When I have more time I'll test it out on the other boxes and see what happens. Had I know it would be that simple to resolve I would have done it weeks ago!

Reply with quote

martin
Site Admin
martin avatar

Re: Keeping remote directories up to date... doesn't

Thanks for your tests. Can you tell, what's the difference between point 3) and 5)?

Reply with quote

Advertisement

FodderMK
Joined:
Posts:
5

As far as I could tell the only difference was the testing.php and testing.tmpl files that were still in the directory from test #4. Unfortunately I do not have the older, unworking directory on the remote site anymore in order to re-verify this.

There must have been something in that remote directory though...

Reply with quote

duerra
Donor
Joined:
Posts:
45

martin wrote:

duerra wrote:

Here's a screenshot. I can get it to happen pretty much every time (except for the first time, it seems, but don't rely on that too much).
From the screenshot I can see that the change time of local file is before the change time of remote file. Thus the file is naturally not uploaded. Have you any idea what may be cause for that?
Wow. Interesting. Maybe the server time is a bit off...?

Yep. The server appears to be running a couple minutes fast. I'm guessing this makes a difference? =/

Reply with quote

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

duerra wrote:

Wow. Interesting. Maybe the server time is a bit off...?

Yep. The server appears to be running a couple minutes fast. I'm guessing this makes a difference? =/
WinSCP should set the timestamp of uploaded file to the same as original one. BTW, if you upload file manually (not via synchronisation) and check "preserve timestamp", is the file of the uploaded file the same as the original one?

Reply with quote

Advertisement

duerra
Donor
Joined:
Posts:
45

I'm sure it is, but right now I don't own the files I'm writing, and the server doesn't allow setting the timestamp on files you don't own, so that's where my problem is.

I would like to ask for the time not to be considered when a changed file is detected like that, but that's a call I think you're better left to make, based on the overall needs of the people using WinSCP. While I can't think of any reason why the timestamp should be considered (and like this situation, there are times when it causes problems), you may have ideas why this could cause problems.
_________________
When you put everything into something, it means everything to you.

Reply with quote

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

duerra wrote:

I would like to ask for the time not to be considered when a changed file is detected like that, but that's a call I think you're better left to make, based on the overall needs of the people using WinSCP. While I can't think of any reason why the timestamp should be considered (and like this situation, there are times when it causes problems), you may have ideas why this could cause problems.
Problem is that Windows provides mechanism for watching for changes of whole directory only. It won't tell you what file has changed. I detect it by comparing the timestamps against the remote directory.

Reply with quote

Advertisement

You can post new topics in this forum