Bug 87859 - systemd.time documentation: 'day of month' vs 'day of week'
Summary: systemd.time documentation: 'day of month' vs 'day of week'
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium trivial
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-30 09:24 UTC by Thomas
Modified: 2015-01-01 14:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Thomas 2014-12-30 09:24:01 UTC
The traditional cron's manpage crontab(5) discusses the issue that one can specify the day of a calendar event with two different fields: day of month and day of week.

The same is true for systemd.time, where one could write
Mon,Fri *-*-3,1,2 *:30:45

Following cron's interpretation, this would mean the calendar event is trigger on the first three days of a month *and* on every Monday or Friday. Does the same hold for systemd.time? The documentation (man page) should specify this explicitly.
Comment 1 Chris Atkinson 2015-01-01 00:50:59 UTC
I do not believe that is how systemd.time works. As is noted in the man page:

"Calendar events may be used to refer to one or more points in time in a single expression. They form a superset of the absolute timestamps explained above:

           Thu,Fri 2012-*-1,5 11:12:13

The above refers to 11:12:13 of the first or fifth day of any month of the year
2012, given that it is a Thursday or Friday."

I read this as saying that only days which are both Thurs/Fri AND 1/5 would be included. I tested this by creating a timer which included "OnCalendar=Thu,Fri 2015-*-5 11:12:13". I then started it on Thur 2014-12-31 and ran "systemctl list-timers", which showed the service would run on Thur 2015-02-05, the next day which is the fifth calendar day of a month and a Thursday.
Comment 2 Zbigniew Jedrzejewski-Szmek 2015-01-01 14:10:04 UTC
Documentation updated in http://cgit.freedesktop.org/systemd/systemd/commit/?id=a780d4cb1c. This should clear up the issue.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.