You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to make sure that the crond process is always running in my container.
I can exec into the running container and just run it in the background by executing crond but if I stop and start the container the process would be gone.
Is there any convenient way so that I could run my cron jobs inside my container?
Someone on stackoverflow suggested me to install the extension pg_cron. But all my problems would be gone if I can make sure that crond is always running.
The text was updated successfully, but these errors were encountered:
I'd agree that pg_cron is the best option if you want the jobs to run in your PostgreSQL container.
Another OK option would be to run the jobs via cron on your host using docker exec.
If you must run crond inside a container, I'd recommend instead using a separate container which runs nothing but crond (and thus Docker can both track its lifecycle, and restart it when/if it fails, the machine restarts, etc). You should be able to connect to the PostgreSQL instance from a second container, but if absolutely necessary, one could use things like --network container:some-postgres in order to join the network namespace of the database container directly.
Hi,
I try to make sure that the
crond
process is always running in my container.I can
exec
into the running container and just run it in the background by executingcrond
but if I stop and start the container the process would be gone.Is there any convenient way so that I could run my cron jobs inside my container?
Someone on stackoverflow suggested me to install the extension
pg_cron
. But all my problems would be gone if I can make sure thatcrond
is always running.The text was updated successfully, but these errors were encountered: