SUCK(1)

NAME
suck - Pull a small newsfeed from an NNTP server, avoiding the NEWNEWS command.

SYNOPSIS
suck [ hostname ] [ -V ] [ -K ] [ -H ] [ -d[tmd]dirname ] [ -s|-Sfilename ] [ -e|-Efilename ] [ -a ] [ -m ] [ -b[ir]batchfile ] [ -rfilesize ] [ -pextension ] Options valid in all modes -V This option will cause suck to print out the version number and then exit. -s | -S filename These options will send all status messages (normally displayed on stdout), to an alternate file. The lower case version, -s, will send the status messages to the compiled-in default defined in config.h. The default is /dev/null, so no status messages will be displayed. The upper case version, -S, requires the filename parameter. All status messages will then be sent to this file. -e | -E filename These options will send all error messages (normally displayed on stderr), to an alternate file. The lower case version, -e, will send the error messages to the compiled-in default defined in config.h. The default is suck.errlog. The upper case version, -E, requires the filename parameter. All error messages will then be sent to this file. -a This option forces suck to always batch up any downloaded articles, even if suck aborts for any reason. Without this option, suck will only batch up articles if it finishes successfully or is cancelled by a signal (see below). -dt dirname -dm dirname -dd dirname Specify the location of the various files used by suck. -dt dirname = directory of temp files created by suck (suck.newrc, suck.sort, suck.restart, suck.killlog). -dm dirname = directory for storage of articles created in Multifile mode or batch mode -dd dirname = directory of data files used by suck (sucknewsrc suckkillfile suckothermsgs) -p extension
    This extension is added to all files so that you can have multiple site feeds. For example, if you specify -p dummy, then suck looks for sucknewsrc.dummy, suckkillfile.dummy, etc, and creates its temp files with the same extension. This will allow you to keep multiple sucknewsrc files, one for each site. -K
    This option will cause suck to bypass checking the killfile(s). -H
    This option will cause suck to bypass the history check.

DESCRIPTION

MODE 1 - stdout mode
    %suck
    %suck myhost.com

Suck grabs news from an NNTP server and sends the articles to stdout. Suck accepts as argument the name of an NNTP server or if you don't give an argument it will take the environment variable NNTPSERVER. You can redirect the articles to a file or compress them on the fly like "suck server.domain | gzip -9 > output.gz". Now it's up to you what you do with the articles. Maybe you have the output already on your local machine because you used a slip line or you still have to transfer the output to your local machine.

MODE 2 - Multifile mode
    %suck -m
    %suck myhost.com -m

Suck grabs news from an NNTP server and stores each article in a separate file. They are stored in the directory specified in config.h or by the -dm command line option.

MODE 3 - Batch mode
    %suck -b[ir] batchfile
    %suck myhost.com -b[ir] batchfile

Suck will grab news articles from an NNTP server and store them into files, one for each article (Multifile mode). The location of the files is based on the defines in config.h and the command line -dm. Once suck is done downloading the articles, it will build a batch file which can be processed by either innxmit or rnews. -bi - build batch file for innxmit. The articles are left intact, and a batchfile is built with a one-up listing of the full path of each article. Then innxmit can be called:
    %innxmit localhost batchfile
-br - build batch file for rnews. The articles are concatenated together, with the #!rnews size article separator. This can the be fed to rnews:
    %rnews -S localhost batchfile
-r filesize specify maximum batch file size for rnews. This option, is only meaningful when used with -br above. This option allows you to specify the maximum size of a batch file to be fed to rnews. When this limit is reached, a new batch file is created AFTER I finish writing the current article to the old batch file. The second and successive batch files get a 1 up sequence number attached to the file name specified with the -br. Note that since I have to finish writing out the current article after reaching the limit, the max file size is only approximate.

SUCKNEWSRC

Suck looks for a file sucknewsrc to see what articles you want and which you already received. The format of sucknewsrc is very simple. It consists of one line for each newsgroup. The line contains two fields. The first field is the name of the group. The next field is the highest article number that was in the group when that group was last downloaded. The fields are separated by a space.
    comp.os.linux.announce 1

