.TH ck4up 1 "Oct 25 2007" "ck4up 0.2.4" ""
.SH NAME
ck4up \- Check for Updates, a utility to monitor web pages for updates 
.SH SYNOPSIS
\fBck4up [options] [<regexp> ...]\fP
.SH DESCRIPTION
\fBck4up\fP is a small command-line utility, writen in ruby, primarily 
intended for CRUX ports maintainers to watch http and ftp sites for 
updates, but may also be useful for others.

\fBck4up\fP scans through a configuration file, fetches the listed URLs 
from the web, computes the md5sum of the page, and compares the value with
one stored in a gdbm database. If both differ a message will be written
to the standard output.

To improve performance, \fBck4up\fP is multi-threaded. A configurable
number of threads fetches pages in parallel. The default setting is a
maximum of 20 threads and can be changed at the top of the script
(variable Threads_max).

Regular expressions can be applied to each page in the event that \fBck4up\fP
produces repetitive diff messages. For example, if daily snapshots and
a web counter are on the same page.

To simplify maintenance of the configuration file, a kind of 
macro-expansion can be used.

.SH OPTIONS
.TP
.B -d, --debug
Run ck4up in debug mode. All fetched pages will be written to the
standard output. This is especially useful when combined with a
regexp to limit the number of pages to process.
.TP
.B -k, --keep
Keep md5 values, don't update the database.  
.TP
.B -v, --verbose
Verbose mode. Print a message also for unchanged pages.
.TP
.B -h, --help
Print a short help message and exit.
.TP
.B -c, --cleandb
Removes unused entries from the ck4up database.
.TP
.B -f <file>, --config <file>
Use alternative configuration from <file> instead of the default 
\fI ~/.ck4up/ck4up.conf\fP. 
Don't add the .conf extension to the filename, it's added by
ck4up. 
The base directory is hardcoded to \fI ~/.ck4up/\fP.
If you don't like that location, change the constant Basedir at the 
top of the script.
.TP
.B <regexp>
Process only configuration-lines matching <regexp>. If more than one
expression is given, all of them are or'ed to build a regular expression.

.SH CONFIGURATION

The configuration file for ck4up contains lines with macro
definitions and lines defining URLs to check for updates.
Blank lines and lines beginning with a pound-sign, which are 
considered comments, are ignored. Spaces at the beginning of
definition-lines are not allowed.
.br
The default location for the \fBck4up\fP configuration file 
is 
\fI~/.ck4up/ck4up.conf\fP.


.B <name>  <type>  <url>  [<regexp>]

Lines starting with a valid character in the range [a-zA-Z] are URL lines, 
defining the web-pages you would like to check for updates.
<name> is a symbolic name for the URL, md5 is the only valid 
entry for <type> at the moment, <url> is the URL of the 
web-site, <regexp> is an optionally extended regular expression.
Don't use spaces in regexps, but \\s instead.

Examples:

.br
apache  md5  http://www.apache.de/dist/httpd/    httpd-2[0-9.]*
.br
uw-imap md5  ftp://ftp.cac.washington.edu/imap/ 


.B <@[A-Za-z0-9_]*@>  <string>  [<string>]

Lines starting with @ define macros for later use. 
A system macro @NAME@, which is the <name> of the URL line, can 
be used in other macro definitions.
This is handy if many URLs follow a common syntax. See
the examples for @SF@ and @GNOME@ below. 
Macro expansion is done recursively, allowing macros to be nested. 
See the @FM@ example below which makes use of freshmeat's XML project 
database.

.SH EXAMPLE

Example of a configuration file containing URL and macro
definitions:

@SUN@     http://mirrors.sunsite.dk
.br
@SF@      http://prdownloads.sourceforge.net/@NAME@/ @NAME@-[0-9.]+
.br
@GNOME@   http://ftp.gnome.org/pub/gnome/sources/@NAME@/2.4/

@FM_url@  http://freshmeat.net/projects-xml/@NAME@/@NAME@.xml  
.br
@FM_reg@  <latest_release_version>.*</latest_release_version>
.br
@FM@      @FM_url@ @FM_reg@
.br
@TAR@     @NAME@-.*\\.tar\\.[bg]z2?

apache       md5  http://www.apache.de/dist/httpd/   httpd-2[0-9.]*
.br
crux         md5  @FM@
.br
exim         md5  @SUN@/exim/exim/exim4/             @TAR@
.br
gimp-print   md5  @SF@
.br
gnome-panel  md5  @GNOME@
.br
uw-imap      md5  ftp://ftp.cac.washington.edu/imap/ imap-200.?[a-z]*

.SH FILES
\fI~/.ck4up/ck4up.conf\fP - configuration-file
.br
\fI~/.ck4up/ck4up.dbm\fP - gdbm database to store the md5 hashes

.SH AUTHOR
Jürgen Daubert <juergen.daubert@t-online.de>