Files
0012/todo/05-plesk-cron.md
T
Frank Schwenk 226bbe1bf7 docs: mark Plesk cron todo done; optional heartbeat backlog
Record live monitor.php cron config in HOSTING.md and close todo 05.
Move optional */5 heartbeat task to todo/13.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 14:56:47 +02:00

63 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 05 — Plesk Cron (Geplante Aufgaben)
**Priorität:** high
**Status:** erledigt (2026-06-12)
**Abhängigkeiten:** 01, 03 (Skript muss existieren)
**Referenz:** Plesk → Websites & Domains → Geplante Aufgaben
## Ziel
Monitoring automatisch alle 5–10 Minuten ausführen.
## Checkliste
- [x] Aufgabe anlegen: **PHP-Skript ausführen**
- [x] Skriptpfad: `httpdocs/monitor.php` (Pfad nach Deployment verifizieren)
- [x] PHP-Version: höchste stabile (z. B. 8.5.x)
- [x] **Aktiv** angehakt
- [x] Ausführen: **Cron-Stil**
- [x] Expression: `*/10 * * * *` (Pull-Checks alle 10 Min)
- [x] Beschreibung: z. B. „0012 external monitoring pull“
- [x] Benachrichtigen: **Nur Fehler** (siehe unten)
- [x] **Jetzt ausführen** — Exit-Code / Log prüfen
Optional zweite Aufgabe für Heartbeat-only (`*/5`): ausgelagert nach [`13-optional-plesk-cron-heartbeat.md`](13-optional-plesk-cron-heartbeat.md) — nicht nötig, Stale-Check läuft im gleichen `monitor.php`-Lauf.
## Benachrichtigen: „Nur Fehler“
Erst beim Anlegen der geplanten Aufgabe in Plesk relevant (zusammen mit `monitor.php`).
| Option | Bedeutung |
|--------|-----------|
| **Nicht benachrichtigen** | Cron läuft still; Crash fällt nicht auf |
| **Nur Fehler** | Plesk mailt nur bei Skript-Fehler (PHP-Fatal, Exit ≠ 0, stderr) |
| **Jedes Mal** | Mail bei jeder Ausführung — bei `*/10` unbrauchbar |
**Empfehlung: „Nur Fehler“** — meldet, wenn `monitor.php` auf 0012.de selbst kaputt ist.
**Getrennt von Monitoring-Alerts:** Ausfall von `schwenk.online` kommt aus `sendAlert()` → `ALERT_EMAIL`. Plesk-Cron-Mail betrifft nur die Cron-Ausführung auf dem Webspace.
## Cron-Referenz
```
*/10 * * * * monitor.php (HTTPS/SSL + stale push check)
```
Plesk nutzt System-Timezone des Servers.
## Akzeptanzkriterien
- [x] Aufgabe läuft scheduled ohne manuellen Klick (Access-Log: `curl/8.20.0` → `GET /monitor.php`)
- [x] `data/last-checks.json` Timestamp bewegt sich (verifiziert in Todo 03)
## Notizen
- Lauf im Access-Log als HTTP-GET sichtbar (Plesk ruft URL per curl auf). Follow-up: CLI + Token — [`12-monitor-php-token-check.md`](12-monitor-php-token-check.md)
- Ist-Konfiguration dokumentiert in [`../HOSTING.md`](../HOSTING.md#geplante-aufgaben-cron)
## Fehlerbehebung
- Skriptpfad relativ zu Domain-Root in Plesk
- `max_execution_time` bei vielen URLs erhöhen
- Bei Timeout: URLs batching oder Interval vergrößern