Go to file
2015-07-24 16:14:26 +03:00
man compile man files 2015-07-22 15:42:36 +03:00
pkg remove deprecated files 2015-07-22 15:42:36 +03:00
src crontab: add newline to basic template 2015-07-24 15:08:48 +03:00
units remove persistent from unit templates if necessary 2015-07-24 12:29:09 +03:00
.gitignore add new pkgbuild file 2015-07-06 01:31:09 +03:00
.travis.yml travis file 2015-07-24 16:06:40 +03:00
build.rs add missing path separator into config 2015-07-24 12:29:09 +03:00
Cargo.lock update deps, rename project 2015-07-24 16:14:26 +03:00
Cargo.toml update deps, rename project 2015-07-24 16:14:26 +03:00
Makefile suid bit for crontab 2015-07-21 13:00:43 +03:00
README.md rename project 2015-07-24 15:31:35 +03:00

systemd-cron-next

What's it?

This is a compatibility layer for crontab-to-systemd timers framework. It works by parsing crontab and anacrontab files from usual places like /etc/crontab and /var/spool/cron and generating systemd timers and services. You can use cron.target as a single control point for the generated units.

It's intented to be drop-in replacement for all cron implementations.

Rationale

The crontab generator for systemd (implemented in C) was already published on maillist, but was later declined by Lennart:

I am not convinced this is a really good idea. From my perspective at least it appears that we should much rather just convert the crontabs and that's it. Unlike sysv init scripts the number of crontab in use (at least on Fedora) is relatively small, and very rare in third-party packages.

Lennart

While I'm generally agree with him, I'm not totally convinced it's always convenient to herd a bunch of separate *.timer and *.service files. I find convenient to have all jobs schedule in one single file, and it's more obvious to see relations in jobs scheduling if you have several jobs on sight at once.

All things considered, I think people should have an alternative here, so I decided to support the idea of systemd crontab generator. Though the original C implementation of crontab parser from maillist is very incomplete: it doesn't support monotonic schedules (like @daily or @yearly), it can't parse comments and environment variable settings, etc.

Hence I decided to create systemd-crontab-generator.

History

I'm not very good in C, so C implementation (while it's recommended for generators) whould take me ages to write, so at first I used Python for proof-of-concept implementation. Then my small home project was noticed by @systemd-cron project and eventually was merged into it and evolved thanks to Alexanre Detiste, Dwayne Bent and others.

Still I beared in mind the image of the project's future: rewrite it in systems language. Python, being VM-based scripting language is not the best choice for system service: it's slow (the slowest systemd generator ever, actually), have problems with multithreading, requires a lot of hacks like setgid/setuid C helper to implement crontab, etc.

Meanwhile the Rust systems language, I liked very much from the very beginning, reached its 1.0, so I decided to grab the moment and rewrite everything in Rust.

The current version you are starring at is meant to be a successor of @systemd-cron project, fully rewritten in Rust from ground up, while preserving experience, systemd unit templates and main algorithms and solutions polished in Python version by @systemd-cron team.

Installation

If you are on Archlinux, install from AUR, otherwise see PKGBUILD file and execute commands from package() sub.

Usage

The generator runs on system boot and when the crontabs change.

The project includes simple crontab command equivalent, which behaves like standard crontab command (and accepts the same main options).

To control cron jobs, use cron.target, e.g. to start and enable cron after installation:

# systemctl enable cron.target
# systemctl start cron.target

Disclaimer

This is a beta product! Use at your own risk! I'm not responsible for any data losses, time losses, money losses or any other failures due to use or misuse of this project! I've run this product on my local server for several months without issues, but it does not mean you will have no issues as well! Don't blame me for any crashes because of the product! You were warned!

License

The main part of a project is licensed under MIT. Crontab man page is derived from Vixie Cron and licensed under Paul-Vixie's-license. Don't forget to attribute if you derive from the work!

Contribution

You are most welcome to post bugs and PRs! Also check out comments in AUR for current news about Arch package status.

Original @systemd-cron project:

  • © 2013 Dwayne Bent
  • © 2013 Dominik Peteler
  • © 2014 Daniel Schaal farbing@web.de

Systemd crontab generator evolution, tooling and support:

Original systemd crontab generator code in Python, Rust version:

Crontab man-page (man/crontab.5.in):

Debian packaging: