docs: update cron setup for multi-site structure
Both README.md and BEDIENUNGSANLEITUNG.md now show the correct cron entries using --config <site>/config.yaml, one entry per site with staggered start times (03:00 / 03:15). Added "Neue Website hinzufügen" step-by-step guide and updated log-rotation path to */logs/*.log (covers all sites). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ab882f912e
commit
2f985c8d59
2 changed files with 56 additions and 13 deletions
|
|
@ -155,16 +155,20 @@ Ergebnis erscheint direkt im Terminal. Der vollständige Report liegt in `report
|
|||
### Automatischer Scan (Cron)
|
||||
|
||||
```bash
|
||||
# Cron-Eintrag hinzufügen
|
||||
crontab -e
|
||||
```
|
||||
|
||||
Eintrag:
|
||||
Je eine Zeile pro überwachter Website einfügen (mit leichtem Zeitversatz):
|
||||
```cron
|
||||
# Website-Scan täglich um 03:00 Uhr
|
||||
0 3 * * * cd /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten && /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten/venv/bin/python -m scanner scan >> logs/cron.log 2>&1
|
||||
# bredelar.info — täglich 03:00 Uhr
|
||||
0 3 * * * cd /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten && python -m scanner --config bredelar.info/config.yaml scan >> bredelar.info/logs/cron.log 2>&1
|
||||
|
||||
# jamulix.de — täglich 03:15 Uhr
|
||||
15 3 * * * cd /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten && python -m scanner --config jamulix.de/config.yaml scan >> jamulix.de/logs/cron.log 2>&1
|
||||
```
|
||||
|
||||
Danach prüfen: `crontab -l`
|
||||
|
||||
Der Exit-Code (0/1/2) ist für Cron-basierte Alarmierung nutzbar (z.B. mit `cronitor` oder
|
||||
systemd-Timern mit `OnFailure=`).
|
||||
|
||||
|
|
@ -334,29 +338,47 @@ Der Score ist ≥ 60. Typische Auslöser: neue externe Domain (50 Pkt.) + Hidden
|
|||
|
||||
## 10. Automatisierung per Cron-Job
|
||||
|
||||
### Cron-Eintrag
|
||||
### Cron-Einträge einrichten
|
||||
|
||||
```bash
|
||||
crontab -e
|
||||
```
|
||||
|
||||
Je eine Zeile pro überwachter Website einfügen — mit leichtem Zeitversatz,
|
||||
damit die Scans nicht gleichzeitig laufen:
|
||||
|
||||
```cron
|
||||
# Website-Scan täglich um 03:00 Uhr
|
||||
0 3 * * * cd /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten && /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten/venv/bin/python -m scanner scan >> logs/cron.log 2>&1
|
||||
# bredelar.info — täglich 03:00 Uhr
|
||||
0 3 * * * cd /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten && python -m scanner --config bredelar.info/config.yaml scan >> bredelar.info/logs/cron.log 2>&1
|
||||
|
||||
# jamulix.de — täglich 03:15 Uhr
|
||||
15 3 * * * cd /home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten && python -m scanner --config jamulix.de/config.yaml scan >> jamulix.de/logs/cron.log 2>&1
|
||||
```
|
||||
|
||||
Danach prüfen ob die Einträge gespeichert wurden:
|
||||
```bash
|
||||
crontab -l
|
||||
```
|
||||
|
||||
**Neue Website hinzufügen:**
|
||||
1. Verzeichnis anlegen: `mkdir neue-seite.de`
|
||||
2. Config kopieren: `cp bredelar.info/config.yaml neue-seite.de/config.yaml`
|
||||
3. In der neuen config.yaml `target` und alle 4 Pfade (`data_dir`, `reports_dir`, `logs_dir`, `config_dir`) anpassen
|
||||
4. Erste Prüfung: `python -m scanner --config neue-seite.de/config.yaml init`
|
||||
5. Weiteren Cron-Eintrag ergänzen (z.B. 03:30 Uhr)
|
||||
|
||||
### Log prüfen
|
||||
|
||||
```bash
|
||||
tail -50 logs/cron.log
|
||||
tail -f logs/scanner.log # detaillierteres Log des Scanners selbst
|
||||
tail -50 bredelar.info/logs/cron.log
|
||||
tail -50 jamulix.de/logs/cron.log
|
||||
```
|
||||
|
||||
### Log-Rotation (optional)
|
||||
|
||||
Datei `/etc/logrotate.d/integrity-scanner`:
|
||||
```
|
||||
/home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten/logs/*.log {
|
||||
/home/dschlueter/Python_Programs/integrity_scanner_fuer_statische_Webseiten/*/logs/*.log {
|
||||
daily
|
||||
rotate 30
|
||||
compress
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue