But again, if Windows sees the file as 12:00 AM 04/17/06 rather than 11:59:59 PM 04/16/06 and you are running the script on 04/17/06 then it will not include yesterday’s log as Windows says it was modified today.

 

FYI, I am doing this for IIS logs, KIWI logs as well as Declude logs so I am looking for a universal solution.

 

John T

eServices For You

 

"Seek, and ye shall find!"

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dean Lawrence
Sent:
Monday, April 17, 2006 11:36 AM
To: Declude.JunkMail@declude.com
Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line

 

John,

 

I run the following 2 commands on my daily IIS log files.

 

forfiles /p c:\clients /s /d -3 /m ex*.log /c "cmd /c wzzip @fname.zip @file"

 

forfiles /p c:\clients /s /d -3 /m ex*.log /c "cmd /c del @file"

 

I keep each of my clients log files underneath their own client directory so I use forfiles to identify the log files and zips anything that is older than 3 day (so that I can review if something happened over the weekend). I then run the same command, but using delete instead of wzzip. Both of these commands are in a simple bat file that I call from windows scheduler.

 

Hope it helps,

 

Dean



 

On 4/17/06, John T (Lists) <[EMAIL PROTECTED]> wrote:

I am trying to create a batch file that will zip up a weeks worth of logs
and then move that zip file.

The problem I am having is that I want to zip the previous 7 days, but
sometimes the last log is time stamped say
04/16/06 11:59 PM and sometimes
say 04/17/06 12:00 AM. Because of that, if I run the batch file on 04/17/06,
it may or may not include the log file for 04/16/06 depending on the final
time stamp.

Other than stopping services just before midnight and then restarting, what
is the best way to always ensure that I am processing the correct day's
files?

John T
eServices For You

"Seek, and ye shall find!"



---
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.




--
__________________________________________
Dean Lawrence, CIO/Partner
Internet Data Technology
888.GET.IDT1 ext. 701 * fax: 888.438.4381
http://www.idatatech.com/
Corporate Internet Development and Marketing Specialists

Reply via email to