Scripting and automation¶
fdsn-rush download --non-interactive (-n) replaces the live view with a few key: value lines on stdout that a script or an AI agent can parse.
sds_folder: data
metadata_folder: metadata
server: https://geofon.gfz.de/
stations: 1
in_archive: 0
to_download: 1
files: 1
no_data: 0
failed: 0
failed_queries: 0
elapsed: 2.815s
status: ok
Nothing else is printed. An invalid configuration file is the exception: it raises before the run starts, prints the full traceback and exits with 1. Run check first to catch it.
server,stations,in_archive,to_download- The plan, one block of four lines per server: matching stations, day files already in the archive and day files requested.
files- Day files saved in this run.
no_data,failed- Day files the server answered with 404, and day files that failed otherwise (other HTTP errors, and timeouts and lost connections after retries).
failed_queries- Station queries that failed after retries (HTTP errors other than 404 and 204, timeouts). Their stations are missing from the plan. See When the server fails.
error- Only present when the run stopped:
<ExceptionName>: <message>.
status is always the last line and sets the exit code:
| Code | status |
Meaning |
|---|---|---|
0 |
ok |
Finished. Day files the server has no data for (404) are not failures. |
1 |
error |
The run stopped, for example because no server answered a station query. |
2 |
partial |
Finished, but failed or failed_queries is not 0. |
Run again after a 1 or 2: only the missing day files are requested. See Resuming and updating archives.
Log and stats file¶
<config>.log- The log of
download, next to the configuration file (config.json→config.log), replaced on every run.-vadds debug output, including the request URLs. Read it for the details behind anerroror apartialrun. <sds_folder>/fdsn-rush-stats.json- Statistics as compact JSON, rewritten at the start, whenever a day file is finished and at the end. Poll it for progress. It is replaced atomically, so it never holds a half-written document.
{"manager":{"start_time":"2024-01-03T10:00:01Z","end_time":"2024-01-03T10:00:05Z","elapsed_seconds":4.4},"writer":{"total_files_saved":1,"total_bytes_written":1900544,"archive_size":1900544},"clients":[{"n_requests":1,"n_bytes_downloaded":1463296,"n_chunks_total":1,"n_completed":1,"n_no_data":0,"n_failed":0,"n_station_queries_failed":0,"n_stations":1,"url":"https://geofon.gfz.de/","n_stations_completed":1}]}