Skip to content

Examples

Daily workflow

# Morning: log yesterday’s gauge total (example)
rain add 6.2

# Review last two weeks
rain graph --size 14

Separate data directory

export WEATHER_DB="$HOME/weather-data"
mkdir -p "$WEATHER_DB"

rain add 3 --db-dir "$WEATHER_DB"
rain graph --db-dir "$WEATHER_DB" --size 30 --group weekly

Back-fill dry days

If you record a late total and want earlier missing days explicitly stored as zero until the previous existing record:

rain add 15 --date 2025-05-15 --back-fill --db-dir "$WEATHER_DB"

Monthly rainy-day counts

rain rainy-days --group monthly --size 24

WeeWX → weather-tools

rain weewx-import --weewx-db ./weewx.sdb --db-dir ./imported
rain graph --db-dir ./imported --size 60

Scripting

if rain --version >/dev/null 2>&1; then
  rain add "$(python3 -c 'import random; print(round(random.uniform(0,15), 1))')"
fi

(Prefer real gauge data — this is only an illustration of calling rain from a shell script.)