SYSTEMD-CRONTAB-GENERATOR(8)

πŸ’… SYSTEMD-CRONTAB-GENERATOR(8) β€” System Manager's Manual

okay bestie, sit down, hydrate, and let me tell you about systemd-crontab-generator πŸŽ€ it lives in section 8 of the System Manager's Manual and it is literally the translator of the cron world.


✨ NAME ✨

systemd-crontab-generator β€” translate cron schedules in systemd Units


🌸 SYNOPSIS 🌸

/usr/lib/systemd/system-generators/systemd-crontab-generator output-dir

πŸ¦‹ DESCRIPTION πŸ¦‹

So systemd-crontab-generator is a systemd.generator(7), and what it does β€” no cap β€” is translate the classic cron "FILES" into native systemd.timer(5)/systemd.service(5) pairs. iconic behaviour, honestly πŸ’–

It runs automatically, all on its own, like the independent main character it is:

  • during early boot,
  • a second time by cron-after-var.service if /var is a separate mount-point, so it can process user crontabs in /var/spool/cron/crontabs,
  • after each update to /etc/crontab† and /etc/anacrontab†, and
  • when packages add files under /etc/cron.d†

(†: monitored by cron-update.path β€” that's the little watchful angel keeping an eye on things 🧚)


πŸŽ€ FILES πŸŽ€

  • /etc/crontab β€” the Administrator's system crontab, see crontab(5).
  • /etc/cron.d β€” System crontabs managed by packages live here.
  • /etc/anacrontab β€” anacrontab(5)
  • /var/spool/cron/crontabs β€” Users' crontabs live here.
  • /run/systemd/generator β€” Automatically generated units go here.
  • /run/crond.reboot β€” If this file exists, @reboot jobs aren't re-generated. Managed automatically.
  • /var/lib/systemd/timers β€” systemd.timer(5)s with the Persistent flag set store their timestamps here.

πŸ”₯ DIAGNOSTICS πŸ”₯

systemctl list-timers shows an overview of current timers and when they'll elapse. lowkey the best way to vibe check your timers πŸ‘‘

If you see something to the effect of

/usr/lib/systemd/system-generators/systemd-crontab-generator
failed with error code 1.

in the journal, you can run

/usr/lib/systemd/system-generators/systemd-crontab-generator /tmp/test

for more verbose output. it's giving detective work, and we love that for you πŸ•΅οΈπŸ’…

bestie the journal message means something went sideways β€” don't panic, just run the thing manually with /tmp/test as the argument and it'll spill all the tea.

🌈 SEE ALSO 🌈

crontab(5), systemd.timer(5), systemd.unit(5), systemd.cron(7)


and that's the whole page, periodt 🫢 this was systemd-cron version 2.8.2-1, dated 2023-08-13 β€” go forth and schedule responsibly, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from