Implemented new solution to get cron work in container

This commit is contained in:
dor_pauli 2023-04-06 18:39:18 +02:00
parent bf3e9d4080
commit 9cd4ed73f2
No known key found for this signature in database
GPG Key ID: B2F6B1E15963F107
2 changed files with 10 additions and 0 deletions

View File

@ -12,6 +12,8 @@ services:
- "ocsreportsdata:/usr/share/ocsinventory-reports/ocsreports/extensions"
- "varlibdata:/var/lib/ocsinventory-reports"
- "httpdconfdata:/etc/apache2/conf-available"
# make use of cron with crontab inside of container by mounting the specified file
# - "./crontab:/etc/cron/docker-crontab"
environment:
OCS_DB_SERVER: ocsinventory-db
OCS_DB_USER: ocsuser

View File

@ -0,0 +1,8 @@
#!/bin/bash
CRONTAB_FILE="/etc/cron/docker-crontab"
if [ -f $CRONTAB_FILE ]; then
crontab $CRONTAB_FILE
cron -n
fi