Skip to content

Commit eb2d7be

Browse files
joshheinrichsgitster
authored andcommitted
maintenance: fix launchctl calendar intervals
When using the launchctl scheduler, the weekly job runs daily, and the daily job runs on the first six days of each month. This appears to be due to specifying "Day" in the calendar intervals, which according to launchd.plist(5) is for specifying days of the month rather than days of the week. The behaviour of running a job on the 0th day is undocumented, but in my testing appears to be the same as not specifying "Day" in the calendar interval, in which case the job will run daily. Use "Weekday" in the calendar intervals, which is the correct way to schedule jobs to run on specific days of the week. Signed-off-by: Josh Heinrichs <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f93ff17 commit eb2d7be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit
20612061

20622062
case SCHEDULE_DAILY:
20632063
repeat = "<dict>\n"
2064-
"<key>Day</key><integer>%d</integer>\n"
2064+
"<key>Weekday</key><integer>%d</integer>\n"
20652065
"<key>Hour</key><integer>0</integer>\n"
20662066
"<key>Minute</key><integer>%d</integer>\n"
20672067
"</dict>\n";
@@ -2072,7 +2072,7 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit
20722072
case SCHEDULE_WEEKLY:
20732073
strbuf_addf(&plist,
20742074
"<dict>\n"
2075-
"<key>Day</key><integer>0</integer>\n"
2075+
"<key>Weekday</key><integer>0</integer>\n"
20762076
"<key>Hour</key><integer>0</integer>\n"
20772077
"<key>Minute</key><integer>%d</integer>\n"
20782078
"</dict>\n",

0 commit comments

Comments
 (0)