METEODBDUMP(1)

NAME
meteodbdump - dump contents of meteo database

SYNOPSIS
meteodbdump [ -bbasename ] [ -cchunksize ] [ -d ] [ -r ] [ -fconffile ] [ -llogurl ] -sstation table ...

DESCRIPTION
The meteodbdump(1) programm dumps the contents of the meteo database (see meteo.sql(5)) to text files. In contrast to ordinary mysqldump(1), it usually reads the records of a day at a time, i.e. less than 2000 rows, so that the table does not stay locked for extended time intervals. Also the meteo tables tend to be so large that mysqldump(1) will run out of memory before anything is dumped. Furthermore, a dump into SQL statements is just too space consuming, so there is an option to request a more compact load file format. meteodbdump(1) connects to the database using the read only connection specified in the either the default configuration file or the one specified with the -f option. It then starts reading data for the station station and writes SQL insert statements to the files basenamesdata and basenameavg. Data is read in chunks of time length at most chunksize seconds. The SQL insert statements do not rely on a certain order of the fields in the table definition. However, the contents of the station table and the mfield table are not dumped. Since stations and fields are completely described only with this information, tools like mysql_dump(1) should be used to backup those tables. Without any additional arguments, meteodbdump(1) dumps all data tables, i.e. avg and sdata. The names of the tables to be dumped can be specified as additional arguments, in which case only the specified tables are dumped.

OPTIONS

-bbasename
    The basename string is prepended to the strings sdata and avg, which are then used as filenames for the output files. The basename may contain slashes (/), but meteodbdump(1) will not create directories, so they should be created manually before meteodump(1) is run. Example: a basename of /var/tmp/Lajeado- will let meteodbdump(1) dump the data to the files /var/tmp/Lajeado-sdata and /var/tmp/Lajeado-avg.

-cchunksize
    read at most records for a time interval of length chunksize seconds from the database at one time. By default, a days worth of records is read in every iteration, minimizing metedbdump(1)'s impact on concurrency. Larger values for the chunksize cause the dump to use more memory, and usually hurt concurrency noticably.

-d  increase the debug level by one. Debug messages are written to standard error.

-r  request raw format, i.e. tabulater separated fields, one line per row. This reduces the output size by about a factor 3.

-fconffile
    use conffile as the meteo configuration file. See meteo.xml(5) for the configuration file syntax.

-llogurl
    send log messages to the destination described by the logurl.See meteo(1) for a description of the possible formats for log URLs.

-sstation
    name of the station to dump. This option can be given several times, meteodbdump(1) will dump the data for each of the stations in turn. Data for all stations will be written to the same files.

BUGS
meteodbdump(1) terminates if a single query fails. This makes it impossible to dump corrupted databases.

SEE ALSO
meteo(1), meteo.sql(5), meteo.xml(5)

AUTHOR
Dr. Andreas Mueller <afm@othello.ch>