feat: schedule with busybox crond instead of supercronic #3

Merged
trex Bot merged 1 commits from feat/crond-scheduler into main 2026-11-24 22:24:36 -06:00

Same scheduler qbit-maid uses: entrypoint.sh writes the crontab and execs crond -f. Drops the supercronic package from the image.

  • crontab lives in /tmp/crontabs because the rootfs is read-only
  • MAILTO= keeps job output on crond stdout/stderr (container log) — what supercronic -passthrough-logs provided
  • busybox crond only loads crontab files owned by uid 0 and calls initgroups() per job, so the container needs root + CAP_SETGID; the entrypoint now fails fast (exit 78) when it is not root
  • no @reboot job: a container restart must not start a backup

Verified locally: built the image, ran it with CRON=* * * * * under --read-only --tmpfs /tmp -u 0:0 --cap-drop ALL --cap-add DAC_OVERRIDE --cap-add SETGID; the job fired on the minute, its output reached docker logs, and the log file was written. Without SETGID the job is forked and dies with crond: can't set groups: Operation not permitted.

Same scheduler qbit-maid uses: `entrypoint.sh` writes the crontab and execs `crond -f`. Drops the `supercronic` package from the image. - crontab lives in `/tmp/crontabs` because the rootfs is read-only - `MAILTO=` keeps job output on crond stdout/stderr (container log) — what `supercronic -passthrough-logs` provided - busybox crond only loads crontab files owned by uid 0 and calls `initgroups()` per job, so the container needs root + `CAP_SETGID`; the entrypoint now fails fast (exit 78) when it is not root - no `@reboot` job: a container restart must not start a backup Verified locally: built the image, ran it with `CRON=* * * * *` under `--read-only --tmpfs /tmp -u 0:0 --cap-drop ALL --cap-add DAC_OVERRIDE --cap-add SETGID`; the job fired on the minute, its output reached `docker logs`, and the log file was written. Without `SETGID` the job is forked and dies with `crond: can't set groups: Operation not permitted`.
trex Bot added 1 commit 2026-11-24 22:24:33 -06:00
Same scheduler qbit-maid uses: entrypoint.sh writes the crontab and execs
crond -f. Drops the supercronic package from the image.

- crontab lives in /tmp/crontabs because the rootfs is read-only
- MAILTO= keeps job output on crond's stdout/stderr (container log), which
  is what supercronic -passthrough-logs provided
- busybox crond only loads crontab files owned by uid 0 and calls
  initgroups() per job, so the container needs root + CAP_SETGID; the
  entrypoint now fails fast (exit 78) when it is not root
- no @reboot job: a container restart must not start a backup
trex Bot merged commit cbf0cbd963 into main 2026-11-24 22:24:36 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jblu/seafile-backup#3