home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
CEREBRUM
/
PBWEED12.ARJ
/
PBWEED.DOC
< prev
next >
Wrap
Text File
|
1995-03-26
|
27KB
|
494 lines
PBweed 1.2 - COPYRIGHT 1994,1995 - TRACY L. BAKER - STARPORT VALHALLA BBS
*** All the legal junk is at the end of this file! ***
: WHAT IN THE HECK IS THIS PROGRAM SUPPOSED TO DO? :
PBweed was written with the intention of freeing up your hard drive space by
removing old files from the hard drive, and BBS data base, based on the file's
age, and number of times downloaded.
The program will run through your WWIV file transfer database file (DIRS.DAT),
and look at each and every file. When it finds a file that is older than the
specified age, and has FEWER downloads than specified, it is removed from
WWIV. At this time, it may be deleted from the hard drive as well, although
with the use of the /M switch, the file may simply be moved elsewhere.
By means of command line switches, you can control the age requirements,
number of times downloaded, input inclusion file name, and more. Full
explanation of command line switches follow.
: WHAT DO I NEED TO RUN THIS THANG? :
Well, a WWIV BBS with a working file transfer section would seem to top the
list. Any machine capable of running a WWIV BBS is capable of running this
program.
Also, the COMSPEC enviroment variable *needs* to be set. This is done in the
AUTOEXEC.BAT file like:
set COMSPEC=C:\DOS\COMMAND.COM
A 80286 based microprocessor will now run PBweed. If you have a 8086 or
8088, you can E-Mail me directly, and I'll compile you you a special copy.
: AND NOW, A WARNING OR TWO :
While I have THOROUGHLY tested this program, it is possible that you can
irrevocably lose some data that you might to keep. This is true for any
program that manipulates files by writing to them. So just to be safe,
BACK-UP YOUR *.DIR, *.EXT, and DIRS.DAT in your DATA directory!
PBweed employs three means to protect your files!
Firstly, before it starts processing, PBweed will take all your *.DIR, *.EXT,
and DIRS.DAT file and add them into an archive (of your choice -- defaults to
ZIP). This archive file is called PBW-BU.* and is located in the same dir.
as the PBWEED.EXE. Archive support is provided by the PBFILES.DAT file.
Secondly, it does not directly overwrite any *.DIR or *.EXT until processing
is done. Instead, it writes the data for the files that are STAYING in a
temporary data file. Then, when it is satisfied that all is well, it copies
them over your old ones.
Lastly, if no command line switches are used, PBweed will make certain that
this is what you want to do. This is because all files that are 12 months
old and older, with less than 12 downloads, will be deleted.
If, for whatever reason, you lose power or processing is interrupted in the
middle of things, PBweed will automatically replace the data files when run
again with the ones from the archive file it created. If the program tells
you that is is restoring critical files and cleaning up, then you should also
do one or more of the following things. Run CHKDSK or SCANDISK to repair the
hard drive, if needed. It is possible that you'll encounter unattached
clusters on the hard disk due to certain files not being closed properly
(this will only happen if the proccessing is interrupted abnormally).
Then use FIX v8 and/or Tolkien's (now WSS's) Transfer Area Manager (TAM) to
repair any possible damage to the DIRS.DAT, *.DIR, and *.EXT files, although
this should not happen in any way.
Finally, I have found out that OS/2 systems may not be able to run this
program in its current form. This is definitely true for any system that
does not set the COMSPEC enviroment variable (normally set in the AUTOEXEC.BAT
file, ie: SET COMSPEC=C:\DOS\COMMAND.COM). I've preliminary reports that OS/2
2.11 does not properly pass this enviroment variables to programs using the
system() function call. If you run OS/2 (any flavor) and find this to be
true, then PLEASE let me know. I can fix this -- I just used certain
techniques to keep the speed of the program up... OS/2 users may also find
out that the exit (error) codes do not work for reasons unknown at this time.
: FEATURES :
o Deletes or moves files from your WWIV BBS and physical subdirectories based
on file's age, and times downloaded.
o Allows you to remove files from WWIV's database, but leave them intact in
subdirectory.
o Can use file's true (DOS) file date instead of WWIV's. Sometimes WWIV's
date is not a good representation of file's age.
o Has file sharing so it can be used while users are online.
o Supports inclusion files in ASCII format so you can easily control what
directories get processed and what don't.
o Keeps very detailed log of what is going on.
o Great for nightly (or weekly?) batch file processing to continuously keep
your harddrive pruned.
o PBweedG.EXE is expressly for systems using the gold modification.
o Disaster insurance. This program can, and will, restore complete working
copies of all critical files in the event of an abnormal shutdown or power
loss during processing.
o Allows you to use a RAM drive for extra-fast data processing.
o Compresses both *.DIR and *.EXT files by removing any dead entries.
o /E switch for *.EXT file bypassing. This is for those systems short on
memory. READ THE DOCS!
o Quiet, direct, and BIOS screen writing modes for maximum compatibility and
speed.
o Its FREE!
Version 1.1 additions/upgrades/fixes
o Added /X switch. This switch tells PBweed to remove any files from WWIV's
databases that doesn't physically exist on the harddrive (marked as N/A).
WARNING -- This will remove any files located on CD-ROM when the CD is not
actually online.
o Changed inclusion file format. Now each directory name *must* end in a *
to be processed correctly. This will be automatically done with the /A
switch. This change makes it easier for PBweed to determine the actual
length of the directory names in the inclusion file.
o Fixed the bug that would sometimes place a |MARKER| as the filename for the
last file. While this didn't cause any harm, it was annoying.
o Added /Z switch. This switch will cause PBweed to process ALL the
directories, ignoring any inclusion file.
o Fixed rare bug. If /A{filename} was used, where {filename} was an actual
filename, and other command line switches were used in addition to this
one, the program would forget the {filename} you game it.
o Checking for COMSPEC enviroment variable added. Needs to be set to run
properly!
o /C{archive ext.} added so you can backup your data (*.DIR, *.EXT) files in
case you want to restore your BBS after running PBweed. Great if used with
the /M{path} switch. PBFILES.DAT (which can be created by CREATDAT.EXE)
is what is used for support. The following archives are supported: ARJ,
ARC, HAP, LHA, PAK, RAR, UC2, and ZIP. ZIP is the default. /C! turns off
any archive backup processing.
o The old C:\PBWEED.$$$ way of saving files in case of a mid-operation crash
has been replaced with archive support. This is both easier, more
reliable, and takes less disk space.
o Got another 75%+ speed increase!
o Now checks for the revision number of the PBFILES.DAT. If wrong, it will
attempt to update it automatically using CREATDAT.EXE. It will check
again, and if okay at that time, will process everything as normal.
o Fixed an irritating little bug that would leave the last file out of the
BBS file, even if it passed dl/age testing.
o /$ added so you can manually create a new PBFILES.DAT, if you want.
Version 1.2 changes/additions
[I bought the complete Borland C++ 3.1 for $95 and learned a few things!]
o Program is now compiled for run on 80286 and greater processor.
o Is now compiled in small memory model, no overlays. Less memory needed
to run.
o Explicit 80x87 math co-processor support removed, as it was not needed.
o Archive support tightened a bit.
o Coding used to move files was greatly sped up.
o Support added for the archivers that create DWC, HYP, HPK, SQZ, and ZOO
archivers via the CREATDAT.EXE file.
o Added additional saftey check for no command line switches used.
o Fixed it so that it'll check for old versions of PBFILES.DAT, and make new
ones -- and so it'll automatically accept newer version w/o question.
: ABOUT THOSE 1.1 CHANGES :
Okay, the major change in the inclusion files is easy. Either create a new
inclusion file with the /A switch, and edit the resulting output file, or
append a * to the name of directory name listed in each inclusion file you
use. Why the *? Well, I've found that its difficult to determine exactly
what the terminating character on a line is (maybe its a mental block). So
to bypass the unknown of it being an ASCII 13, ASCII 10, or ASCII 0, I simply
terminate them myself with a known character, the *
About the rash of |MARKER| file entries... Sorry, I hadn't realized that
that had happened in version 1.0. To relieve that problem, you can use the
/X switch to tell PBweed to remove all N/A files (which the |MARKER| files
certainly are N/A). Of course, if you deliberately keep a lot of N/A files
online, this won't help. You should, however, be able to simply remove them
from the BBS, while logged on, in the normal fashion. All versions, 1.1 and
greater, fix that "bug".
: COMMAND LINE SWITCHES ARE MY FRIENDS :
The first time this program is run, the /A switch should be used by itself.
When done, you can edit PBWEED.INC to remove any of the directories that you
*DO NOT* want processed (like for me, I'm not doing my WWIV 4.23 modifications
directory, so I remove WWIV423O from the file).
After that, no command line switches need be used. Defaults are 178 days old
(6 months), 12 downloads, and PBWEED.INC for the inclusion file.
Here are the command lines switches, and what they do.
──────────────────────────────────────────────────────────────────────────────
[what to call this switch] {example}
/s{filename} description
description
example, if any
──────────────────────────────────────────────────────────────────────────────
[? huh ?] {/?}
/? Display PBweed's online help screens.
──────────────────────────────────────────────────────────────────────────────
[$ create PBFILES.DAT] {/$}
/$ Will create a new PBFILES.DAT file, if CREATDAT.EXE exists.
──────────────────────────────────────────────────────────────────────────────
[2 lines - file sharing] {/2}
/2 Enable PBweed's file sharing routines. Best to use this is you
ever run this while the BBS is up and running.
──────────────────────────────────────────────────────────────────────────────
[include All directories] {/AC:\WWIV\MINE.INC}
/A{filename} Using this switch without specifying and filename will cause it
to default to PBWEED.INC. Using this switch in the normal
course of using this program will cause ALL directories to be
processed.
──────────────────────────────────────────────────────────────────────────────
[Bios screen writes off] {/B}
/B Using this switch toggles direct or BIOS for screen writes.
The way that this program normally updates the screen is by
directly writing to the screen's memory addresses (unless
changed via the configuration editor). Direct screen writing
is faster, but not compatible with all computers and/or multi-
taskers. (For DESQview, set virtualize text/graphics to YES,
and writes directly to screen to NO. By doing this you stop
"bleed through".) The speed differences between the /Q, /B,
and no screen related switches can be quite significant.
──────────────────────────────────────────────────────────────────────────────
[Create backup] {/CARJ}
/C{arc.ext.} Create a backup of *.DIR and *.EXT files, as listed in the
inclusion file, in the current (BBS) directory as well as
DIRS.DAT. It'll be called PBW-BU.{ext}. You must have
PBFILES.DAT in the same directory as PBWEED.EXE. If the
/I{filename} switch is used then {filename} will be used as
the inclusion file, otherwise, PBWEED.INC will be used.
Currently those are:
Archive Extension Unarchive EXE Archive EXE
ARC PKARC.COM PKXARC.COM
ARJ ARJ.EXE ARJ.EXE
DWC DWC.EXE DWC.EXE
HAP HAP3.EXE PAH3.EXE
HPK HPACK.EXE HPACK.EXE
HYP HYPER.EXE HYPER.EXE
LZH LHA.EXE LHA.EXE
PAK PKPAK.EXE PKUNPAK.EXE
RAR RAR.EXE RAR.EXE
SQZ SQZ.EXE SQZ.EXE
UC2 UC.EXE UC.EXE
ZIP PKUNZIP.EXE PKZIP.EXE
ZOO ZOO.EXE ZOO.EXE
The executable, as specified, must reside either in the current
directory, or in your path.
If this switch is not used, PKZIP will be used to make the
backups unless the /C! switch is used.
──────────────────────────────────────────────────────────────────────────────
[do not Create backup!] {/C!}
/C! Do not create *ANY* backup files whatsoever.
──────────────────────────────────────────────────────────────────────────────
[remove file(s) Days old] {/D90}
/D{days old} Defaults to 178 days, or approximately 6 months. Use this
switch to set the number of days old a file must be before it
is even considered for deletion. Works solo, or in
conjunction with the /N switch.
──────────────────────────────────────────────────────────────────────────────
[no Extended processing] {/E}
/E Do not process and *.EXT (extended description) files.
Normally this switch is not used. However, if you are getting
reports in your PBWEED.LOG that you do not have enough memory
free to process extended descriptions, you can include this
switch in the command line. This will not harm anything. The
program will work fine, and so will your BBS. The *.EXT files
will simply have "dead" entries in them.
──────────────────────────────────────────────────────────────────────────────
[use Inclusion file] {/IC:\WWIV\MINE.INC}
/I{filename} Defaults to PBWEED.INC. Use this to specify another, possibly
custom, inclusion file. The .INC extension is optional.
──────────────────────────────────────────────────────────────────────────────
[turn off Log] {/L}
/L Turn off all reporting to PBWEED.LOG
──────────────────────────────────────────────────────────────────────────────
[Move, don't delete] {/MC:\TEMP\STORAGE}
/M{path} Move the files that match the age/dl requirements to the path
specified. Keeps the files from being deleted.
──────────────────────────────────────────────────────────────────────────────
[Number of downloads] {/N60}
/N{no. d/ls} Defaults to 12 (twice a month, when used with the default age).
This works well in conjunction with the /D switch.
──────────────────────────────────────────────────────────────────────────────
[Quiet] {/Q}
/Q Do not update the screen. Since there isn't really all that
much screen updating, this provides only a minimal speed
increase.
──────────────────────────────────────────────────────────────────────────────
[do not Remove] {/R!}
/R! Do not delete or move files from subdirectories. The ! is
required. The program will halt if /R is used by itself.
This *will* allow the files' entries to be removed.
──────────────────────────────────────────────────────────────────────────────
[no direct Screen updating] {/S}
/S Do not use direct screen updates. Only use this if you're
having problems with the screen output.
──────────────────────────────────────────────────────────────────────────────
[True file date] {/T}
/T Use DOS' file date, not WWIV's.
──────────────────────────────────────────────────────────────────────────────
[Work drive] {/WG:}
/W{dr:path} You can use this switch to set up for a RAM drive. It will
accept any valid DOS path. A trailing \ is not necessary.
MAKE CERTAIN YOU HAVE PLENTY OF ROOM TO WORK WITH IF USING A
RAM DISK. PBweed cannot check since it doesn't know how many
files its gonna process and the amount of room it'll need
before it gets started.
──────────────────────────────────────────────────────────────────────────────
[non-eXistant files] {/X}
/X Remove any files from WWIV's database that does not physically
exist on the harddrive (ie: those marked N/A in the BBS).
WARNING! This program *will* remove those files normally
located on CD-ROM if the CD is not in the drive. Make certain
to use an appropriately edited inclusion file!
──────────────────────────────────────────────────────────────────────────────
[Zoom through all] {/Z}
/Z This makes PBweed go through ALL the directories, regardless of
any inclusion file. WARNING: This switch should be used with
extreme caution if used with the /X switch, and you have
offline CD-ROM's.
──────────────────────────────────────────────────────────────────────────────
EXAMPLES: Great for batch file processing
PBWEED /A
-- Create new PBWEED.INC inclusion file
PBWEED
-- Remove all files 6 months old and older -- less than 12 times downloaded
PBWEED /D90 /N30 /IMINE.INC
-- Remove all files 90 days old and older than have been downloaded less than
-- 30 times. Use MINE.INC to determine what directories to process.
PBWEED /MC:\TEMP\STORE /D356 /N100 /2
-- Remove all files 1 year old and older with less than 100 downloads
-- Instead of deleting the files, move to C:\TEMP\STORE. Use file sharing
PBWEED /AMINE.INC /IMINE.INC /2 /D90 /N30 /MC:\TEMP\
-- Create new inclusion file called MINE.INC (causes ALL directories to be
-- processed), use the inclusion file we just made, use file sharing,
-- look for 90 days and older, less than 30 downloads, move to C:\TEMP\
PBWEED /T /R! /N30 /D180
-- Remove all files 180 days old and and older with fewer than 30 downloads
-- from WWIV's database but leave in the subdirectory. Use the file's TRUE
-- (DOS) file date, not WWIV's to determine the age of the file.
PBWEED /$
-- Creates a new PBFILES.DAT file for use by PBweed. CREATDAT.EXE is
-- required for this to work.
PBWEED /N30 /CARJ /D100 /E
-- Remove files 100 days old and older, with fewer than 30 downloads.
-- Use ARJ to create backup files. Do not process extended descriptions.
PBWEED /CLZH /WD:\ /T /Z
-- Remove all files 178 days old with less that 12 downloads. Use LHA.EXE
-- to create backup archive. Use D:\ (a RAM disk?) as the work drive.
-- Use the file's DOS date, not WWIV's, to determine file's age. Process
-- ALL directories regardless of any inclusion file.
: OH, THOSE WONDERFUL TROUBLE SHOOTING AIDS :
As with past PB/SPV utility software that is intended on running from batch
files, this program returns error codes upon exiting. The codes for this
program are:
00 - No error -- Normal exit
01 - Can't find CHAIN.TXT
02 - Unknown error reading CHAIN.TXT
03 - Could not find DIRS.DAT
04 - Unknown error reading DIRS.DAT
05 - DIRS.DAT is empty, there are no directories listed
06 - Cannot create new inclusion file
07 - Could not open specified inclusion file
08 - Did not type YES at agreement prompt
09 - Error reading current directory path
10 - Error changing to path specified in /M switch
11 - Unknown disk access error
12 - Unknown error reading inclusion file
13 - Could not open extended description data file for file being processed
14 - Could NOT dearchive data (*.DIR/*.EXT) files!
15 - Uknown error creating PBWEED.BUP
16 - Cannot create PBWEED.BUP file
17 - Could not find PBW-BU.* for crash recovery
18 - Temporary output data file (*.DI1) that should have been created with
the |MARKER| does not exist any longer.
19 - /R switch was used w/o the !
20 - Inclusion file checking routine had unknown error opening inclusion file
21 - Inclusion file missing terminating star -- See log file for line number
22 - COMSPEC enviroment variable is not set! Set it in AUTOEXEC.BAT
23 - Failed to execute *.DIR/*.EXT backups
24 - No error - used ? command
25 - Could not open PBWEED.BUP for reading!
26 - Successfully un-backuped up *.DIR, *.EXT, and DIRS.DAT
27 - Could not change to DATA dir.
28 - Unknown error trying to create PBFILES.DAT (/$ switch)
29 - No error. Created PBFILES.DAT
30 - No command line switches used, user did not decide to continue.
And, as is my wont, I also make provisions for debugging routines. By placing
a DEBUG.XXX file in the same directory in which this program is executed, you
can activate extended PBWEED.LOG entries that give a very detailed set of
reports as to what is going on. [This will ALSO turn on the debug routines in
PBfiles, if you're using that.]
: LOOKING AT THE LOG :
I try to make the log as informative as I can. Here is a snapshot of what my
typical log looks like (note in the middle I show how a delete, move, and not
move all look, even though you can't have all three at once):
[PBweed log file opened: January 29, 1995 at 00:20.03]
/W -- Using G: as the work drive.
/R! -- Do not remove, or delete, files from subdirectory.
=== Emergency backup dir. (C:\PBWEED.$$$) has been made, backing-up now.
>>> Using these parameters: 178 days old and older, 12 times d/l'ed
···Processing dir : UBCHEAT
Not removing 1X-PAK .ARJ: (631 d.o. - 5 d/l's)
Moving (to C:\TEMP) 1X-PAK .ARJ (631 d.o. - 5 d/l's)
Deleting 1X-PAK .ARJ (631 d.o. - 5 d/l's)
>>> Shutting down PBweed 1.1 at 00:20.30
Reason: Normal exit -- no error.
»»» Total number of files removed 248 (8373k).
=== Removing contents of C:\PBWEED.$$$ -- finished processing!
The log with DEBUG.XXX in existance looks kinda like this:
[PBweed log file opened: January 29, 1995 at 00:29.36]
DEBUG: Memory left @ start: 534k (FCL) 51k (CL)
DEBUG: Using E:\BBSDATA\DATA\DIRS.DAT as database file.
/W -- Using G: as the work drive.
/R! -- Do not remove, or delete, files from subdirectory.
=== Emergency backup dir. (C:\PBWEED.$$$) has been made, backing-up now.
DEBUG: Executing: COPY E:\BBSDATA\DATA\UBCHEAT.* C:\PBWEED.$$$ /V
DEBUG: DaysOld (/D, in seconds) is 15379200
>>> Using these parameters: 178 days old and older, 12 times d/l'ed
DEBUG: --> Working drive is G:\
DEBUG: File length of DIRS.DAT is: 38634 bytes
DEBUG: Size of each directoryrec record: 141 bytes
DEBUG: Total number of directories is: 274
···Processing dir : UBCHEAT
Not removing 1X-PAK .ARJ: (631 d.o. - 5 d/l's)
>>> Shutting down PBweed 1.1 at 00:30.04
Reason: Normal exit -- no error.
DEBUG: Executing the command - COPY G:\*.DIR E:\BBSDATA\DATA /V
DEBUG: Executing the command - COPY G:\*.EXT E:\BBSDATA\DATA /V
»»» Total number of files removed 248 (8373k).
=== Removing contents of C:\PBWEED.$$$ -- finished processing!
There can be more DEBUG lines -- especially in times of errors.
: KNOWNE BUGS AND PROBLEMS :
ARJ 2.42a ßeta_2 (and possibly ßeta_1) has a bug in it where it will lock up
most the time of you try to *update* a file. Since PBweed is doing exactly
this when backing-up the *.DIR and *.EXT data files, you may run across this.
This is a definite bug in ARJ, and is known by the author (I've talked with
him about it). Versions previous to 2.42, and most likely those after ßeta_2
should work just fine.
:LEGAL JUNQUE:
Copyright -
The PBweed software and its accompanying documentation are protected by both
United States copyright law and international treaty provisions. You may make
copies of this program, and distribute those copies, provided that you do not
change any part of the PBWEEDxx.* archive, which include:
PBWEED.EXE [The executable file.]
PBWEEDG.EXE [Executable for gold systems.]
PBWEED.DOC [This documentation file.]
PBWEED.ANN [An announcement file.]
FILE_ID.DIZ [BBS description file.]
SUPPORT.BBS [Listing of all SPV support BBS's, and how you can join!]
SOURCE.COD [How to get the source code for PBweed.]
Warranty -
PBweed is provided as is, without warranty, either expressed or implied.
The author specifically disclaims all other warranties, expressed or implied,
including, but not limited to, any implied warranty of merchantability or
fitness for a particular purpose. You're using it, and I'm not responsible.
License Agreement -
Users are granted full rights to use this program for as long as they wish.
Registration -
There is no registration for this program. However, I would appreciate $5
that will help as an incentive for me to write more WWIV utilities. $30 will
get you the source code. Send any donations to (US currency only):
Make your check/money order out to: TRACY L. BAKER
And send them to : %STARPORT VALHALLA
909 Marina Village Parkway #430
Alameda, CA 94501
This address will be good to around May, 1995. Around that time, or after
then E-Mail me [1@11579.wwivnet] for an updated address.