home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / LOGTRIM.ZIP / LOGTRIM.DOC < prev    next >
Encoding:
Text File  |  1993-02-15  |  6.4 KB  |  146 lines

  1.  
  2.               LOGTRIM  version 3.12 released 2/15/93
  3.            A public domain utility for Wildcat! Sysops            
  4.                     by Michael Conley, Sysop
  5.                       The Charlatan's Cabin
  6.                          (213) 654-7337
  7.  
  8. WHAT IT DOES:
  9. =============
  10.  
  11. LOGTRIM is a generic LOG file trimmer which will scan any ASCII log
  12. and delete all file lines until it encounters a user specified date.
  13.  
  14. Suggested applications include the Wildcat!  ACTIVITY.LOG and the
  15. TNet TNET.LOG, as well as virtually ANY ASCII chronological log.  
  16. If you don't supply an extension, the default is ".LOG", but you
  17. may specify ANY ASCII file with any extension except for .COM, .EXE,
  18. and similar extensions normally used for binary files.
  19.  
  20. NEW IN THIS VERSION:
  21. ====================
  22.  
  23. There is no longer a requirement that the log file be named with a ".LOG"
  24. extension.  I've been meaning to remove this for quite awhile and finally
  25. got around to it.  If you don't specify an extension, ".LOG" will be used
  26. as a default, but any filename containing a "." will be accepted as is.
  27.  
  28. DATE FORMATS:
  29. =============
  30.  
  31. Beginning with version 3.12, LOGTRIM will automatically test for any of 32
  32. date formats:
  33.                                                  
  34. 02-11-93        2-11-93             3 FEB 93          11 FEB 93           
  35. 02/11/93        2/11/93             3 FEBRUARY 93     11 FEBRUARY 93      
  36. 93-02-11       93-02-11            03 FEB 1993        11 FEB 1993         
  37. 93/02/11       93/02/11            03 FEBRUARY 1993   11 FEBRUARY 1993    
  38. 02-11-1993     11 Feb 93           03 Feb 93           2/3/93             
  39. 02/11/1993     11 February 93      03 February 93      2/03/1993           
  40. 1993-02-11     11 Feb 1993          3 Feb 1993         2-3-93             
  41. 1993/02/11     11 February 1993     3 February 1993    2-03-1993           
  42.                                    
  43. Note that any formats which truncate a leading zero match to a space
  44. ahead of the date to prevent 2/3/93 from matching 12/3/93, etc.
  45.  
  46. You may produce a copy of this listing at any time by simply typing
  47. LOGTRIM /SAMPLE at the DOS command prompt.  LOGTRIM will produce a
  48. file called LOGTRIM.FMT which will contain all of the currently 
  49. searched DATE formats.
  50.  
  51. HOW TO USE IT:
  52. ==============
  53.  
  54. LOGTRIM may be used interactively, or from the command line, or in a batch
  55. file.
  56.  
  57. First, log into the directory where your file exists.  Next, invoke 
  58. LOGTRIM.  The first screen will ask for the file name of the log, and the
  59. number of days to keep.  It will calculate based upon the current system 
  60. date and then trim the log, keeping entries on or after the specified date.
  61.  
  62. If the specified date is NOT found, no action is taken and the log is
  63. left intact.
  64.  
  65. If the LOG file is trimmed, you'll find that the original has been saved
  66. with the extension '.BAK' in the event LOGTRIM should do something terrible
  67. to your file. (Not likely, but I like to be safe.)
  68.  
  69. Using LOGTRIM from a batch file (or directly from the command line) involves
  70. specifying two items on the command line.  These are the NAME of the log file
  71. and the NUMBER of days to keep (any value between 2 and 365 is acceptable.)
  72.  
  73. For example:
  74.  
  75. LOGTRIM ACTIVITY.001 15
  76.  
  77. would keep all entries within the past 15 days.  Incidentally, LOGTRIM will
  78. search for either the '/' or the '-' separator in dates, so a log file that
  79. refers to the date as MM/DD/YY or MM-DD-YY would be parsed identically.
  80.  
  81. The program requires no user interaction and will exit upon conclusion, 
  82. even if the log file isn't found or the date is not matched.
  83.  
  84. USE WITH WCPRO!:
  85.  
  86. Here's a suggestion.  If you use WCPRO! to produce a STATISTICS file,  you may 
  87. have noticed it can optionally maintain internal .HST (history) files and 
  88. delete the ACTIVITY.### files after it runs.  I like to run it in this mode, 
  89. but I don't like having the
  90. ACTIVITY.LOG tossed out each night before I get a chance to review it.
  91.  
  92. This is a clip from my nightly BBS Maintenance batch file which lets you
  93. append the log onto a backup copy before running WCPRO!  Then you may
  94. use LOGTRIM to keep the backup copy from getting out of hand.
  95.  
  96. BATCH FILE EXAMPLE:
  97.  
  98. IF EXIST C:\BACKUP\ACTIVITY.OLD DEL C:\BACKUP\ACTIVITY.OLD
  99. REN C:\BACKUP\ACTIVITY.LOG ACTIVITY.OLD
  100. COPY C:\BACKUP\ACTIVITY.OLD+C:\WC30\ACTIVITY.* C:\BACKUP\ACTIVITY.LOG
  101. WCPRO! ... (include whatever command line options you wish)
  102. CD C:\BACKUP
  103. LOGTRIM ACTIVITY.LOG 15
  104. .......
  105.  
  106. In this example, you are preserving a copy of your activity log in a 
  107. directory called \BACKUP.   First, you delete any existing copy of
  108. \BACKUP\ACTIVITY.OLD, and then you REName \BACKUP\ACTIVITY.LOG to
  109. \BACKUP\ACTIVITY.OLD.  Next you write a new \BACKUP\ACTIVITY.LOG
  110. containing first \BACKUP\ACTIVITY.OLD followed by all of your current 
  111. ACTIVITY.### files from the \WC30 directory.
  112.  
  113. Now, you may run WCPRO!, and set it up to delete any ACTIVITY.### upon 
  114. conclusion of its run.
  115.  
  116. Finally, you change directory to \BACKUP, and run LOGTRIM, specifying a
  117. 15-day-holding period.   This keeps the backup log from getting too large, 
  118. but you always have the past 15 days should you need to refer to it.
  119.  
  120. ------------------------------------------------------------------
  121. PROBLEMS, SUGGESTIONS:
  122.  
  123. This program is public domain.  I don't seek or accept any donations or 
  124. registration fees for any of my Wildcat! utility programs, including 
  125. TODAYBBS, FLOP, MSTAT, USTAT, and others ... however I invite you to
  126. read the short textfile "SHARE" enclosed in this ZIPfile.  It suggests
  127. that you make a contribution to YOUR favorite charity if you find this
  128. program useful.
  129.  
  130. I welcome suggestions, and will try to help (no guarantees) if there are
  131. problems.
  132.  
  133. You may contact me at The Charlatan's Cabin BBS  (213) 654-7337.  Mention
  134. your Wildcat! registration number in the comment and you'll be upgraded to
  135. visiting sysop level without the usually required registration by mail.
  136.  
  137. You may also leave a message via CompuServe EMail. My CompuServe account 
  138. number is 70250,220.  I also regularly check the Mustang Software head-
  139. quarters BBS, especially the "3rd Party Utilities Help" conference.
  140.  
  141. Please, NO VOICE CALLS.  This isn't meant to be unfriendly, but with the 
  142. price of public domain software these days ... I just can't afford to be 
  143. "on call."  I WILL respond to your questions via my BBS or CompuServe,
  144. or via the Mustang Software registered SysOp BBS.
  145.  
  146.