summaryrefslogtreecommitdiff
path: root/fetcher
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2015-03-04 16:38:34 +0100
committeremkael <emkael@tlen.pl>2015-03-04 16:38:34 +0100
commitb27f8ef1387509c4b9d778505d185f8e0a541729 (patch)
treeda5fff8fba015fd835abb07ca4540a9110eb9bff /fetcher
parentffd9d4fb6706e609a16b3a5a2fffe0959fd845d3 (diff)
* README files
Diffstat (limited to 'fetcher')
-rw-r--r--fetcher/README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/fetcher/README.md b/fetcher/README.md
new file mode 100644
index 0000000..828e405
--- /dev/null
+++ b/fetcher/README.md
@@ -0,0 +1,40 @@
+Overview
+========
+
+fetcher keeps the local copy of Ergast database dump (available from [Ergast website](http://ergast.com/mrd/db)) up to date, using timestamps declared in the HTTP headers.
+
+The database dump is also slightly altered on unpacking, to get rid of MyISAM table storage engine, hard-coded in the dump. This allows an easy import into other storage engine database, like InnoDB.
+
+fetcher is part of [ergast-goodies](README.md) toolset.
+
+Requirements
+============
+
+Since this bash script simply stitches together some tools used to retrieve and unpack the database dump, it requires these to work properly:
+
+* pushd/pop for sane working directory management (the script works in its own directory)
+* wget
+* zcat
+* sed
+* find
+* touch
+
+Most of these tools are available by default in every Linux installation, the rest of it should be easily accessible from the package repository of your distribution of choice.
+
+Usage
+=====
+
+Just run `fetcher.sh`.
+
+The script takes no arguments.
+
+Under the hood
+==============
+
+The script makes use of wget's timestamping feature. It attempts to download the f1db.sql.gz dump from Ergast website only if the declared timestamp of the file is newer than the local timestamp of the dump file.
+
+The .sql.gz file is stored in script directory only for that purpose.
+
+If the script is unable to connect to the remote server, that local copy is used instead.
+
+If the archive is newer than the unpacked dump, which is stored in script directory as well, it unpacks the dump, erasing the storage engine declaration on the fly. The resulting .sql file is ready for import to the database of your choice.