Solved

FTP / IIS4.0

Posted on 2000-02-16
16
584 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
  • 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
 
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now