Fix CRON task
This commit is contained in:
+2
-2
@@ -124,10 +124,10 @@ Lancer le conteneur sans argument exécute seulement la commande par défaut `pv
|
|||||||
Exemple de crontab côté hôte pour lancer le rapport tous les jours à 02:00 :
|
Exemple de crontab côté hôte pour lancer le rapport tous les jours à 02:00 :
|
||||||
|
|
||||||
```cron
|
```cron
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/bash
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
0 2 * * * cd /srv/pve-backup-report && /usr/bin/flock -n /tmp/pve-backup-report.lock /usr/bin/docker compose run --rm pve-backup-report --generate-pdf >> /var/log/pve-backup-report.log 2>&1
|
0 7 * * * root cd /srv/pve-backup-report && /usr/bin/flock -n /tmp/pve-backup-report.lock /usr/bin/docker compose run --rm -T pve-backup-report --generate-pdf >> /var/log/pve-backup-report.log 2>&1
|
||||||
```
|
```
|
||||||
|
|
||||||
Adapter `/srv/pve-backup-report` au chemin réel du dépôt. Le `cd` est important : Docker Compose y trouve `compose.yaml` et l'application y charge `.env`.
|
Adapter `/srv/pve-backup-report` au chemin réel du dépôt. Le `cd` est important : Docker Compose y trouve `compose.yaml` et l'application y charge `.env`.
|
||||||
|
|||||||
@@ -124,10 +124,10 @@ Running the container without arguments only executes the default `pve-backup-re
|
|||||||
Example crontab on the host to run the report every day at 02:00:
|
Example crontab on the host to run the report every day at 02:00:
|
||||||
|
|
||||||
```cron
|
```cron
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/bash
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
0 2 * * * cd /srv/pve-backup-report && /usr/bin/flock -n /tmp/pve-backup-report.lock /usr/bin/docker compose run --rm pve-backup-report --generate-pdf >> /var/log/pve-backup-report.log 2>&1
|
0 7 * * * root cd /srv/pve-backup-report && /usr/bin/flock -n /tmp/pve-backup-report.lock /usr/bin/docker compose run --rm -T pve-backup-report --generate-pdf >> /var/log/pve-backup-report.log 2>&1
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `/srv/pve-backup-report` with the actual path to the repository. The `cd` is important: Docker Compose finds `compose.yaml` there and the application loads `.env` from it.
|
Replace `/srv/pve-backup-report` with the actual path to the repository. The `cd` is important: Docker Compose finds `compose.yaml` there and the application loads `.env` from it.
|
||||||
|
|||||||
Reference in New Issue
Block a user