Sign in

Universal mod

cron

This mod adds cron to any container, to be installed/updated during container start.

arch
amd64
built

Use it#

Set DOCKER_MODS on any LinuxServer.io container and recreate it. The mod is pulled on every start; several mods are separated with |.

DOCKER_MODS=ghcr.io/linuxserver-playground/mods:universal-cron

:universal-cron always gets the newest build. To stay on this one, pin its tag:

DOCKER_MODS=ghcr.io/linuxserver-playground/mods:universal-cron-99dd33c
services:
  sonarr:
    image: ghcr.io/linuxserver-playground/sonarr:latest
    environment:
      - DOCKER_MODS=ghcr.io/linuxserver-playground/mods:universal-cron

Details#

This mod will ensure you have /config/crontabs/root and /config/crontabs/abc files where you can add cron jobs to run inside the container as root or as the abc user (associated with the PUID/PGID environment variables).

No cron jobs (aside from what may be included in the base OS) are included by default.

You can test to confirm things are working by adding the following line to /config/crontabs/root or /config/crontabs/abc

*/5 * * * *    /bin/echo test >> /config/tmp.txt

Then restart the container and wait 5 minutes to see that the test completes. Remove the test and restart the container after confirming.

Community project

Improve this mod, or make your own

Mods are how LinuxServer images grow without getting heavier: a Dockerfile, a few scripts and a mod.yml. If this one is missing something, or you need one like it for another image, an AI agent in our harness can build and test it with you.

Ask your agent

  • The universal-cron mod <what is wrong>. Fix it, test it and draft the PR.
  • Make a mod like universal-cron for <another image>, and test it.

Making a mod Every way to help Get the harness (opens in a new tab)

Source: universal-cron branch (opens in a new tab). Every mod