When suck is finished, it creates the file suck.newrc which contains the new sucknewsrc with the updated article numbers.

To add a new newsgroup, just stick it in sucknewsrc, with a highest article number of -1 (or any number less than 0). Suck will then get the highest current available article number and update suck.newrc. If you want to get any past article, you can then change this number.

To tell suck to skip a newsgroup, put a # as the first character of a line.

SUCKKILLFILE and GROUP KEEP/KILLFILES
To use the killfile/keepfile routines, uncomment the #define KILLFILE line in config.h. Then, if suckkillfile exists, the headers of all articles will be scanned and the article downloaded or not, based on the parameters in the files. Any articles not downloaded have the headers logged to suck.killlog. You can then download these articles by putting their Message-IDs in the suckothermsgs file.

Here's how the whole keep/delete package works. All articles are checked against the master kill file (suckkillfile). If an article is not killed by the master kill file, then its group line is parsed. If a group file exists for one of the groups then the article is checked against that group file. If it matches a keep file, then it is kept, otherwise it is flagged for deletion. If it matches a delete file, then it is flagged for deletion, otherwise it is kept. This is done for every group on the group line. One potential problem is what happens when an article is flagged both for keeping and deletion. This is handled by the "tie-breaker" defined in config.h. If the tiebreaker is defined, then the "tied" article is kept. If it is not defined, then the article is deleted.

PARAMETERS
    LOWLINES=#######
    HILINES=#######
    PATH=xxxxx,yyyyy
    FROM=xxxxx,yyyyy
    SUBJECT=xxxxxx,yyyy
    QUOTE=c
    GROUP=keep groupname filename OR GROUP=delete groupname filename
    NRGRPS=########

KILL/KEEP Files Paramaters

HILINES= Match any article longer than the number of lines specified.

LOWLINES= Match any article shorter than the number of lines specified.

QUOTE= This item specifies the character that defines a quoted string. The default for this is a ".

PATH= FROM= SUBJECT= These lines allow you to match an article based on an item in these header fields. You may specify multiple items on each line, as long as they are separated by a comma. If an item starts with a QUOTE character (as specified above), then the item is checked as-is (case significant). If an item does not start with a QUOTE character, then the item is checked with out regard to case.

GROUP= This line allows you to specify either keep or delete parameters on a group by group basis. There are three parts to this line. The first part is either "keep" or "delete". If it is keep, then only articles in that group which match the parameters in the group file are downloaded. If it is delete, articles in that group which match the parameters are not downloaded. The second part, the group name is the full group name for articles to check against the group file. The third part specifies the group file which contains the parameters to check the articles against.

NRGRPS= This line will match any article which has more groups than the number specified. Typically this is used in a killfile to prevent spammed messages. (A spammed message is one that is posted to many, many groups, such as those get-rich quick schemes, etc.)

All parameters are valid in both the master kill file, and the group files, with the exception of the GROUP line. This is only valid in the master kill file.

SUCKOTHERMSGS
If suckothermsgs exists, It must contain a one-per-line listing of Message-ID's, with the <> included. These articles will then be downloaded, in addition to any articles generated by processing the sucknewsrc file. This can be used to get articles in other groups, or to download an article that was killed. These articles ARE NOT processed through the kill articles routines.

SIGNAL HANDLING
Suck accepts one signal, defined in config.h. You can send this signal to suck, and it will finish download the current article, batch up whatever articles were downloaded, and exit, without an error.

EXIT CODES
Suck will exit with a return code of 0 on success, and -1 on error.

HISTORY
    Original Author - Tim Smith (unknown address)
    Maintainers -
    March 1995 - Sven Goldt (goldt@math.tu-berlin.de)
    July 1995 - Robert A. Yetman (boby@pixi.com)

SEE ALSO
testhost(1), rpost(1), lpost(1).