Bug 87859

Summary: systemd.time documentation: 'day of month' vs 'day of week'
Product: systemd Reporter: Thomas <fischer>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: trivial    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.