[systemd-devel] Feature request: schedule jobs for last day of month

David Strauss david at davidstrauss.net
Tue Feb 5 11:54:24 PST 2013


Repeating myself, but I'll say it again: I strongly prefer a feature
set that is a subset of iCal/xCal [1]. I'd like it to be possible in
the future to expose existing and future runs via CalDAV over
something like the gateway.

iCal already supports "last day of month schedules":

FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=-1

Maybe we should make it more systemd-ish in how we specify everything,
but it's all there. Developers have given the administrative
requirements of recurring events decades of thought and mostly arrived
at iCal, and Apple, Google, and other calendar implementers have
standardized on it. There are also FOSS libraries for computing
recurrence times in the iCal format [2]. libical has friendly
licensing, uses GNU Autotools, returns cleanly on memory allocation
errors, is actively maintained (frequent commits), is broadly used in
production services, includes pkg-config data for easy linking, and
comes packaged in major distributions like Fedora.

If we actually did use iCal-style recurrence rules directly, it would
be easy to compute the concrete times (example modified from libical's
icalrecur.h):

   icalrecur_iterator* ritr;
   struct icaltimetype next;
   recur = icalrecurrencetype_from_string("FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=-1");
   dtstart = icaltime_from_string("20130205T123000")
   ritr = icalrecur_iterator_new(recur,start);
   while (next = icalrecur_iterator_next(ritr) && !icaltime_is_null_time(next) {
                // Do something with next
   }

[1] http://www.kanzaki.com/docs/ical/rrule.html
[2] http://www.citadel.org/doku.php/documentation:featured_projects:libical


More information about the systemd-devel mailing list