Loading ...
Sorry, an error occurred while loading the content.

RE: [BATCH WORLD] zipping a list of files with time stamp

Expand Messages
  • Morris, Lamar
    The bottom 2 lines should be combined to one line. Lamar ________________________________ From: batchworld@yahoogroups.com [mailto:batchworld@yahoogroups.com]
    Message 1 of 3 , Oct 9, 2005
    • 0 Attachment
      The bottom 2 lines should be combined to one line.



      Lamar



      ________________________________

      From: batchworld@yahoogroups.com [mailto:batchworld@yahoogroups.com] On
      Behalf Of Morris, Lamar
      Sent: Saturday, October 08, 2005 4:38 PM
      To: batchworld@yahoogroups.com
      Subject: RE: [BATCH WORLD] zipping a list of files with time stamp



      This uses the free batch component of WinZip, you can find it on the
      WinZip web.



      for /f "tokens=1,2" %%u in ('date /t') do set d=%%v

      for /f "tokens=1" %%u in ('time /t') do set t=%%u

      if "%t:~1,1%"==":" set t=0%t%

      set timestr=%d:~6,4%-%d:~0,2%-%d:~3,2%-%t:~0,2%%t:~3,3%

      "C:\Program Files\WinZip\WZZIP.EXE" -a -ex -Jhrs -whs -P -r
      C:\folder1\%timestr% C:\folder2





      Lamar



      ________________________________

      From: batchworld@yahoogroups.com [mailto:batchworld@yahoogroups.com] On
      Behalf Of infideveloper
      Sent: Friday, October 07, 2005 6:26 PM
      To: batchworld@yahoogroups.com
      Subject: [BATCH WORLD] zipping a list of files with time stamp



      Hi,All

      we have a requirement where we need to create a batch file that
      zips a list of files in folder1 and puts it in folder2 as
      temp_timestamp.zip

      if any body has done this before (has a batch file) handy .... please
      let me know

      any suggestions are welcome







      To Post a message, send it to: batchworld@...

      To Unsubscribe, send a blank message to:
      batchworld-unsubscribe@...




      SPONSORED LINKS

      Xp 2000
      <http://groups.yahoo.com/gads?t=ms&k=Xp+2000&w1=Xp+2000&c=1&s=13&.sig=vy
      5jHFYUM3TQb3LGUoZmvQ>



      ________________________________

      YAHOO! GROUPS LINKS



      * Visit your group "batchworld
      <http://groups.yahoo.com/group/batchworld> " on the web.

      * To unsubscribe from this group, send an email to:
      batchworld-unsubscribe@yahoogroups.com
      <mailto:batchworld-unsubscribe@yahoogroups.com?subject=Unsubscribe>

      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      Service <http://docs.yahoo.com/info/terms/> .



      ________________________________



      [Non-text portions of this message have been removed]



      To Post a message, send it to: batchworld@...

      To Unsubscribe, send a blank message to:
      batchworld-unsubscribe@...




      SPONSORED LINKS

      Xp 2000
      <http://groups.yahoo.com/gads?t=ms&k=Xp+2000&w1=Xp+2000&c=1&s=13&.sig=vy
      5jHFYUM3TQb3LGUoZmvQ>



      ________________________________

      YAHOO! GROUPS LINKS



      * Visit your group "batchworld
      <http://groups.yahoo.com/group/batchworld> " on the web.

      * To unsubscribe from this group, send an email to:
      batchworld-unsubscribe@yahoogroups.com
      <mailto:batchworld-unsubscribe@yahoogroups.com?subject=Unsubscribe>

      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      Service <http://docs.yahoo.com/info/terms/> .



      ________________________________



      [Non-text portions of this message have been removed]
    • kcmjr@quasatron.com
      Here is a script I wrote a few years ago to archive event logs from a bunch of NT4 servers. If you use W2K3 there are newer command options available but this
      Message 2 of 3 , Oct 10, 2005
      • 0 Attachment
        Here is a script I wrote a few years ago to archive event logs from a
        bunch of NT4 servers. If you use W2K3 there are newer command options
        available but this will still work fine. It's internally commented so I
        won't explain how it works. It does require PKZIP but you could use the
        command line version of WINZIP as well and just change the options.

        Ken Mazie

        =================================================================
        @echo off
        :: AUTOEVNT.BAT
        ::
        :: Author - Kenneth C. Mazie
        :: Date - 06-09-2000
        :: Version - 2.0
        ::
        :: Description - This is a Windows NT specific batch script that archives
        the system event
        :: logs for multiple remote servers. It uses the NT Resource Kit DUMPEL
        utility which must
        :: exist in the path of the system the batch is executed on. In it's
        current configuration
        :: the script assumes you have in place a central collection point with a
        share called
        :: "eventlogs". You can change that share name by editing the "logpath"
        variable below.
        :: You must tell the batch file which server to use as a central store by
        entering it in
        :: the "logserver" variable below. It also assumes that you will save the
        logs once
        :: a week and keep 52 weeks (1 year) of logs. To change this edit the
        number in the
        :: "killold" section. The script reads the file "servers.txt" which is
        located on the
        :: logging server and is a raw text list of all systems to back up, one
        name to a line.
        :: The original batch file was set up to be run on a single machine. It
        created folders
        :: renamed to todays date under the logpath folder and dumped the three
        logs into it.
        :: It then kept 30 days worth and removed any older logs. This can be
        done if desired by
        :: removing the "server" variable in the UNC paths in the DUMPLOGS,
        CLEANUP, and KILLOLD
        :: sections. You must also un-REM the "server" set variable below and REM
        out both the
        :: "mainloop" section and "set server=" variable below. I recommend
        setting the options
        :: on your logfiles so that the logs overwrite events older than seven
        days. You should
        :: examine your logs to determine what size to restrict them to. Note
        that you must run
        :: this batch from an NT machine logged in with domain admin rights.
        :: Note - original code by Scott Rolf

        ::----------------------- batch code -----------------------

        :variables
        :: sets initial variables
        set logserver=its-kaiser-pdc
        set logpath=eventlogs
        rem set server=
        :: Parses out the current date to a system variable
        :: Uncomment the next line to set the date format to 01012000 (mmddyyyy)
        ::for /f "tokens= 1,2,3,4 delims=/ " %%I in ('date /t') do Set
        today=%%J%%K%%L
        :: Uncomment the next line to set the date format to 01-01-2000
        (mm-dd-yyyy)
        for /f "tokens= 1,2,3,4 delims=/ " %%I in ('date /t') do Set
        today=%%J-%%K-%%L

        :mainloop
        :: Loops through external text file of servers to backup
        for /F %%I in (\\%logserver%\%logpath%\servers.txt) do Call :begin %%I
        goto :EOF

        :begin
        set server=%1

        :ServerFolder
        :: Checks for the existance of a folder named after the current server and
        creates if needed
        if exist \\%logserver%\%logpath%\%server% goto Dumplogs
        Md \\%logserver%\%logpath%\%server%

        :Dumplogs
        echo Exporting: %server%
        :: Backup the system event log
        dumpel -s %server% -t -l system -f
        \\%logserver%\%logpath%\%server%\%today%sy.log
        :: Backup the application event log
        dumpel -s %server% -t -l application -f
        \\%logserver%\%logpath%\%server%\%today%ap.log
        :: Backup the security event log
        dumpel -s %server% -t -l security -f
        \\%logserver%\%logpath%\%server%\%today%se.log

        :Compress
        :: ZIPs saved files to conserver space.
        pkzip -m \\%logserver%\%logpath%\%server%\%today%.zip
        \\%logserver%\%logpath%\%server%\%today%*.log

        :Cleanup
        :: CLEANUP..dump dir of \\%logserver%\%logpath% to a text file and delete
        old files/folders
        set T=0
        ::dir \\%logserver%\%logpath% /b /o:-n > c:\temp\tempdir.txt
        dir \\%logserver%\%logpath%\%server% /b /o:-n > c:\temp\tempdir.txt
        for /F %%I in (c:\temp\tempdir.txt) do Call :Killold %%I
        goto :EOF

        :Killold
        :: this subroutine kills logs older then 52 weeks (3 logs for 52 weeks =
        156)
        set /a T = 1+%T%
        if %T% LEQ 156 goto :EOF
        ::rd /S /Q \\%logserver%\%logpath%\%1
        del /S /Q /F \\%logserver%\%logpath%\%server%\%1

        :Exit
        ==========================================================================
        ===

        _____

        From: batchworld@yahoogroups.com [mailto:batchworld@yahoogroups.com] On
        Behalf Of infideveloper
        Sent: Friday, October 07, 2005 4:26 PM
        To: batchworld@yahoogroups.com
        Subject: [BATCH WORLD] zipping a list of files with time stamp


        Hi,All

        we have a requirement where we need to create a batch file that
        zips a list of files in folder1 and puts it in folder2 as
        temp_timestamp.zip

        if any body has done this before (has a batch file) handy .... please
        let me know

        any suggestions are welcome





        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.