home *** CD-ROM | disk | FTP | other *** search
-
- LOGTRIM version 3.12 released 2/15/93
- A public domain utility for Wildcat! Sysops
- by Michael Conley, Sysop
- The Charlatan's Cabin
- (213) 654-7337
-
- WHAT IT DOES:
- =============
-
- LOGTRIM is a generic LOG file trimmer which will scan any ASCII log
- and delete all file lines until it encounters a user specified date.
-
- Suggested applications include the Wildcat! ACTIVITY.LOG and the
- TNet TNET.LOG, as well as virtually ANY ASCII chronological log.
- If you don't supply an extension, the default is ".LOG", but you
- may specify ANY ASCII file with any extension except for .COM, .EXE,
- and similar extensions normally used for binary files.
-
- NEW IN THIS VERSION:
- ====================
-
- There is no longer a requirement that the log file be named with a ".LOG"
- extension. I've been meaning to remove this for quite awhile and finally
- got around to it. If you don't specify an extension, ".LOG" will be used
- as a default, but any filename containing a "." will be accepted as is.
-
- DATE FORMATS:
- =============
-
- Beginning with version 3.12, LOGTRIM will automatically test for any of 32
- date formats:
-
- 02-11-93 2-11-93 3 FEB 93 11 FEB 93
- 02/11/93 2/11/93 3 FEBRUARY 93 11 FEBRUARY 93
- 93-02-11 93-02-11 03 FEB 1993 11 FEB 1993
- 93/02/11 93/02/11 03 FEBRUARY 1993 11 FEBRUARY 1993
- 02-11-1993 11 Feb 93 03 Feb 93 2/3/93
- 02/11/1993 11 February 93 03 February 93 2/03/1993
- 1993-02-11 11 Feb 1993 3 Feb 1993 2-3-93
- 1993/02/11 11 February 1993 3 February 1993 2-03-1993
-
- Note that any formats which truncate a leading zero match to a space
- ahead of the date to prevent 2/3/93 from matching 12/3/93, etc.
-
- You may produce a copy of this listing at any time by simply typing
- LOGTRIM /SAMPLE at the DOS command prompt. LOGTRIM will produce a
- file called LOGTRIM.FMT which will contain all of the currently
- searched DATE formats.
-
- HOW TO USE IT:
- ==============
-
- LOGTRIM may be used interactively, or from the command line, or in a batch
- file.
-
- First, log into the directory where your file exists. Next, invoke
- LOGTRIM. The first screen will ask for the file name of the log, and the
- number of days to keep. It will calculate based upon the current system
- date and then trim the log, keeping entries on or after the specified date.
-
- If the specified date is NOT found, no action is taken and the log is
- left intact.
-
- If the LOG file is trimmed, you'll find that the original has been saved
- with the extension '.BAK' in the event LOGTRIM should do something terrible
- to your file. (Not likely, but I like to be safe.)
-
- Using LOGTRIM from a batch file (or directly from the command line) involves
- specifying two items on the command line. These are the NAME of the log file
- and the NUMBER of days to keep (any value between 2 and 365 is acceptable.)
-
- For example:
-
- LOGTRIM ACTIVITY.001 15
-
- would keep all entries within the past 15 days. Incidentally, LOGTRIM will
- search for either the '/' or the '-' separator in dates, so a log file that
- refers to the date as MM/DD/YY or MM-DD-YY would be parsed identically.
-
- The program requires no user interaction and will exit upon conclusion,
- even if the log file isn't found or the date is not matched.
-
- USE WITH WCPRO!:
-
- Here's a suggestion. If you use WCPRO! to produce a STATISTICS file, you may
- have noticed it can optionally maintain internal .HST (history) files and
- delete the ACTIVITY.### files after it runs. I like to run it in this mode,
- but I don't like having the
- ACTIVITY.LOG tossed out each night before I get a chance to review it.
-
- This is a clip from my nightly BBS Maintenance batch file which lets you
- append the log onto a backup copy before running WCPRO! Then you may
- use LOGTRIM to keep the backup copy from getting out of hand.
-
- BATCH FILE EXAMPLE:
-
- IF EXIST C:\BACKUP\ACTIVITY.OLD DEL C:\BACKUP\ACTIVITY.OLD
- REN C:\BACKUP\ACTIVITY.LOG ACTIVITY.OLD
- COPY C:\BACKUP\ACTIVITY.OLD+C:\WC30\ACTIVITY.* C:\BACKUP\ACTIVITY.LOG
- WCPRO! ... (include whatever command line options you wish)
- CD C:\BACKUP
- LOGTRIM ACTIVITY.LOG 15
- .......
-
- In this example, you are preserving a copy of your activity log in a
- directory called \BACKUP. First, you delete any existing copy of
- \BACKUP\ACTIVITY.OLD, and then you REName \BACKUP\ACTIVITY.LOG to
- \BACKUP\ACTIVITY.OLD. Next you write a new \BACKUP\ACTIVITY.LOG
- containing first \BACKUP\ACTIVITY.OLD followed by all of your current
- ACTIVITY.### files from the \WC30 directory.
-
- Now, you may run WCPRO!, and set it up to delete any ACTIVITY.### upon
- conclusion of its run.
-
- Finally, you change directory to \BACKUP, and run LOGTRIM, specifying a
- 15-day-holding period. This keeps the backup log from getting too large,
- but you always have the past 15 days should you need to refer to it.
-
- ------------------------------------------------------------------
- PROBLEMS, SUGGESTIONS:
-
- This program is public domain. I don't seek or accept any donations or
- registration fees for any of my Wildcat! utility programs, including
- TODAYBBS, FLOP, MSTAT, USTAT, and others ... however I invite you to
- read the short textfile "SHARE" enclosed in this ZIPfile. It suggests
- that you make a contribution to YOUR favorite charity if you find this
- program useful.
-
- I welcome suggestions, and will try to help (no guarantees) if there are
- problems.
-
- You may contact me at The Charlatan's Cabin BBS (213) 654-7337. Mention
- your Wildcat! registration number in the comment and you'll be upgraded to
- visiting sysop level without the usually required registration by mail.
-
- You may also leave a message via CompuServe EMail. My CompuServe account
- number is 70250,220. I also regularly check the Mustang Software head-
- quarters BBS, especially the "3rd Party Utilities Help" conference.
-
- Please, NO VOICE CALLS. This isn't meant to be unfriendly, but with the
- price of public domain software these days ... I just can't afford to be
- "on call." I WILL respond to your questions via my BBS or CompuServe,
- or via the Mustang Software registered SysOp BBS.
-
-