Skip to content

Examples

Daily workflow

# Morning: log yesterday's gauge total (example)
rainlog add 6.2

# Review last two weeks
rainlog graph --size 14

Separate data directory

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

rainlog add 3 --db-dir "$WEATHER_DB"
rainlog 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:

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

Monthly rainy-day counts

rainlog rainy-days --group monthly --size 24

WeeWX → rainlog

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

Scripting

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

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