You are not logged in.

#1 2013-05-27 21:06:58

dbb
Member
From: New York City
Registered: 2008-12-14
Posts: 30
Website

systemd-cron: minimal cron replacement with systemd

systemd-cron

systemd-cron is a set of systemd unit files that take advantage of systemd's timer units and calendar events to execute scripts in the standard cron.hourly, cron.daily, cron.weekly, and cron.monthly directories. For simple setups where this is all you need, this allows you to not have to run a cron daemon. Of course this also means it is not a drop-in replacement for a traditional cron daemon and you will not get support for:

  • crontab files

  • per-user jobs

  • executing missed jobs

  • emailing job output

  • et cetera

To use, stop and uninstall any existing cron daemon and install the AUR package. Then as root run:

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

Please note the .target suffix.

More details are available with:

$ man systemd.cron

I have been using it successfully on my servers for a week now with no troubles.

Offline

#2 2013-05-28 19:56:06

nbvcxz
Member
From: Poland
Registered: 2007-12-29
Posts: 192

Re: systemd-cron: minimal cron replacement with systemd

Haven't tested jet but really nice idea - thumbs up. Any possibilities to make per user jobs in the future?


Lenovo G50 | LXQT-git | compton | conky

Offline

#3 2013-05-28 21:09:13

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: systemd-cron: minimal cron replacement with systemd

nbvcxz wrote:

Any possibilities to make per user jobs in the future?

It occurs to me that you could set up user targets / service files similar to the system ones that can be run during a systemd user session, similarly to what xorg-launch-helper does.  These can look for files / scripts to run in $HOME/.config/systemd/cron.hourly/ and such to run.


To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

#4 2013-05-29 00:06:35

dbb
Member
From: New York City
Registered: 2008-12-14
Posts: 30
Website

Re: systemd-cron: minimal cron replacement with systemd

nbvcxz wrote:

Haven't tested jet but really nice idea - thumbs up. Any possibilities to make per user jobs in the future?

That would probably be the next thing I do. As Morrad described above it should be pretty natural with systemd user sessions. After that probably crontab support using generators.

Offline

#5 2013-05-29 04:45:24

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: systemd-cron: minimal cron replacement with systemd

dbb wrote:

... crontab support using generators.

This is interesting.  I hadn't seen this before.  Thanks for pointing it out.


To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

Board footer

Powered by FluxBB