added dcrond for data replication

This commit is contained in:
asohh 2025-10-12 13:06:49 +02:00
commit fdd2862d5f
2 changed files with 34 additions and 1 deletions

29
utils/entrypoint.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
set -e
####################################################################################################
### Crontab settings
####################################################################################################
cat<<EOF | dcrontab -
# min hour day month weekday command
5 * * * * sh /opt/update_camera.sh
EOF
####################################################################################################
### Run prescripts
####################################################################################################
php /opt/init_db.php
#TODO add db_migrations
echo "Prescripts done"
####################################################################################################
### Run cmd
####################################################################################################
# see: https://github.com/dubiousjim/dcron/issues/13
# ignore using `exec` for `dcron` to get another pid instead of `1`
# exec "$@"
"$@"