Thanks to both of you for the guidance.

Kevin, sleep.exe is from the Resource Kit.

I've coded up a script fragment that should handle this, but I would appreciate some feedback on if this is the correct way to go. Obvious declarations omitted:
' Disable error handling
On Error Resume Next

' Move the specified file, retry after 5 seconds if error is found, limit to 100 tries.
intRetry = 100
Do While intRetry > 0
ÂÂÂ objFS.MoveFile strSource, strDestination
ÂÂÂ If Err <> 0 Then
ÂÂÂ ÂÂÂ objShell.Run "cmd /c sleep.exe 5", 0 , true
ÂÂÂ ÂÂÂ Err.Clear
ÂÂÂ ÂÂÂ intRetry = intRetry - 1
ÂÂÂ Else
ÂÂÂ ÂÂÂ intRetry = -1
ÂÂÂ End If
Loop

' Quit the script if it has retried the MoveFile operation 100 times
If intRetry = 0 Then
ÂÂÂ WScript.Quit(0)
End If

' Re-enable error handling
On Error GoTo 0


Thanks,

Matt







Kevin Bilbee wrote:
Where did you get the sleep.exe???

Kevin Bilbee

  
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of DLAnalyzer
Support
Sent: Wednesday, November 17, 2004 3:59 PM
To: [EMAIL PROTECTED]
Subject: Re: [Declude.JunkMail] Log file locking???


Matt, 

It's possible its a locking issue.  What specifically is the 
error message 
it is returning? 

I ran into similar issue with a log rotating script I wrote to move logs 
around into WebTrends.  I was trying to rotate a log file still being 
downloaded and it would cause an issue. 

When I would encounter the error I would "sleep" 30 seconds and try it 
again. 

on error resume next 

If ( Err <> 0 ) Then
  oShell.run "cmd /c sleep.exe 30", 0 , true
  Err.Clear
End If 


Darrell 

 ------------------------------------------------------------------------
Check out http://www.invariantsystems.com for utilities for Declude And 
Imail.  IMail/Declude Overflow Queue Monitoring, MRTG 
Integration, and Log 
Parsers. 


Matt writes: 

    
I'm wondering if someone familiar with the logging of IMail, 
      
Declude and 
    
Sniffer and scripting could enlighten me on an issue that I am 
      
having.  I 
    
have a script that is run every hour on my server that takes the 4 logs 
generated by these processes, moves them to a temp folder on the same 
drive, and then appends the data to a log file for each day that is 
archived on another drive. 

The problem that I am having is that the script (written in 
      
VBScript) is 
    
failing part way into the process about once every day or two, 
      
or about 1 
    
out of 40 times.  It seems to always fail after creating the temp 
directory, or after moving the IMail log into the temp directory, which 
happens to be the first two steps (the third is to move the Declude 
JunkMail log).  The only thing that I can think of is that the 
      
script is 
    
unable to move these files because they are being locked by the 
      
system as 
    
they are being updated.  Both the IMail and JunkMail logs are seeing 
between 3MB and 15MB of data per hour depending on the time of 
      
day and the 
    
log. 

So if someone could confirm whether or not this could be some form of a 
locking issue that prevents a VBScript move (object.MoveFile), 
      
that would 
    
be appreciated.  Also, if this is a locking issue, what would be the 
recommended work around for handling this?  I'm not familiar 
      
with a method 
    
of retrying the move until successful within VBScript, though 
      
maybe there 
    
is a way to detect the error condition and loop until none is 
      
found, or a 
    
maximum number of tries has occurred. 

Thanks, 

Matt 

-- 
=====================================================
MailPure custom filters for Declude JunkMail Pro.
http://www.mailpure.com/software/
===================================================== 

---
[This E-mail was scanned for viruses by Declude Virus 
(http://www.declude.com)] 

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.
      
 

---
[This E-mail was scanned for viruses by Declude Virus 
    
(http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.

---
[This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.


  

-- 
=====================================================
MailPure custom filters for Declude JunkMail Pro.
http://www.mailpure.com/software/
=====================================================

Reply via email to