diff --git a/builtin/gc.c b/builtin/gc.c
index 286ce131a5..78924bb32c 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1995,6 +1995,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
const char *frequency = get_frequency(schedule);
char *name = schtasks_task_name(frequency);
struct strbuf tfilename = STRBUF_INIT;
+ int minute = get_random_minute();
get_schedule_cmd(&cmd, NULL);
@@ -2015,7 +2016,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
switch (schedule) {
case SCHEDULE_HOURLY:
fprintf(tfile->fp,
- "2020-01-01T01:00:00\n"
+ "2020-01-01T01:%02d:00\n"
"true\n"
"\n"
"1\n"
@@ -2024,12 +2025,13 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
"PT1H\n"
"PT23H\n"
"false\n"
- "\n");
+ "\n",
+ minute);
break;
case SCHEDULE_DAILY:
fprintf(tfile->fp,
- "2020-01-01T00:00:00\n"
+ "2020-01-01T00:%02d:00\n"
"true\n"
"\n"
"\n"
@@ -2041,19 +2043,21 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
"\n"
"\n"
"1\n"
- "\n");
+ "\n",
+ minute);
break;
case SCHEDULE_WEEKLY:
fprintf(tfile->fp,
- "2020-01-01T00:00:00\n"
+ "2020-01-01T00:%02d:00\n"
"true\n"
"\n"
"\n"
"\n"
"\n"
"1\n"
- "\n");
+ "\n",
+ minute);
break;
default: