# Cron Alpine

Cron Alpine is a lightweight Docker container that runs a BusyBox crond daemon for scheduling cron jobs. It is open source and self-hosted, installable on Unraid.

Canonical page: https://ourlocalhost.com/app/2720/cron-alpine

## Description

Cron Alpine is a lightweight Docker container that runs a BusyBox crond daemon for scheduling cron jobs. Mount a crontab file to define jobs, making it ideal for simple task automation in minimal container environments.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

41/100 (Fair), based on 4 of 4 factors.
- Maintained: 38 (last commit 349 days ago)
- Popular: 14 (4 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Light to run: 100 (128 MB minimum RAM)

## Links

- Unraid: https://ca.unraid.net/apps/cron-alpine-1d59vke1lfp92a?q=Cron---Alpine

## Common questions

### How do I provide the crontab to the container?

Create a crontab file and bind mount it into the container, for example at /crontab. The image installs the crontab file specified by CRON_SPEC_FILE as the worker user's crontab at startup.

### Why does editing the mounted crontab file not change the running schedule?

The crontab is installed only when the container starts. Changing the mounted file while the container is running does not have any effect on cron.

### How can I make helper scripts available to the cron job?

Mount the scripts in the worker home directory, which defaults to /worker and can be set with CRON_USER_HOME. The container changes their ownership at startup, or you can build a derived image that copies them in to avoid changing ownership on the host.

### How can I run commands as root before the cron daemon starts?

Mount shell scripts in the /entrypoint.pre.d directory. They are executed in alphabetical order before the cron daemon starts.

### How can I have cron job output sent by email?

Configure the SMTP_* variables and CRON_MAILTO to use msmtp. This email feature is disabled by default and is only enabled when SMTP_HOST is set.

### Can I avoid storing sensitive values in environment variables?

For supported variables, store the value in a file in the container and set the corresponding XXX_FILE variable to the file path. This is useful for docker secrets, but not every variable supports the _FILE variant.

---
Source: Our Local Host (https://ourlocalhost.com/app/2720/cron-alpine), the self-hosted and open-source app directory.
