Re: [Declude.JunkMail] OT: Help with WinZip command line
Hi John, Actually, it came with the NT 4 and 2000 Server Resource kits. It only started to be include with the system in 2003. Here's site where you can get the files. http://www.dynawell.com/support/Reskit/win2k.asp Forfiles works great in that it transverses all my client folders, finds the unzipped logs based upon their date and then zips them using the original file name. The second command I use does the same thing, but deletes the unzipped copy of the files that were just zipped. Dean On 4/19/06, John T (Lists) <[EMAIL PROTECTED]> wrote: > > > > Only comes on Windows Server 2003 SP1 or above. > > > > Tried running it on Windows Server 2000 and it errored saying target system > must be running Windows XP or above. > > > > > > John T > > eServices For You > > > > "Seek, and ye shall find!" > > > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Matt > Sent: Wednesday, April 19, 2006 4:28 PM > > To: Declude.JunkMail@declude.com > Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line > > > > To: Declude.JunkMail@declude.com > Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line > > > > > > > John, > > I would suggest taking a second look at Dean's reply. The "forfiles" > command acts on the date of the file and not the time stamp, so therefore > you won't be having issues with timestamps. It also has the ability to go > through an entire directory tree and use wildcards to find the files, and > then it passes the file names in to the chained app (WinZip command line) > for execution. This is about as simple as it gets. You could do the entire > task in one line of code. > > The only caveat is that I am not sure whether or not Windows 2000 comes with > forfiles, but I'm sure that you could always copy the executable over from > Windows 2003 if needed. > > Matt > > > John T (Lists) wrote: What is defining %%f? > > John T > eServices For You > > "Seek, and ye shall find!" > > > > -----Original Message- > From: [EMAIL PROTECTED] > [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of Andy Schmidt > Sent: Wednesday, April 19, 2006 3:26 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > Hi John, > > The FOR/DO will iterate through the directory listing using "ex*.log" and > then perform a WINZIP for each item. > > The /R makes it recursive (meaning, including subfolders) - which is what > you want. > > &&f is one item in the directory list (the path to one log file at a > > time). > > ~ modifies an item from the directory list, specifically: > ~dpn takes only the drive, path and filename (leave out the extension) > > So: > > %%~dpnF.zip > > means, take the directory item %%F, put use only the drive:/Path/Filename > and append ".zip". > > In other words the Winzip command will look like that > > WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. > > for each of youu log files in all of your subfolders. > > > Best Regards > Andy Schmidt > > Phone: +1 201 934-3414 x20 (Business) > Fax:+1 201 934-9206 > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > John T (Lists) > Sent: Wednesday, April 19, 2006 06:09 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > > I just use the winzip command line tool every day to turn the 1 day > old "log" file into a "zip" file by the SAME name in the SAME > location. This way, you can simply move anything *.zip to a different > drive, while *.log are "current" log files. > > Here is the content of my Compress2DayOldLogs.cmd file: > > C: > CD "C:\WINNT\system32\LogFiles\" > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex > > -Td01 > > %%~dpnf.zip %%f > > OK, can some one please explain the logic of this line. This appears to be > what I need to do. My understanding is that it is only calling the winzip > command to a specific file name. > > 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 De
Re: [Declude.JunkMail] OT: Help with WinZip command line
John, Actually, it's in the Windows 2000 Resource Kit. You can download the executable from the following page instead of installing the entire package: http://www.petri.co.il/download_free_reskit_tools.htm Matt John T (Lists) wrote: Only comes on Windows Server 2003 SP1 or above. Tried running it on Windows Server 2000 and it errored saying target system must be running Windows XP or above. John T eServices For You "Seek, and ye shall find!" -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Matt Sent: Wednesday, April 19, 2006 4:28 PM To: Declude.JunkMail@declude.com Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line John, I would suggest taking a second look at Dean's reply. The "forfiles" command acts on the date of the file and not the time stamp, so therefore you won't be having issues with timestamps. It also has the ability to go through an entire directory tree and use wildcards to find the files, and then it passes the file names in to the chained app (WinZip command line) for execution. This is about as simple as it gets. You could do the entire task in one line of code. The only caveat is that I am not sure whether or not Windows 2000 comes with forfiles, but I'm sure that you could always copy the executable over from Windows 2003 if needed. Matt John T (Lists) wrote: What is defining %%f? John T eServices For You "Seek, and ye shall find!" -Original Message- From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- [EMAIL PROTECTED]] On Behalf Of Andy Schmidt Sent: Wednesday, April 19, 2006 3:26 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line Hi John, The FOR/DO will iterate through the directory listing using "ex*.log" and then perform a WINZIP for each item. The /R makes it recursive (meaning, including subfolders) - which is what you want. &&f is one item in the directory list (the path to one log file at a time). ~ modifies an item from the directory list, specifically: ~dpn takes only the drive, path and filename (leave out the extension) So: %%~dpnF.zip means, take the directory item %%F, put use only the drive:/Path/Filename and append ".zip". In other words the Winzip command will look like that WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. for each of youu log files in all of your subfolders. Best Regards Andy Schmidt Phone: +1 201 934-3414 x20 (Business) Fax: +1 201 934-9206 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of John T (Lists) Sent: Wednesday, April 19, 2006 06:09 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line I just use the winzip command line tool every day to turn the 1 day old "log" file into a "zip" file by the SAME name in the SAME location. This way, you can simply move anything *.zip to a different drive, while *.log are "current" log files. Here is the content of my Compress2DayOldLogs.cmd file: C: CD "C:\WINNT\system32\LogFiles\" FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 %%~dpnf.zip %%f OK, can some one please explain the logic of this line. This appears to be what I need to do. My understanding is that it is only calling the winzip command to a specific file name. 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.
Re: [Declude.JunkMail] OT: Help with WinZip command line
Suck city! Matt John T (Lists) wrote: Only comes on Windows Server 2003 SP1 or above. Tried running it on Windows Server 2000 and it errored saying target system must be running Windows XP or above. John T eServices For You "Seek, and ye shall find!" -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Matt Sent: Wednesday, April 19, 2006 4:28 PM To: Declude.JunkMail@declude.com Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line John, I would suggest taking a second look at Dean's reply. The "forfiles" command acts on the date of the file and not the time stamp, so therefore you won't be having issues with timestamps. It also has the ability to go through an entire directory tree and use wildcards to find the files, and then it passes the file names in to the chained app (WinZip command line) for execution. This is about as simple as it gets. You could do the entire task in one line of code. The only caveat is that I am not sure whether or not Windows 2000 comes with forfiles, but I'm sure that you could always copy the executable over from Windows 2003 if needed. Matt John T (Lists) wrote: What is defining %%f? John T eServices For You "Seek, and ye shall find!" -Original Message- From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- [EMAIL PROTECTED]] On Behalf Of Andy Schmidt Sent: Wednesday, April 19, 2006 3:26 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line Hi John, The FOR/DO will iterate through the directory listing using "ex*.log" and then perform a WINZIP for each item. The /R makes it recursive (meaning, including subfolders) - which is what you want. &&f is one item in the directory list (the path to one log file at a time). ~ modifies an item from the directory list, specifically: ~dpn takes only the drive, path and filename (leave out the extension) So: %%~dpnF.zip means, take the directory item %%F, put use only the drive:/Path/Filename and append ".zip". In other words the Winzip command will look like that WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. for each of youu log files in all of your subfolders. Best Regards Andy Schmidt Phone: +1 201 934-3414 x20 (Business) Fax: +1 201 934-9206 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of John T (Lists) Sent: Wednesday, April 19, 2006 06:09 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line I just use the winzip command line tool every day to turn the 1 day old "log" file into a "zip" file by the SAME name in the SAME location. This way, you can simply move anything *.zip to a different drive, while *.log are "current" log files. Here is the content of my Compress2DayOldLogs.cmd file: C: CD "C:\WINNT\system32\LogFiles\" FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 %%~dpnf.zip %%f OK, can some one please explain the logic of this line. This appears to be what I need to do. My understanding is that it is only calling the winzip command to a specific file name. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Hi John, It's implicitely defined by using it in the FOR command: FOR /R %%f in (ex*.log) Whatever variable you use in the "FOR" is defined as the variable to hold the directory items. Best Regards Andy Schmidt Phone: +1 201 934-3414 x20 (Business) Fax:+1 201 934-9206 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John T (Lists) Sent: Wednesday, April 19, 2006 06:55 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line What is defining %%f? John T eServices For You "Seek, and ye shall find!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of Andy Schmidt > Sent: Wednesday, April 19, 2006 3:26 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > Hi John, > > The FOR/DO will iterate through the directory listing using "ex*.log" > and then perform a WINZIP for each item. > > The /R makes it recursive (meaning, including subfolders) - which is > what you want. > > &&f is one item in the directory list (the path to one log file at a time). > > ~ modifies an item from the directory list, specifically: > ~dpn takes only the drive, path and filename (leave out the extension) > > So: > > %%~dpnF.zip > > means, take the directory item %%F, put use only the > drive:/Path/Filename and append ".zip". > > In other words the Winzip command will look like that > > WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. > > for each of youu log files in all of your subfolders. > > > Best Regards > Andy Schmidt > > Phone: +1 201 934-3414 x20 (Business) > Fax:+1 201 934-9206 > > > -Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of John T > (Lists) > Sent: Wednesday, April 19, 2006 06:09 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > > I just use the winzip command line tool every day to turn the 1 day > > old "log" file into a "zip" file by the SAME name in the SAME > > location. This way, you can simply move anything *.zip to a > > different drive, while *.log are "current" log files. > > > > Here is the content of my Compress2DayOldLogs.cmd file: > > > > C: > > CD "C:\WINNT\system32\LogFiles\" > > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m > > -ex > -Td01 > > %%~dpnf.zip %%f > > OK, can some one please explain the logic of this line. This appears > to be what I need to do. My understanding is that it is only calling > the winzip command to a specific file name. > > 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. --- 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Only comes on Windows Server 2003 SP1 or above. Tried running it on Windows Server 2000 and it errored saying target system must be running Windows XP or above. John T eServices For You "Seek, and ye shall find!" -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Sent: Wednesday, April 19, 2006 4:28 PM To: Declude.JunkMail@declude.com Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line John, I would suggest taking a second look at Dean's reply. The "forfiles" command acts on the date of the file and not the time stamp, so therefore you won't be having issues with timestamps. It also has the ability to go through an entire directory tree and use wildcards to find the files, and then it passes the file names in to the chained app (WinZip command line) for execution. This is about as simple as it gets. You could do the entire task in one line of code. The only caveat is that I am not sure whether or not Windows 2000 comes with forfiles, but I'm sure that you could always copy the executable over from Windows 2003 if needed. Matt John T (Lists) wrote: What is defining %%f? John TeServices For You "Seek, and ye shall find!" -Original Message-From: [EMAIL PROTECTED] [mailto:Declude.JunkMail-[EMAIL PROTECTED]] On Behalf Of Andy SchmidtSent: Wednesday, April 19, 2006 3:26 PMTo: Declude.JunkMail@declude.comSubject: RE: [Declude.JunkMail] OT: Help with WinZip command line Hi John, The FOR/DO will iterate through the directory listing using "ex*.log" andthen perform a WINZIP for each item. The /R makes it recursive (meaning, including subfolders) - which is whatyou want. &&f is one item in the directory list (the path to one log file at a time). ~ modifies an item from the directory list, specifically:~dpn takes only the drive, path and filename (leave out the extension) So: %%~dpnF.zip means, take the directory item %%F, put use only the drive:/Path/Filenameand append ".zip". In other words the Winzip command will look like that WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. for each of youu log files in all of your subfolders. Best RegardsAndy Schmidt Phone: +1 201 934-3414 x20 (Business)Fax: +1 201 934-9206 -Original Message-From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED]] On Behalf Of John T (Lists)Sent: Wednesday, April 19, 2006 06:09 PMTo: Declude.JunkMail@declude.comSubject: RE: [Declude.JunkMail] OT: Help with WinZip command line I just use the winzip command line tool every day to turn the 1 dayold "log" file into a "zip" file by the SAME name in the SAMElocation. This way, you can simply move anything *.zip to a differentdrive, while *.log are "current" log files. Here is the content of my Compress2DayOldLogs.cmd file: C:CD "C:\WINNT\system32\LogFiles\"FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 %%~dpnf.zip %%f OK, can some one please explain the logic of this line. This appears to bewhat I need to do. My understanding is that it is only calling the winzipcommand to a specific file name. John TeServices 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 "unsubscribeDeclude.JunkMail". The archives can be found athttp://www.mail-archive.com. ---This E-mail came from the Declude.JunkMail mailing list. Tounsubscribe, just send an E-mail to [EMAIL PROTECTED], andtype "unsubscribe Declude.JunkMail". The archives can be foundat http://www.mail-archive.com. ---This E-mail came from the Declude.JunkMail mailing list. Tounsubscribe, just send an E-mail to [EMAIL PROTECTED], andtype "unsubscribe Declude.JunkMail". The archives can be foundat http://www.mail-archive.com.
Re: [Declude.JunkMail] OT: Help with WinZip command line
John, I would suggest taking a second look at Dean's reply. The "forfiles" command acts on the date of the file and not the time stamp, so therefore you won't be having issues with timestamps. It also has the ability to go through an entire directory tree and use wildcards to find the files, and then it passes the file names in to the chained app (WinZip command line) for execution. This is about as simple as it gets. You could do the entire task in one line of code. The only caveat is that I am not sure whether or not Windows 2000 comes with forfiles, but I'm sure that you could always copy the executable over from Windows 2003 if needed. Matt John T (Lists) wrote: What is defining %%f? John T eServices For You "Seek, and ye shall find!" -Original Message- From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- [EMAIL PROTECTED]] On Behalf Of Andy Schmidt Sent: Wednesday, April 19, 2006 3:26 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line Hi John, The FOR/DO will iterate through the directory listing using "ex*.log" and then perform a WINZIP for each item. The /R makes it recursive (meaning, including subfolders) - which is what you want. &&f is one item in the directory list (the path to one log file at a time). ~ modifies an item from the directory list, specifically: ~dpn takes only the drive, path and filename (leave out the extension) So: %%~dpnF.zip means, take the directory item %%F, put use only the drive:/Path/Filename and append ".zip". In other words the Winzip command will look like that WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. for each of youu log files in all of your subfolders. Best Regards Andy Schmidt Phone: +1 201 934-3414 x20 (Business) Fax:+1 201 934-9206 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of John T (Lists) Sent: Wednesday, April 19, 2006 06:09 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line I just use the winzip command line tool every day to turn the 1 day old "log" file into a "zip" file by the SAME name in the SAME location. This way, you can simply move anything *.zip to a different drive, while *.log are "current" log files. Here is the content of my Compress2DayOldLogs.cmd file: C: CD "C:\WINNT\system32\LogFiles\" FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 %%~dpnf.zip %%f OK, can some one please explain the logic of this line. This appears to be what I need to do. My understanding is that it is only calling the winzip command to a specific file name. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Here's some code I helped create to get yesterday's date into usable variables. It even takes leap year into consideration. Enjoy! -Jerod ::Creates time variable for /f %%z IN ('TIME/T') do set time=%%z ::Creates date variables for /f "tokens=1-4 delims=/ " %%a IN ('DATE/T') do ( SET day=%%a SET mm=%%b SET dd=%%c SET year=%%d) ::build yesterday date variables SET ym=%mm% SET yy=%year% ::Overcome octal issue... IF %dd% EQU 08 (SET yd=07)&& GOTO PDSET IF %dd% EQU 09 (SET yd=08)&& GOTO PDSET IF %dd% EQU 10 (SET yd=09)&& GOTO PDSET ::Overcome 1st of the month issue... IF %dd% NEQ 01 (GOTO YDSET) IF %mm% EQU 01 (SET /A yy=%year%-1&& SET ym=12&& SET yd=31&& GOTO PDSET) IF %mm% EQU 02 (SET ym=01&& SET yd=31&& GOTO PDSET) IF %mm% EQU 04 (SET ym=03&& SET yd=31&& GOTO PDSET) IF %mm% EQU 05 (SET ym=04&& SET yd=30&& GOTO PDSET) IF %mm% EQU 06 (SET ym=05&& SET yd=31&& GOTO PDSET) IF %mm% EQU 07 (SET ym=06&& SET yd=30&& GOTO PDSET) IF %mm% EQU 08 (SET ym=07&& SET yd=31&& GOTO PDSET) IF %mm% EQU 09 (SET ym=08&& SET yd=31&& GOTO PDSET) IF %mm% EQU 10 (SET ym=09&& SET yd=30&& GOTO PDSET) IF %mm% EQU 11 (SET ym=10&& SET yd=31&& GOTO PDSET) IF %mm% EQU 12 (SET ym=11&& SET yd=30&& GOTO PDSET) ::Do Leap Year Calculations SET /A yearchk=(%year% %% 4) IF %yearchk% NEQ 0 (GOTO NOTLEAP) SET /A yearchk=(%year% %% 400) IF %yearchk% EQU 0 (GOTO YESLEAP) SET /A yearchk=(%year% %% 100) IF %yearchk% EQU 0 (GOTO NOTLEAP) :YESLEAP SET ym=02 SET yd=29 GOTO PDSET :NOTLEAP SET ym=02 SET yd=28 GOTO PDSET :YDSET SET /A pd=%dd%-1 IF %pd% LSS 8 (set yd=0%pd%) else (set yd=%pd%) :PDSET ::AT THIS POINT YESTERDAY == %ym%\%yd%\%yy% -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John T (Lists) Sent: Wednesday, April 19, 2006 3:34 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line In other words, if using the following lines: for /f "tokens=1-4 delims=/ " %%a IN ('DATE/T') do ( set day=%%a set mm=%%b set dd=%%c set year=%%d set /A pd=%%c-1) and running on 04/01/06, is %%c 03/31/06 or 04/00/06 or what? 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
What is defining %%f? John T eServices For You "Seek, and ye shall find!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of Andy Schmidt > Sent: Wednesday, April 19, 2006 3:26 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > Hi John, > > The FOR/DO will iterate through the directory listing using "ex*.log" and > then perform a WINZIP for each item. > > The /R makes it recursive (meaning, including subfolders) - which is what > you want. > > &&f is one item in the directory list (the path to one log file at a time). > > ~ modifies an item from the directory list, specifically: > ~dpn takes only the drive, path and filename (leave out the extension) > > So: > > %%~dpnF.zip > > means, take the directory item %%F, put use only the drive:/Path/Filename > and append ".zip". > > In other words the Winzip command will look like that > > WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. > > for each of youu log files in all of your subfolders. > > > Best Regards > Andy Schmidt > > Phone: +1 201 934-3414 x20 (Business) > Fax:+1 201 934-9206 > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of John T (Lists) > Sent: Wednesday, April 19, 2006 06:09 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > > I just use the winzip command line tool every day to turn the 1 day > > old "log" file into a "zip" file by the SAME name in the SAME > > location. This way, you can simply move anything *.zip to a different > > drive, while *.log are "current" log files. > > > > Here is the content of my Compress2DayOldLogs.cmd file: > > > > C: > > CD "C:\WINNT\system32\LogFiles\" > > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex > -Td01 > > %%~dpnf.zip %%f > > OK, can some one please explain the logic of this line. This appears to be > what I need to do. My understanding is that it is only calling the winzip > command to a specific file name. > > 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
In other words, if using the following lines: for /f "tokens=1-4 delims=/ " %%a IN ('DATE/T') do ( set day=%%a set mm=%%b set dd=%%c set year=%%d set /A pd=%%c-1) and running on 04/01/06, is %%c 03/31/06 or 04/00/06 or what? John T eServices For You "Seek, and ye shall find!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of John T (Lists) > Sent: Wednesday, April 19, 2006 3:09 PM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > > I just use the winzip command line tool every day to turn the 1 day old > > "log" file into a "zip" file by the SAME name in the SAME location. This > > way, you can simply move anything *.zip to a different drive, while *.log > > are "current" log files. > > > > Here is the content of my Compress2DayOldLogs.cmd file: > > > > C: > > CD "C:\WINNT\system32\LogFiles\" > > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex > -Td01 > > %%~dpnf.zip %%f > > OK, can some one please explain the logic of this line. This appears to be > what I need to do. My understanding is that it is only calling the winzip > command to a specific file name. > > 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Hi John, The FOR/DO will iterate through the directory listing using "ex*.log" and then perform a WINZIP for each item. The /R makes it recursive (meaning, including subfolders) - which is what you want. &&f is one item in the directory list (the path to one log file at a time). ~ modifies an item from the directory list, specifically: ~dpn takes only the drive, path and filename (leave out the extension) So: %%~dpnF.zip means, take the directory item %%F, put use only the drive:/Path/Filename and append ".zip". In other words the Winzip command will look like that WINZIP -m -ex -Td01 c:\Path\exDDMMYY.log c:\Path\exDDMMYY.zip. for each of youu log files in all of your subfolders. Best Regards Andy Schmidt Phone: +1 201 934-3414 x20 (Business) Fax:+1 201 934-9206 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John T (Lists) Sent: Wednesday, April 19, 2006 06:09 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > I just use the winzip command line tool every day to turn the 1 day > old "log" file into a "zip" file by the SAME name in the SAME > location. This way, you can simply move anything *.zip to a different > drive, while *.log are "current" log files. > > Here is the content of my Compress2DayOldLogs.cmd file: > > C: > CD "C:\WINNT\system32\LogFiles\" > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 > %%~dpnf.zip %%f OK, can some one please explain the logic of this line. This appears to be what I need to do. My understanding is that it is only calling the winzip command to a specific file name. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
> I just use the winzip command line tool every day to turn the 1 day old > "log" file into a "zip" file by the SAME name in the SAME location. This > way, you can simply move anything *.zip to a different drive, while *.log > are "current" log files. > > Here is the content of my Compress2DayOldLogs.cmd file: > > C: > CD "C:\WINNT\system32\LogFiles\" > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 > %%~dpnf.zip %%f OK, can some one please explain the logic of this line. This appears to be what I need to do. My understanding is that it is only calling the winzip command to a specific file name. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Dealing with dates for doing 7 days of log files is cumbersome with a batch file but it can be done. I move the previous days log files (Imail,declude) of of 3 servers and rename them for tracking purposes with a batch file. A second set of batch files zips up the corresponding days log file from the previous month (we keep 1 month unzipped for scanning) and monthly will remove old zipped logs according to our policies. This uses pkzip rather than winzip. Not an elegant solution I admit but it works. The key for me was getting the date into DOS variable and dealing with DOS's math to set previous dates. It worked for us a the time and we have not changed. I try and can break out the main parts of this if any one want to kludge up their own batch file vs. VB or some other script. Stu At 04:37 PM 4/17/2006 -0700, you wrote: >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/ <http://www.idatatech.com/> >Corporate Internet Development and Marketing Specialists > > > > > > > > > > ><!-- > /* Font Definitions */ > @font-face > {font-family:Tahoma; > panose-1:2 11 6 4 3 5 4 4 2 4;} >@font-face > {font-family:Verdana; > panose-1:2 11 6 4 3 5 4 4 2 4;} > /* Style Definitions */ > p.MsoNormal, li.MsoNormal, div.MsoNormal > {margin:0in; > margin-bottom:.0001pt; > font-size:12.0pt; > font-family:"Times New Roman";} >a:link, span.MsoHyperlink > {color:blue; > text-decoration:underline;} >a:visited, span.MsoHyperlinkFollowed > {color:blue; > text-decoration:underline;} >p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig > {margin:0in; > margin-bottom:.0001pt; > font-size:12.0pt; > font-family:"Times New Roman";} >span.EmailStyle18 > {font-family:Verdana; > color:navy;} >@page Section1 > {size:8.5in 11.0in; > margin:1.0in 1.25in 1.0in 1.25in;} >div.Section1 > {page:Section1;} >--> > > > > > > > > >But again, if Windows sees the file as 12:00 AMstyle='font-size:10.0pt;font-f
Re: [Declude.JunkMail] OT: Help with WinZip command line
Hi John, AH, use variables to set the date and then process by date. simplicity is elegance :) Now question, how does that work if say you run the script on 04/01/06? Will it recognize the day before as 03/31/06 or will it try to say it is 04/00/06? Well it depends. What files will be subject to archiving? Will there only be the files you wish to archive [selectable by wildcard] plus the present day? If so yes - it will work. It will see that today is 04/01/06 and exclude that from the archive [because of the -f switch] and archive/add to the archive the rest of the files. If however you have a multitude of files by date and need to pick and choose which files to archive the script needs to be modified. As Andrew knows, I am extremely poor on scripting and command line. Andrew can be a little judgmentally harsh at times. I have felt your pain. FYI, I will not be around tonight or Tuesday so I may not respond until Wednesday morning. Enjoy! -Nick 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.
Re: [Declude.JunkMail] OT: Help with WinZip command line
Don't do it by time stamp, do it by determining the filenames and adding them appropriately. That's what we do and it works perfectly, though we do it monthly instead of weekly. Darin. - Original Message - From: John T (Lists) To: Declude.JunkMail@declude.com Sent: Monday, April 17, 2006 7:37 PM Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line 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 yesterdays 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 LawrenceSent: Monday, April 17, 2006 11:36 AMTo: Declude.JunkMail@declude.comSubject: 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 logsand then move that zip file.The problem I am having is that I want to zip the previous 7 days, butsometimes the last log is time stamped say 04/16/06 11:59 PM and sometimessay 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 finaltime stamp.Other than stopping services just before midnight and then restarting, whatis the best way to always ensure that I am processing the correct day's files?John TeServices For You"Seek, and ye shall find!"---This E-mail came from the Declude.JunkMail mailing list. Tounsubscribe, just send an E-mail to [EMAIL PROTECTED], andtype "unsubscribe Declude.JunkMail". The archives can be foundat http://www.mail-archive.com. -- __Dean Lawrence, CIO/PartnerInternet Data Technology888.GET.IDT1 ext. 701 * fax: 888.438.4381http://www.idatatech.com/ Corporate Internet Development and Marketing Specialists
RE: [Declude.JunkMail] OT: Help with WinZip command line
> Or likewise, tell the script to do the previous 8 days and you'll always > get the full list. Problem is I will then have 2 zip files with the same log, one incomplete and when I have Sawmill update its database that will cause an issue. I am trying to fully automate this process. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
> 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 AH, use variables to set the date and then process by date. Now question, how does that work if say you run the script on 04/01/06? Will it recognize the day before as 03/31/06 or will it try to say it is 04/00/06? As Andrew knows, I am extremely poor on scripting and command line. FYI, I will not be around tonight or Tuesday so I may not respond until Wednesday morning. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
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
RE: [Declude.JunkMail] OT: Help with WinZip command line
> C: > CD "C:\WINNT\system32\LogFiles\" > FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 > %%~dpnf.zip %%f But isn't the problem that the -T switch looks at the file modified date and if the final line is at 12:00 AM then it will have one date but if the final line is at 11:59:59 PM it will have a different date. 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Hi John, I just use the winzip command line tool every day to turn the 1 day old "log" file into a "zip" file by the SAME name in the SAME location. This way, you can simply move anything *.zip to a different drive, while *.log are "current" log files. Here is the content of my Compress2DayOldLogs.cmd file: C: CD "C:\WINNT\system32\LogFiles\" FOR /R %%f in (ex*.log) do "C:\Program Files\WinZip\WZzip.exe" -m -ex -Td01 %%~dpnf.zip %%f Best Regards Andy Schmidt Phone: +1 201 934-3414 x20 (Business) Fax:+1 201 934-9206 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John T (Lists) Sent: Monday, April 17, 2006 02:13 PM To: Declude.JunkMail@declude.com Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line Problem is the file names are unique by date, not by day, so to use that you would have to create a dynamic script, correct? John T eServices For You "Seek, and ye shall find!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of Darin Cox > Sent: Monday, April 17, 2006 11:07 AM > To: Declude.JunkMail@declude.com > Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line > > Hi John, > > If you use daily IIS logfiles I would go by filename instead of time stamp. > Our log archival script is scheduled for a few days (5) afterwards to > zip up > the previous month's files. You don't need to wait that long, but > since IIS > sometimes locks the file for a while, I would wait at least one day > before running the script. We wait a bit longer due to the > occassional need to do > additional reporting for the previous month. > > In your case, running the script on Monday evening or Tuesday morning > for the previous Monday through Sunday filenames should work fine. > > Darin. > > > - Original Message - > From: "John T (Lists)" <[EMAIL PROTECTED]> > To: > Sent: Monday, April 17, 2006 1:44 PM > Subject: [Declude.JunkMail] OT: Help with WinZip command line > > > 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. > > --- > 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.
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 logsand then move that zip file. The problem I am having is that I want to zip the previous 7 days, butsometimes the last log is time stamped say 04/16/06 11:59 PM and sometimessay 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 finaltime stamp.Other than stopping services just before midnight and then restarting, whatis the best way to always ensure that I am processing the correct day's files?John TeServices For You"Seek, and ye shall find!"---This E-mail came from the Declude.JunkMail mailing list. Tounsubscribe, just send an E-mail to [EMAIL PROTECTED], andtype "unsubscribe Declude.JunkMail". The archives can be foundat http://www.mail-archive.com. -- __Dean Lawrence, CIO/PartnerInternet Data Technology888.GET.IDT1 ext. 701 * fax: 888.438.4381http://www.idatatech.com/ Corporate Internet Development and Marketing Specialists
Re: [Declude.JunkMail] OT: Help with WinZip command line
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: 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.
Re: [Declude.JunkMail] OT: Help with WinZip command line
Sure. A simple VBS script can determine the current date, and back up X days to determine the filename(s) to be added. Admittedly this is much simpler on a monthly schedule that a weekly schedule, since you could just go by the first part of the file name with wildcards. However, in your case, just loop through the past X days, calling the command line WinZip to add the file(s) for that date. Or even better, loop through and generate a list of filenames to add to the zip file, and make one call to add them all. Darin. - Original Message - From: "John T (Lists)" <[EMAIL PROTECTED]> To: Sent: Monday, April 17, 2006 2:12 PM Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line Problem is the file names are unique by date, not by day, so to use that you would have to create a dynamic script, correct? John T eServices For You "Seek, and ye shall find!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of Darin Cox > Sent: Monday, April 17, 2006 11:07 AM > To: Declude.JunkMail@declude.com > Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line > > Hi John, > > If you use daily IIS logfiles I would go by filename instead of time stamp. > Our log archival script is scheduled for a few days (5) afterwards to zip up > the previous month's files. You don't need to wait that long, but since IIS > sometimes locks the file for a while, I would wait at least one day before > running the script. We wait a bit longer due to the occassional need to do > additional reporting for the previous month. > > In your case, running the script on Monday evening or Tuesday morning for > the previous Monday through Sunday filenames should work fine. > > Darin. > > > - Original Message - > From: "John T (Lists)" <[EMAIL PROTECTED]> > To: > Sent: Monday, April 17, 2006 1:44 PM > Subject: [Declude.JunkMail] OT: Help with WinZip command line > > > 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. > > --- > 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.
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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Well... Once you kick start the procedure by zipping all of the previous folders, then all you have left is 7 days worth of logs, so you can bag the "prev x days" logic and just use dec*.log as the parameter. Or likewise, tell the script to do the previous 8 days and you'll always get the full list. Andrew 8) > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of John > T (Lists) > Sent: Monday, April 17, 2006 11:13 AM > To: Declude.JunkMail@declude.com > Subject: RE: [Declude.JunkMail] OT: Help with WinZip command line > > Problem is the file names are unique by date, not by day, so > to use that you would have to create a dynamic script, correct? > > John T > eServices For You > > "Seek, and ye shall find!" > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > > [EMAIL PROTECTED] On Behalf Of Darin Cox > > Sent: Monday, April 17, 2006 11:07 AM > > To: Declude.JunkMail@declude.com > > Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line > > > > Hi John, > > > > If you use daily IIS logfiles I would go by filename instead of time > stamp. > > Our log archival script is scheduled for a few days (5) > afterwards to > > zip > up > > the previous month's files. You don't need to wait that long, but > > since > IIS > > sometimes locks the file for a while, I would wait at least one day > > before running the script. We wait a bit longer due to the > > occassional need to > do > > additional reporting for the previous month. > > > > In your case, running the script on Monday evening or > Tuesday morning > > for the previous Monday through Sunday filenames should work fine. > > > > Darin. > > > > > > - Original Message - > > From: "John T (Lists)" <[EMAIL PROTECTED]> > > To: > > Sent: Monday, April 17, 2006 1:44 PM > > Subject: [Declude.JunkMail] OT: Help with WinZip command line > > > > > > 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. > > > > --- > > 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Problem is the file names are unique by date, not by day, so to use that you would have to create a dynamic script, correct? John T eServices For You "Seek, and ye shall find!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:Declude.JunkMail- > [EMAIL PROTECTED] On Behalf Of Darin Cox > Sent: Monday, April 17, 2006 11:07 AM > To: Declude.JunkMail@declude.com > Subject: Re: [Declude.JunkMail] OT: Help with WinZip command line > > Hi John, > > If you use daily IIS logfiles I would go by filename instead of time stamp. > Our log archival script is scheduled for a few days (5) afterwards to zip up > the previous month's files. You don't need to wait that long, but since IIS > sometimes locks the file for a while, I would wait at least one day before > running the script. We wait a bit longer due to the occassional need to do > additional reporting for the previous month. > > In your case, running the script on Monday evening or Tuesday morning for > the previous Monday through Sunday filenames should work fine. > > Darin. > > > - Original Message - > From: "John T (Lists)" <[EMAIL PROTECTED]> > To: > Sent: Monday, April 17, 2006 1:44 PM > Subject: [Declude.JunkMail] OT: Help with WinZip command line > > > 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. > > --- > 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.
Re: [Declude.JunkMail] OT: Help with WinZip command line
Hi John, If you use daily IIS logfiles I would go by filename instead of time stamp. Our log archival script is scheduled for a few days (5) afterwards to zip up the previous month's files. You don't need to wait that long, but since IIS sometimes locks the file for a while, I would wait at least one day before running the script. We wait a bit longer due to the occassional need to do additional reporting for the previous month. In your case, running the script on Monday evening or Tuesday morning for the previous Monday through Sunday filenames should work fine. Darin. - Original Message - From: "John T (Lists)" <[EMAIL PROTECTED]> To: Sent: Monday, April 17, 2006 1:44 PM Subject: [Declude.JunkMail] OT: Help with WinZip command line 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. --- 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.
RE: [Declude.JunkMail] OT: Help with WinZip command line
Don't run your script at midnight but at 12:30. This will give the server plenty of time. There is a good sample script here: http://www.iisfaq.com/Default.aspx?tabid=2809 It doesn't use WinZip but creates MS cab files. Thanks John Dobbin Pen Publishing Interactive - http://www.penpublishing.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of John > T (Lists) > Sent: Monday, April 17, 2006 12:44 PM > To: Declude.JunkMail@declude.com > Subject: [Declude.JunkMail] OT: Help with WinZip command line > > 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. > --- 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.