/var/log/syslog | grep test
Sep 16 12:45:01 debian CRON[16802]: (root) CMD (docker exec -it test-scripts python /app/cron.py)
Sep 16 12:46:01 debian CRON[16955]: (root) CMD (docker exec -it test-scripts python /app/cron.py)
Sep 16 12:47:01 debian CRON[17136]: (root) CMD (docker exec -it test-scripts python /app/cron.py)
cron.py inserts a record in db this is the only task it does, In logs it seems like it runs but nothing inserted into my db
When I run this command it works:
docker exec -it test-scripts python /app/cron.py
command in crontab usually require full path, eg. /bin/docker unless you configure PATH command before the application command itself
and why you need to run the cron every minute?
It's just for test to find out what's the problem otherwise I have to wait an hour to see the result 😅
what is the error message?
No error this is the last log Sep 16 13:06:01 debian CRON[20310]: (root) CMD (/bin/docker exec -it test-scripts python /app/cron.py)
are you sure docker is in /bin?
this command works in command line: /bin/docker exec -it test-scripts python /app/cron.py
when you say works, what is the output?
A record inserted in mongodb
I did it `/bin/docker exec -it test-scripts python /app/cron.py`
that's not the output of whereis docker
root@d5276e1aaf26:/app# whereis docker docker:
why you are running the whereis command inside the container?
sorry my mistake root@debian:~# whereis docker docker: /usr/bin/docker /etc/docker /usr/libexec/docker /usr/share/man/man1/docker.1.gz
Обсуждают сегодня