LogRen
------

This program is funded by Brian Simpson. If you use this, please thank him!

The LogRen program renames an IPAD-OS format log file using date stamp
information from entries inside the file. Optionally this can also add a
custom prefix and file extension so you can fully customize the file name.

The log file is renamed in place - it is not copied. Long file name support
is required for any root file name longer than eight (8) characters or any
file extension longer than three (3) characters. The file rename is skipped
if the date is already part of the filename to prevent the name from
growing too long through repeated use of this program.

If a file rename fails, the ERRORLEVEL is set to 1 (one). This allows batch
files to detect the problem and optionally do something about it.


Syntax:

 LogRen [path]<name> [/P:<prefix>] [/F:<format>] [/E:<ext>] [/Y] [/D]

 name   = The log file name which may optionally include a drive letter and
          path. Long file name support is required by default.

          The complete path and filename must be enclosed in double quotes
          if the file name or path contain any spaces.

          Wildcards are supported if you want to rename more than one file.

 /P:<prefix> = This optional field replaces the existing file name with
          text at the front of the new file name. It is very useful for
          those with log files from multiple IPAD-OS servers to include the
          machine name as part of the file name.

          The complete prefix must be enclosed in double quotes if it
          contains any spaces.

          Example:
              /P:"Mail Server 1"

 /F:<format> = The default date format is "YYYYMMDD" but may be optionally
          changed to almost any format using the case-sensitive patterns
          below.

          The complete format string must be enclosed in double quotes if
          it contains any spaces.

          NOTE: The following patterns are case sensitive!

           YYYY = Four digit year
             YY = Last two digits of the year
             MM = Two digit month (padded with leading zeros if needed)
             DD = Two digit day (padded with leading zeros if needed)
             hh = Two digit hour (padded with leading zeros if needed)
             mm = Two digit minutes (padded with leading zeros if needed)
             ss = Two digit seconds (padded with leading zeros if needed)

          You may include any other characters in the format string if
          desired. Any text is allowed as long as the above format
          characters only appear where you want date or time information.

          Example:
              /F:"Email-YY-MM-DD (2)" becomes "Email-98-12-31 (2)"

 /E:<ext> = Replace the existing file extension (if any) with this text. A
          leading period is optional and will be added if needed.

          The complete extension text must be enclosed in double quotes if
          it contains any spaces.

          Examples:
              /E:LOG      =  .LOG
              /E:.LOG     =  .LOG
              /E:".L G"   =  .L G

     /Y = You may optionally replace any conflicting destination file name
          with the new file using this command line switch.

          By default if the destination file name already exists, LogRen
          exits with ERRORLEVEL 1. A batch file can use the ERRORLEVEL to
          detect name conflicts and avoid data loss.

     /D = Debug mode. This shows some extra details about the internal
          workings of this program to help diagnose problems. Please
          include this output in any bug reports.

This program understands the following IPAD-OS log file date stamp formats.

   mm/dd          (12/31)
   mm/dd/yy       (12/31/98)
   mm.dd          (12.31)
   yy.mm.dd       (98.12.31)
   Mon dd         (Dec 31)
   Mon dd yy      (Dec 31 98)
   Day Mon dd     (Wed Dec 31)
   Day Mon dd yy  (Wed Dec 31 98)

Notice that some of these formats do not include the year. The file date
stamp is used to complete any missing data, but obviously will be wrong
when renaming log files that do not have the original date stamp.

Copyright 2005-2011 by Casey Sprangel. This program and other IPAD-OS tools
can be found on the www.ifxgroup.net web site.
