Skip to content

Commit

Permalink
cron bug
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelscl committed Mar 15, 2021
1 parent acdab78 commit 73e847e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- conf:/var/nedi/conf
hostname: 'nedi'
environment:
CRON: "0 * * * *"
CRON: "*/5 * * * *"
networks:
- lan
db:
Expand Down
2 changes: 1 addition & 1 deletion nedi-run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sudo docker exec -it nedi_app_1 /var/nedi/nedi.pl -por 3
sudo docker exec -it -u www-data nedi_app_1 /var/nedi/nedi.pl -por 3
15 changes: 5 additions & 10 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@ service nginx restart

#######
# CRON
echo "Set crontab ..."
if [ -z "${CRON}" ];
if [ ! -z "${CRON}" ];
then
echo "CRON not set"
echo "Setting default CRON: NEDI starts every hour in 15min"
CRON="15 * * * *"
else
echo "Setting default CRON: ${CRON}"
echo "Set crontab ${CRON} ..."
echo "${CRON} www-data /var/nedi/nedi.pl -por 3" > /etc/cron.d/nedi
echo "Restart crontab ..."
service cron restart
fi
echo "${CRON} www-data /var/nedi/nedi.pl -por" > /etc/cron.d/nedi
echo "Restart crontab ..."
service cron restart

#
echo "Waiting 20 sec while SQL starts ...."
Expand Down

0 comments on commit 73e847e

Please sign in to comment.