From 23b5be713f79a8f98b89abacb8d082f219f9b084 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Thu, 4 Sep 2025 01:23:06 -0700 Subject: [PATCH] docs(docker): Document image environment footgun From [PR feedback](https://github.com/jmbannon/ytdl-sub/pull/1321#discussion_r2320515419). --- .../guides/getting_started/automating.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/source/guides/getting_started/automating.rst b/docs/source/guides/getting_started/automating.rst index 791a615e..5c36ffd0 100644 --- a/docs/source/guides/getting_started/automating.rst +++ b/docs/source/guides/getting_started/automating.rst @@ -32,6 +32,24 @@ The container cron wrapper script will write output from the cron job to ...`` that file so you can monitor the cron job in the container's output and thus also in the Docker logs. +You may also set the ``CRON_RUN_ON_START`` environment variable to ``true`` to have the +image run your cron script whenever the container starts in addition to the cron +schedule. + +.. warning:: + + Using ``CRON_RUN_ON_START`` is not recommended because it may cause your cron script + to run too often and may trigger throttles and bans. When enabled, your cron script + will run *whenever* the container starts including when the host reboots, when ``# + dockerd`` is upgraded, when a new image is pulled, when something applies Compose + changes, etc.. This may result in running ``ytdl-sub`` right before or after the next + cron scheduled run or even at the same time on top of each other. Instead, run your + cron script manually inside the running container as needed: + + .. code-block:: console + + docker compose exec ytdl-sub bash /config/ytdl-sub-configs/cron + .. _linux-setup: