Good point. Add to the weekly file daily instead of running just once at the end of the week... assuming you don't need the files for reporting in the interim. Then you just need to have a function to determine the zip file name for the week.
Darin. ----- Original Message ----- From: "Nick Hayer" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Monday, April 17, 2006 2:21 PM Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line John T (Lists) wrote: >I am trying to create a batch file that will zip up a weeks worth of logs >and then move that zip file. > > kake. w/pkzip command line... >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. > > how about this. Always zip up the logs after midnight. Then for sure the prev day is complete and you need to ignore todays. [I am presuming you will only have the 7 days in the dir to be zipped] # set archive filename file name for /f "Tokens=2-4 Delims=/ " %%i in ('date /t') do set archivename=g:\imail\spool\archive%%i%%j.zip # get todays log file name for /f "Tokens=2-4 Delims=/ " %%i in ('date /t') do set excludefilename=g:\imail\spool\sys%%i%%j.txt # -f is a switch to exclude file names PKZIP -f %excludefilename% %archivename% sys*.txt Didn't try it but at least its a start... -Nick ps - the more you save the more you will have to produce if you get served with a Discovery :) >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. > > > > --- 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 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.
