home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / chexp09p.zip / exp09p.txt next >
Text File  |  1996-06-24  |  24KB  |  741 lines

  1.                      Changi Expire Program Version 0.9p
  2.                      ==================================
  3.  
  4.  
  5. This program is a prerelease and so is this document.
  6.  
  7.  
  8. What is Expire?
  9. ---------------
  10.  
  11. This program will be used in conjunction with a news database
  12. formatted in the traditional way. The term 'traditional' means
  13. that each article is stored in a single file with the article
  14. number as it's filename. Additionally a file called history
  15. stores each article-ID plus some other information and another
  16. file called active contains a list of all active newsgroups.
  17.  
  18. Expire will check the arrival, posting and expiration date of
  19. each article and determine wether it should be removed or
  20. retained. At least expire will rebuild the history and update
  21. the active file.
  22.  
  23. This special version was written for Changi, a NNTP server for
  24. OS/2. Users of Changi are now waiting a nearly unacceptable
  25. long period for the release of a new version. Unacceptable,
  26. because among other things the expire program of the last
  27. version 0.9n is not what I would call a smart piece of software.
  28.  
  29. A note for the NNTP freaks of you. This expire program contains
  30. many functions usually done by different programs. It will
  31. create and/or maintain an overview database. And it will recreate
  32. lost history files as well as lost active files.
  33.  
  34. This package contains three files.
  35.  
  36. expire.exe  The main program
  37. exsort.exe  Called by expire to sort the history
  38. exp09p.txt  The one you're reading now
  39.  
  40. Expire and Changi are available via anonymous ftp from
  41.  
  42. ftp.gigo.com:/pub/misc
  43. ftp.cam.org:/users/tomlins
  44.  
  45. While I write this you need two files to get the current version
  46. of Changi:
  47.  
  48. chang09m.zip    contains version 0.9m
  49. chpat09n.zip    contains an upgrade to 0.9n
  50.  
  51. Thanks to Jason Fessler, the author of gigo (fido - internet/usenet
  52. gateway) there is also a mailing list available. To subscribe, send
  53. mail to listserv@gigo.com
  54.  
  55. and type
  56.  
  57. subscribe changi
  58.  
  59. in the first line of your message. I'm sorry that I had not
  60. very much time to attend this forum, but there are many very
  61. helpful people waiting for your problems with expire.
  62.  
  63.  
  64.  
  65. Is This Software Free?
  66. ----------------------
  67.  
  68. If you like free software, then take this for free. However,
  69. if you'd do me a favor, send me a postcard, preferably showing
  70. your hometown.
  71.  
  72. For Changi I received lot's of postcards from all over the
  73. world. And, the more I get, the more I like them. Thankyou
  74. very, very much for all the nice postcards I received.
  75.  
  76. As Changi's new release isn't finished, I decided to
  77. distribute the new expire on it's own, just to keep people
  78. happy and postcards flowing in.
  79.  
  80. For the address see my personal note at the end of this
  81. document.
  82.  
  83.  
  84.  
  85. How about the source code
  86. -------------------------
  87.  
  88. I'll make it available as soon as possible at the above
  89. mentioned ftp sites.
  90.  
  91.  
  92.  
  93. History
  94. -------
  95.  
  96. When I started to create my own NNTP server for private use,
  97. I didn't worry about news expiration, because I used UUPC
  98. to retrieve the articles from my provider and this package
  99. already includes a news expiration program.
  100.  
  101. The trouble began with Chanx, a program which is able to
  102. retrieve news in a more simple way then by UUPC. I still
  103. prefer UUPC, but setting it up requires special knowledge
  104. and not all providers support it. People filled their
  105. harddisks with articles and then started crying for a
  106. program to get rid of old articles.
  107.  
  108. I programmed a quick hack, stealing most of the code from
  109. UUPC's expire, adding some extra to make it work smoother
  110. with Changi.
  111.  
  112. In the meantime I had developed, stolen and discarded many
  113. new ideas to enhance Changi and it's associated programs.
  114.  
  115. The good news are, that you will find lots of enhancements
  116. compared with it's previous release. Now the bad news: This
  117. version of expire is not plug-in compatible. Many parts of
  118. Changi version 0.9p (not yet released) had been redesigned.
  119.  
  120. To make expire working with pre-0.9p version of Changi, you
  121. need at least add option '-Uxs' to force expire generating
  122. a compatible history file and avoid pausing the server.
  123. Please read that part of this document very carefully, which
  124. describes the various program options.
  125.  
  126. Note too, that you need to stop pre-0.9p versions of the
  127. Changi server while running this version of expire.
  128.  
  129.  
  130. Changes
  131. -------
  132.  
  133. Expire configuration file
  134.  
  135.   A new configuration file offers the possibility to define
  136.   different expiration periods for different newsgroups.
  137.  
  138.  
  139. Rebuilding active file
  140.  
  141.   Option '-a' will scan the news directories for groups
  142.   not found int the active file and add them. Option '-A'
  143.   will create a new active file from scratch, overwriting
  144.   any existing file.
  145.  
  146.  
  147. Fast expiration without rebuilding history
  148.  
  149.   With option '-C' the program will remove expired articles
  150.   and mark the corresponding message-ID as canceled.
  151.  
  152.  
  153. New history file layout
  154.  
  155.   A new index file layout using hash keys in a binary tree
  156.   structure significantly reduces disk space consumption and
  157.   access time.
  158.  
  159.  
  160. Syslog interface
  161.  
  162.   While previous versions created a logfile, this new release
  163.   uses a local syslog daemon for greater flexibility. The
  164.   syslog daemon is not included in this distribution, but is
  165.   part of IBM's TCP/IP base product and available as freeware
  166.   ported by Jochen Friedrich.
  167.  
  168.  
  169. Ability to control Changi server
  170.  
  171.   Expire is able to flush, pause and restart the server, if
  172.   it needs exclusive access to the history and active file.
  173.   However, this will not work with pre-0.9p versions of the
  174.   server, in which case you have to stop the server during
  175.   article expiration.
  176.  
  177.  
  178. Changed name of sort program
  179.  
  180.   The name of the sort program has been change to exsort to
  181.   avoid conflicts with existing programs.
  182.  
  183.  
  184. Summary file for statistics
  185.  
  186.   Expire will optionally append a summary record to a text
  187.   file for later processing by a statistic software.
  188.  
  189.  
  190. Support for cross-post linking
  191.  
  192.   An article will not be removed as long as any other
  193.   cross-posts of the article remain.
  194.  
  195.  
  196.  
  197. Installing expire
  198. -----------------
  199.  
  200. You may copy expire and exsort in any directory. By default expire
  201. expects the history and active files in the current directory and
  202. the articles files in subdirectories of the subdirectory news.
  203.  
  204. For example, articles of the group comp.os.os2 are expected in
  205. news\comp\os\os2.
  206.  
  207. If this behaviour doesn't fit, don't worry. Expire offers many
  208. command line options and searches certain enviroment settings
  209. to become customized.
  210.  
  211.  
  212.  
  213. Calling Expire
  214. --------------
  215.  
  216. The program will be usually called with several command line
  217. parameters. The general format is
  218.  
  219.     expire [options] [newsgroups]
  220.  
  221. The program supports a large set of [options] to control it's
  222. behaviour and enhance it's flexibility. They are described
  223. in detail in the next section.
  224.  
  225. The [newsgroups] command line parameter specifies a comma
  226. separated list of newsgroups with simple pattern matching.
  227. Only articles of matching groups will be expired.
  228.  
  229. Example:
  230.  
  231.     expire -e3 comp.os.os[29]*,!comp.os.os2.mail-news
  232.  
  233.     This call will expire all articles older than three days
  234.     in the groups comp.os.os2 as well as comp.os.os9 and all
  235.     subgroups except comp.os.os2.mail-news.
  236.  
  237. Do not use this parameter together with option '-r' or '-h',
  238. because this will create an incomplete history.
  239.  
  240. Note that this parameter is supported for compatibility. It is
  241. not very usefull anymore, since the expire configuration file
  242. offers a better way expire articles in different groups on
  243. different times.
  244.  
  245.  
  246. Expire configuration file
  247. -------------------------
  248.  
  249. For sure this is the most useful enhancement of this realease.
  250.  
  251. You may create this file with the name 'expire.conf' using any
  252. text editor in the same directory where you run expire. The
  253. program will automatically use it, if it finds it.
  254.  
  255. The file may contain any number of empty lines anywhere. Also
  256. lines with human readable comments are accepted if they are
  257. marked with '#' (number sign) in the first column.
  258.  
  259. All other lines must be given in the following format.
  260.  
  261.     newsgroups min-keep max-keep
  262.  
  263. The first field specifies the newsgroups this line is valid
  264. for. A comma separated list of newsgroups with simple pattern
  265. matching may be given.
  266.  
  267. The second field, min-keep, specifies the minimum time to keep
  268. any article. This is the normal age at which an article expires.
  269. Even if an article contains an explicit expiration date in it's
  270. header, it will be kept at least this time period.
  271.  
  272. To define a time value, you may simply give a number, which
  273. will be interpreted as the number of days you want to keep
  274. articles. Furthermore you may add a single letter representing
  275. one of these a units:
  276.  
  277.       h  hours
  278.       d  days (default)
  279.       w  weeks
  280.  
  281. Even combinations are possible, like 1d12h, which means one
  282. and a half day.
  283.  
  284. The value you use depends highly on your available diskspace
  285. and may also be influenced by your interest and the traffic
  286. in the specified newsgroups.
  287.  
  288. The third field, max-keep, defines the maximum time to keep
  289. any article. This parameter is used to get rid of articles with
  290. an explicit expiration date too far in the future. You should
  291. specify a very long period, about two to three months, to not
  292. accidently destroy periodical postings with long update delays.
  293.  
  294. Note, that the sequence of entries is important too. Lines
  295. at the end of the file may overwrite previous definitions.
  296.  
  297.  
  298. Example:
  299.  
  300. # This is a sample expire configuration file
  301.  
  302. # First entry specifies the default.
  303. * 1w 90d
  304.  
  305. # This second entry keep os2 related groups a bit longer
  306. *os2* 2w3d 90
  307.  
  308. # I want junk removed soon
  309. junk,control* 12h 12h
  310.  
  311. # Keep some local groups for a long period
  312. ping* 4w 90
  313.  
  314.  
  315.  
  316. Command line options
  317. --------------------
  318.  
  319. This part of the document is the key to become a real expire
  320. guru.
  321.  
  322. All options are optionally. Expire will run fine without any,
  323. but may not do what you expected it to do and will for sure
  324. not do it the best way. One way I'd suggest is, to use option
  325. '-C' for a daily run immediately before retrieving new articles
  326. and run without '-C' but with option '-E' weekly.
  327.  
  328.  
  329. -a  Rebuild active file
  330.  
  331.   Before starting expiration, and after reading in an existing
  332.   active file, the program will scan the news directory. If it
  333.   finds any subdirectory containing articles files without a
  334.   corresponding newsgroup in the active file, the new newsgroup
  335.   will be added.
  336.  
  337.  
  338. -A  Create active file
  339.  
  340.   This option will force expire to ignore any existing active
  341.   file. It will scan the news directory for subdirectories
  342.   containing article files and create all corresponding
  343.   newsgroups. The list of groups will be written to a new
  344.   active file. Be aware, that this will silently overwrite any
  345.   existing active file and remove newsgroups without currently
  346.   stored articles.
  347.  
  348.  
  349. -b  Remove bad articles
  350.  
  351.   When rebuilding the history, expire needs to read each article
  352.   header. Articles with incomplete headers or corrupted otherwise
  353.   are normally ignored. Setting this option will remove them.
  354.  
  355.  
  356. -c<filename>  Name of the expire configuration file
  357.  
  358.   By default expire will look for a file named expire.conf in
  359.   the current directory and will not worry, if this file doesn't
  360.   exist. This option may define a different filename and force
  361.   expire to terminate, if it couldn't read this file. See
  362.   previous chapter for further explanations on how to create an
  363.   expire configuration file.
  364.  
  365.  
  366. -C
  367.  
  368.   If this option is given, expire will not remove entries from
  369.   the history file. Instead expired articles will be marked
  370.   canceled, which saves expire from rebuilding the history index.
  371.   This is a good option for daily expiration, but you should
  372.   not forget to run the program from time to time without this
  373.   option in order to get rid of outdated history entires.
  374.  
  375.  
  376. -de
  377.  
  378.   Turns excessive logging on. See option -do.
  379.  
  380.  
  381. -dt
  382.  
  383.   Let the program run in testmode. All actions are performed
  384.   like in normal mode, but no articles will be removed
  385.   and no active file or history update takes place.
  386.  
  387.  
  388. -do
  389.  
  390.   By default you need any syslog daemon to view and/or store
  391.   logged messages. This option will output them on the screen
  392.   using the standard error channel. Here's an example on how
  393.   to redirect this output to a file: 'expire -do 2>mylog'.
  394.  
  395.  
  396. -dp
  397.  
  398.   Adds the current program id to logged messages. See option -do.
  399.  
  400.  
  401. -e<time>
  402.  
  403.   Defines the expiration age of an article. Articles older than
  404.   the given time period will be removed. Use numbers followed
  405.   by an optional unit character (h=hours, d=days, w=weeks) to
  406.   specify this time. Without explicit unit character, days are
  407.   assumed. The default is 7d.
  408.  
  409.  
  410. -E<time>
  411.  
  412.   Removing articles is one thing, removing IDs from the history
  413.   is another. It's a good idea to keep the messages-IDs for some
  414.   time in the history after the article has been removed. This
  415.   will help to avoid duplicates. Use numbers followed by an
  416.   optional unit character (h=hours, d=days, w=weeks) to specify
  417.   this time. Without explicit unit character, days are assumed.
  418.   To remove articles older than 7 days and keep IDs of expired
  419.   articles seven more days, call
  420.  
  421.       expire -e1w -E2w
  422.  
  423.   By default, all IDs of expired articles are removed from the
  424.   history.
  425.  
  426.  
  427. -h  Ignore history
  428.  
  429.   With this option set expire will ignore an existing history
  430.   file and scan the newsbase using the active file. Any existing
  431.   history file will be overwritten. This is useful when the
  432.   filesystem does not have sufficient space to hold both the old
  433.   and new history files. Be prepared that expire needs much
  434.   more time to run when this option is given.
  435.  
  436.  
  437. -i  Ignore explicit expiration date
  438.  
  439.   To some articles, especially regular postings like FAQs,
  440.   a special header line is added to define an explicit expiration
  441.   date. By default expire will honor this date, but with this
  442.   option the program will ignore it.
  443.  
  444.  
  445. -p  Use posting date instead of arrival date
  446.  
  447.   By default expire will use the article's date of arrival
  448.   to determine it's age. This option forces expire to use
  449.   the posting date.
  450.  
  451.  
  452. -q<number>  Quit after specified number of errors
  453.  
  454.   Normally expire will ignore corrupted article files or bad
  455.   history entries. This option will quit expire if the specified
  456.   number of those kind of problems occured.
  457.  
  458.  
  459. -r  Rebuild
  460.  
  461.   This option implies options '-h'. Expire will ignore any
  462.   existing history, but rebuild a new one from scratch by
  463.   scanning the news directory. You shouldn't use this option
  464.   unless you need to. Disadvantages are, that expire needs much
  465.   more time to process and that all remembered message-IDs of
  466.   previously expired articles are lost.
  467.  
  468.   With this option expire will also completely recreate the
  469.   overview database. Therefore you should initially specify this
  470.   option if your previously used news software didn't create
  471.   overview files.
  472.  
  473.  
  474. -R<reason>  Defines textual reason to pause server
  475.  
  476.   Expire tries to pause the local Changi server when it needs
  477.   exclusive access to the history file, using 'Expiring' as the
  478.   reason. Use this option to give a different reason.
  479.  
  480.  
  481. -s<programcall>  Sort program to call
  482.  
  483.   By default expire calls 'exsort +1n >' and feeds history lines
  484.   to it's standard input. Note, that expire will append the name
  485.   of the sorted target file.
  486.  
  487.  
  488. -S<filename>  Add summary to specified file
  489.  
  490.   If this option is given, expire will add a line at the end
  491.   of the given file when successfully completed. The line contains
  492.   seven space separated fields.
  493.  
  494.     Time of starting expire (number of seconds since 1/1/1970)
  495.     Article lines processed
  496.     Articles retained
  497.     Entries expired
  498.     Files deleted
  499.     Old entries dropped
  500.     Old entries retained
  501.  
  502.  
  503. -t<directory>  Use for temporary files
  504.  
  505.   Expire uses a special directory for temporary files. The program
  506.   checks several environment variables and uses the first one it
  507.   finds. The names checked are CHANGITEMPDIR, TMP and TEMP, in this
  508.   sequence. If none was found, the current directory is used. The
  509.   default behaviour may be overridden by this option.
  510.  
  511.  
  512. -T  Sort active file
  513.  
  514.   Expire will not change the order of groups in the active file,
  515.   unless this option has been given.
  516.  
  517.  
  518. -U  Create UUPC compatible history index
  519.  
  520.   Starting with version 0.9p Changi uses a new history index format
  521.   to speed up processing and save diskspace. This option makes
  522.   expire work with previous releases.
  523.  
  524.  
  525. -v  Verbose output
  526.  
  527.   Displays progress information during expiration. The output
  528.   is send to the standard error channel and may interfere with
  529.   option '-do'.
  530.  
  531.  
  532. -w<time>  Defines time warp
  533.  
  534.   Use numbers followed by an optional unit character (h=hours,
  535.   d=days, w=weeks) to specify this time. Without explicit unit
  536.   character, days are assumed. You may define a positive or
  537.   negative time offset of the current local time. For example,
  538.   giving '-w-8h' makes expire think it's running eight hours earlier
  539.   than the actual time. So all articles will become eight hours
  540.   younger than they really are and expire may remove less articles
  541.   than it would have done without this option.
  542.  
  543.  
  544. -xa  Do not update the active file
  545.  
  546.   If this option is set, expire will leave the active file
  547.   unchanged.
  548.  
  549.  
  550. -xh  Do not update the history
  551.  
  552.   This option forces expire not to update the history files.
  553.  
  554.  
  555. -xo  Do not update overview files
  556.  
  557.   With this option expire will neither create nor update any
  558.   overview file.
  559.  
  560.  
  561. -xs  Do not pause Changi server
  562.  
  563.   Expire tries to pause the local Changi server when it needs
  564.   exclusive access to the history or active file. After finishing
  565.   with the locked files expire will send a go command to the server.
  566.   With this option set, expire will not send any command to the
  567.   server.
  568.  
  569.  
  570. -xS  Exclude size from history
  571.  
  572.   By default expire adds the article's size as the third field in
  573.   the history file. If you're using another software than Changi
  574.   to read your news on the local machine, you may try this option
  575.   to avoid incompatibility with Changi's default layout of the
  576.   history.
  577.  
  578.  
  579. -xT  Exclude additional time subfields from history
  580.  
  581.   Expire adds two additional time subfields to history entries,
  582.   the articel's expiration and posting date, which are separated
  583.   with the tilde character. These fields help expire to significantly
  584.   speed up the expiration process.
  585.  
  586.   However, this may create incompatibility problems with other
  587.   news software you're using. This options forces expire not to
  588.   add these additional subfields.
  589.  
  590.  
  591. -z<filename>  Create zapfile, do not delete articles
  592.  
  593.   This option tells expire not to remove expired articles but
  594.   to write the filenames with a 'DEL' command in front to a batch
  595.   file. This file may be run later to finally delete those articles.
  596.  
  597.  
  598. Environment variables
  599. ---------------------
  600.  
  601. This part has lead to many confusions in previous releases.
  602. So be advised, that you don't need to set any of these values,
  603. unless you have special needs.
  604.  
  605. One word for the bloody beginner. Environment variables are
  606. defined with the OS/2 command SET, either on the command line
  607. (or preferable in a batch or REXX file) before calling
  608. expire or they may be defined in config.sys. Avoid spaces
  609. after the equal sign!
  610.  
  611. Example:
  612.  
  613. SET CHANGINEWSDIR=D:\NEWS
  614.  
  615. What is a batch file? What is REXX? Oh, boy - are you sure
  616. you landed in the right century?
  617.  
  618.  
  619. CHANGIACTIVEFILE
  620.  
  621.   Defines the name with optional path of your active file. By
  622.   default expire expects a file named active in the current
  623.   directory.
  624.  
  625.  
  626. CHANGIEXPIRECONF
  627.  
  628.   Defines the name of your expire configuration file. If you
  629.   define this variable, expire will terminate if it couldn't
  630.   find the specified file.
  631.  
  632.  
  633. CHANGIHISTORY
  634.  
  635.   Specifies the name with optional path of your history file.
  636.   By default expire expects two files in the current directory.
  637.   One is named history.pag, the other is either history.idx or,
  638.   if option '-U' has been given, is named history.dir. You
  639.   should specify the name without any extension.
  640.  
  641.  
  642. CHANGINEWSDIR
  643.  
  644.   This environment variable specifies the home (or root) directory
  645.   of your local newsbase. All articles will be stored in
  646.   subdirectories below this point.
  647.  
  648.  
  649. CHANGIOVERDIR
  650.  
  651.   Specifies the root directory for the overview files. All
  652.   overview files will be stored in subdirectories below this
  653.   point. Usually the overview files are stored together with
  654.   the article files in the same directory. This variable is used
  655.   to specify a different location of the overview database,
  656.   preferably a different diskdrive to minimize head movements.
  657.   Because not all parts of the current Changi release support
  658.   this feature, you must set it equal to CHANGINEWSDIR, if you
  659.   set CHANGINEWSDIR.
  660.  
  661.  
  662. CHANGITEMPDIR
  663.  
  664.   This environment variable specifies a directory to be used
  665.   for temporary files. Make sure, that enough diskspace is
  666.   available to store the history files.
  667.  
  668.  
  669. Return codes
  670. ------------
  671.  
  672. Expire returns the following exit codes upon completion, which
  673. may be queried by the ERRORLEVEL variable in batchfiles.
  674.  
  675.   0   No important errors, articles had been expired
  676.   1   Called with wrong parameters and/or usage help displayed
  677.   2   Nothing to expire
  678.  
  679.   3   Fatal error, can't read active file
  680.   4   Fatal error during expire (See option '-q')
  681.   5   No important errors, except updating the active file
  682.  
  683.  
  684. Personal note
  685. -------------
  686.  
  687. Let me add a personal note to not only explain the delay of the
  688. new release of Changi but also abuse this text for my personal
  689. profit (hehehe...).
  690.  
  691. At the beginning of this year I had to work quite hard for my job.
  692. I have been working as an OS/2 programmer in a small company in
  693. Germany for several years now. Unfortunately, a few weeks ago I
  694. was told that I'll be fired by the end of September, because
  695. there isn't enough work for an OS/2 programmer anymore and that
  696. they will concentrate on AIX.
  697.  
  698. After looking around in my area, I had to find out, that there
  699. seem to be no vacancies for my specialized knowledge at all.
  700. Companies in Germany are mainly looking for people experienced in
  701. Windows NT, Delphi, SAP etc.
  702.  
  703. Why I'm telling you this? Well... you might know a job for someone
  704. at the age of 42 with several years of C, assembler and OS/2
  705. programming experience. In that case it'd be great if you'd let me
  706. know. Among other things, I developed software for CAQ systems,
  707. steel industry production control and building automation in
  708. Singapore's MRT stations.
  709.  
  710. Anyway, I'll keep the OS/2 version of Changi free. Just using it
  711. for a bit advertizing... :-)
  712.  
  713. At least I globally want to say thankyou to all the people, who
  714. supported Changi during the last months, either by keeping the
  715. mailing list alive without the author showing up, by helping
  716. others to set it up and explaining bugs and work-arounds, by
  717. providing space on their ftp servers to help distributing this
  718. software, by reporting problems and possible enhancements to me,
  719. or by their unlimited patience while waiting for the next release.
  720.  
  721. And here's my new address, ready to receive tons of postcards:
  722.  
  723.     Harald Kipp
  724.     Noellestr. 28
  725.     58453 Witten
  726.     Germany
  727.  
  728. If you want to contact me regarding a job, here's my phone number.
  729. I'd be best to phone me at 8:00 - 11:00 pm (CET).
  730.  
  731.     +49-2302-963073
  732.  
  733. You may reach me by email at
  734.  
  735.     harald@os2point.ping.de
  736.  
  737.  
  738. Have fun with your new program.
  739.  
  740.     Harald
  741.