# systemd units for vreaudigital scrapers + housekeeping

These files mirror the units installed on satra at `/etc/systemd/system/vreaudigital-*.{service,timer}`. Commit the source of truth here; install on satra with `sudo cp` + `sudo systemctl daemon-reload + enable --now`.

## Currently installed on satra

| Unit | Schedule | What it does |
|---|---|---|
| `vreaudigital-anaf-daily.timer` | daily | ANAF v9 enrichment (incremental) |
| `vreaudigital-onrc-weekly.timer` | Tue 03:00 | ONRC bulk refresh |
| `vreaudigital-mvs.timer` | daily 04:00 | Refresh seap materialized views |
| `vreaudigital-heartbeat.timer` | daily 07:00 | Data-freshness probe across 20 sources |

## Install procedure

```bash
# from this repo, copy units to satra:
scp services/seap-scraper/systemd/vreaudigital-<name>.{service,timer} \
    satra:/tmp/
ssh satra "sudo cp /tmp/vreaudigital-<name>.{service,timer} /etc/systemd/system/ && \
           sudo systemctl daemon-reload && \
           sudo systemctl enable --now vreaudigital-<name>.timer"
```

## Inspect

```bash
ssh satra "systemctl status vreaudigital-<name>.timer --no-pager"
ssh satra "journalctl -u vreaudigital-<name>.service --since today --no-pager"
```

## Manual test (without timer)

```bash
ssh satra "sudo systemctl start vreaudigital-<name>.service"
```
