Raspberry Pi 3 Docker cron jobs

Hallo,

I’m not a Docker user, I don’t know the subject at all. I hope that my question contains enough information to solve my problem!

I want to create cron jobs on a Raspberry Pi 3 to start a Docker container. This container is the one I would like to start and stop every 12 hours. Here is the container I want to use:
https://docs.datarhei.com/restreamer/installing/raspberry-pi-arm#:~:text=Start%20with%20hardware%20support%20for%20arm32v7
I want to achieve this so that the stream starts and stops every 12 hours, as YouTube has a maximum livestream recording duration of 12 hours!

Hi,

You need to use cron to both start and stop, so have a cron run the docker run … at (fx.) “0 0 * * *” and then since the docker run command specifies a hostname, you can setup another cron to stop: “0 12 * * *” with command “docker stop core”