Sync to FTP site does not delete destination directory

Advertisement

pagnin
Joined:
Posts:
4
Location:
Italia

Sync to FTP site does not delete destination directory

Using WinSCP version 4.2.4 build 610
Origin OS: windows 2003 SP2
Destination FTP server: Windows 2000 and IIS FTP server
Using scripting automation

error message:
> 2009-11-05 17.01.04.666 CWD /test/directory/
< 2009-11-05 17.01.04.666 250 CWD command successful.
 
....
 
> 2009-11-05 17.01.04.853 RMD /test/directory/
< 2009-11-05 17.01.04.853 550 /test/directory: Impossibile accedere al file. Il file è utilizzato da un altro processo.
. 2009-11-05 17.01.04.853 Asking user:
. 2009-11-05 17.01.04.853 Error deleting file '\test\directory'. ("/test/directory: Impossibile accedere al file. Il file è utilizzato da un altro processo. ")
. 2009-11-05 17.01.04.853 Disconnected from server
this happen during the execution of the command:
synchronize remote -mirror -delete c:\test\directory /test/directory
It seems that windows 2000 server and IIS does not allow to delete the directory if the directory is still in use by a user process.

This lock happen every time because it is winscp that does the CWD command to the directory it has to delete and does not change the directory before trying to delete it.

In fact, issuing the RMD command after WinSCP has run, with the exact same directory does delete the directory correctly.

Let me know if you need more info.

Reply with quote

Advertisement

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

Re: sync to ftp site does not delete destination directory

Please post a full log file showing the problem.

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. For posting extensive logs you may use pastebin or similar application. 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 may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

Reply with quote

pagnin
Joined:
Posts:
4
Location:
Italia

Re: log emailed

Yes. I have resent the log, this time I have compressed it in a zip file, may be 380Kb where too much? (the previous mail was still in the delivery queue with a 45X error).

I have monitored the new mail and it has been delivered to the destination mail host, so you should get it, this time.

Regards

Reply with quote

Advertisement

pagnin
Joined:
Posts:
4
Location:
Italia

update

[quote]From the log it looks like you have used [m]\test\directory[/m] as remote directory path instead of [m]/test/directory[/m].
Is it correct? Can you try it with [m]/test/directory[/m]? [/quote]
I have tried and effectively it works.

Why the different behavior, if I can ask?

Reply with quote

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

Re: update

pagnin wrote:

I have tried and effectively it works.

Why the different behavior, if I can ask?
Before deleting remote directory, WinSCP checks if the current working directory is below the deleted one. If it is, it moves away from it. WinSCP thinks it is deleting \test\test\test and the current directory is /test/test/test, which for WinSCP is different directory. So it does not move out. The problem here is that your server does not care about which slashes are used. Normally if you tell regular *nix server to go to \test\test\test, it would fail. Your server does not, instead it goes to /test/test/test.

Reply with quote

Advertisement

You can post new topics in this forum