Thanks for the great script!  I can modify it to move the Declude and other
logs as well.  This is much better than the Ipswitch Isplcln.exe which just
deletes files (I need to move them to a better location, not delete them).

-Joe

----- Original Message ----- From: "Cris Porter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 08, 2004 10:21 PM
Subject: RE: [IMail Forum] Remove logs from spool directory...



Here's a little VB script that I have scheduled every night at 12:05.
There's probably a more efficient way to do it, but this works for me.
Cris
======================================================
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
dim currdate,oldfile,newfile
currdate= ""
if month(now()-1)<10 then currdate=currdate & "0" & month(now()-1) else
currdate=currdate & month(now()-1) end if
if day(now()-1)<10 then currdate=currdate & "0" & day(now()-1) else
currdate=currdate & day(now()-1) end if
oldfile = "D:\imail\spool\sys" & currdate & ".txt"
newfile = "E:\imaillogs\sys" & currdate & ".txt"
if objFSO.FileExists(oldfile) then
  objFSO.CopyFile oldfile, newfile, OverwriteExisting
  if objFSO.FileExists(newfile) then
     objFSO.DeleteFile(oldfile)
     end if
  end if
======================================================


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/

Reply via email to