Solved

FTP / IIS4.0

Posted on 2000-02-16
16
590 Views
Last Modified: 2013-12-23
I've got an FTP client that GETs a file from my FTP Server (IIS 4.0) then
Deletes the file after getting it.  Pretty simple batch file.  Goes
something like this:

Open the connection....
CD DIRXYZ
MGET *.XYZ
MDELETE *.XYZ
Then close the connection (you get the idea)

I've got it running every 5 minutes or so.  Works great "most" of the time.
Here is the strange thing.  Every once in a blue moon (about every 3 weeks
or so) the MDELETE fails to work, but the MGET continues to work.  Well,
this causes chaos because every five minutes; the same file is retrieved
over and over.

When this fails, I've tried to manually ftp to the server and delete the
file (with Admin rights), but I get "Access Denied" when I do a DELETE
*.XYZ.

Finally, when I stop the FTP services (through IIS) and start the services
the MDELETE *.XYZ works like a champ.

Does anyone know why my FTP server would intermittently deny a DELETE
command until stopped and started?  I've looked for a trend in the logs, but
I am unable to find any.

Thanks in advance.
0
Comment
Question by:spriolo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +3
16 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 2529702
hi spriolo,

do you call the size property when doing the batch?

http://support.microsoft.com/support/kb/articles/Q182/0/06.ASP?LNG=ENG&SA=MSDN&FR=1

is about that problem

another one, and maybe more obvious is about locked files that can't be deleted

http://support.microsoft.com/support/kb/articles/Q186/8/02.ASP?LNG=ENG&SA=MSDN&FR=1

HTH:O)Bruintje
0
 
LVL 3

Expert Comment

by:klover
ID: 2529898
0
 

Author Comment

by:spriolo
ID: 2531137
Klover:

In the little batch script I do not "PUT" and files on the server.  Only MGET and MDELETE.

Bruint:
This is the same research I found in the KB.  I'm looking into the transfer being interupted, but this takes time.

Has anyone had a similar problem with their ftp server?

Thanks
0
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 
LVL 55

Accepted Solution

by:
andyalder earned 250 total points
ID: 2531202
Maybe worth putting "wait.exe 20" (or sleep.exe) inbetween the mget and the mdelete incase the mdelete starts before IIS realises mget has finished.

I haven't had this problem with IIS but I have seen it with other FTP servers.
0
 
LVL 3

Expert Comment

by:klover
ID: 2531506
I posted that article because it's the same principle.  Your mget caches the file, and may be locking it just as described by the article.

Good luck...
0
 
LVL 55

Expert Comment

by:andyalder
ID: 2534252
klover, have just read the article you posted, same as I think. Agree PUT is unimportant, there's a race condition.
0
 

Author Comment

by:spriolo
ID: 2535635
Does anyone know of a tool that will watch the directory in question for this event?  Maybe a service...

An update:  I've set the batch script to wait between the MGET and the MDELETE.

As far as the TechNet articles.  Here is a strange finding:  When the file in question does not get deleted; the future files placed in this directory do not get deleted either.  All of the files are successfully transfered, but when the delete of one file fails, the future files fail to delete also...

I think this behavior rules out a file being locked because of an interupted file transfer.  I'm not sure though.

Any thoughts?
0
 
LVL 44

Expert Comment

by:bruintje
ID: 2537699
what does the eventlog return?
0
 
LVL 3

Expert Comment

by:klover
ID: 2537839
Try a good 'ole netstat -n on the server and/or the workstation after the FTP session to see if any ports are hung open.  I've been having this problem at a client where multiple computers check the same mailbox.  About once a week, I have to have one of the users reboot because even though she has quit her mail program long ago, a netstat shows her connected to the mailserver, blocking access to that account by other users.

Maybe it's the workstation, have you tried it from another client?
0
 

Author Comment

by:spriolo
ID: 2542470
Bruinte: this is the thing.  The evenlogs are clean from any errors.  The ftp logs show issues though.  the ftp logs show tons of "sent" line items (to be expected); but other than that I'm getting an error free failure.

Using netstat -n will help, but the in the case of this ftp session wich happens every 5 min. 24 hours per day 7 days a week. (thats 2016 sessions per week).  This tends to become tedious.

I'm looking for a tool that will maybe look at a folder and listen for "non-activity / activity".  I'm really not sure what could be used here.
0
 
LVL 3

Expert Comment

by:klover
ID: 2543198
Try shutting down your MS FTP, and put up one of the shareware ones for a while.  Maybe this will haelp you debug it.
0
 
LVL 1

Expert Comment

by:dsazama
ID: 2556813
I swear I am having de ja vu and have seen almost the exact question posted here previously, but I am not sure how to search the archives (I don't get on here much)

As I recall, the answer had to do with setting a default timeout on the FTP server to stay open longer for the MDELETE to have a chance to finish

Or I could just be blowing smoke
0
 

Expert Comment

by:lbmacbride
ID: 2584397
You didn't say what the size of the files that you are transferring are.  If the files are large, then MGET will take longer to complete.  Try increasing the interval of the wait between the MGET and MDELETE commands.
Also, you may want to add a wait between MDELETE and the CLOSE command to allow the file to finish being deleted before you attempt to close the connection.
Hope it helps!
0
 

Author Comment

by:spriolo
ID: 2587524
lbmacbride: The files are about 25K.  All text.  they arrive via a mapped drive on an EDI computer and leave via FTP/IIS4.0 to a Unix server.

I've placed a pause between the commands, I'm not sure if this has solved anything but I am now unable to duplicate the failure.

who should get these very ambiguous points?
0
 

Expert Comment

by:lbmacbride
ID: 2603207
Spirolo:
This seemed to be a team effort...   but you are the final arbiter for the answer.  I think that if you cant duplicate the failure, then it's solved.

Cheers!

LB
0
 
LVL 55

Expert Comment

by:andyalder
ID: 2604071
klover's article was the first to suggest putting in a wait between the mget and mdelete
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief overview to explain gateways, default gateways and static routes OR NO - you CANNOT have two default gateways on the same server, PC or other Windows-based network device. In simple terms a gateway is formed when a computer such as a serv…
The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question