From c99277ddf62e641e71e44f46c0dc3d4862ff26f8 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Sat, 7 Dec 2024 12:04:52 +0100 Subject: [PATCH] [skip ci] fix cron day for Tuesday --- .../framework/ubuntu/scheduledjobs/domain/ScheduledJobs.kt | 2 +- .../ubuntu/scheduledjobs/domain/ScheduledJobsKtTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobs.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobs.kt index 647e955..404f53f 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobs.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobs.kt @@ -17,7 +17,7 @@ fun Prov.scheduleMonthlyReboot() = task { // ensure shutdown command exists if (checkFile(shutdown, sudo = true)) { // reboot each first Tuesday in a month at 3:00 - createCronJob("50_monthly_reboot", "0 3 1-7 * 2", "$shutdown -r now", "root") + createCronJob("50_monthly_reboot", "0 2 1-7 * 2", "$shutdown -r now", "root") } else { addResultToEval(ProvResult(false, err = "$shutdown not found.")) } diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobsKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobsKtTest.kt index e20c882..896a369 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobsKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/scheduledjobs/domain/ScheduledJobsKtTest.kt @@ -29,6 +29,6 @@ class ScheduledJobsKtTest { val fqFilename = "/etc/cron.d/50_monthly_reboot" assertTrue(prov.checkFile(fqFilename), "") val actualFileContent = prov.fileContent(fqFilename, sudo = true) - assertEquals("0 3 1-7 * 2 root /sbin/shutdown -r now\n", actualFileContent) + assertEquals("0 2 1-7 * 2 root /sbin/shutdown -r now\n", actualFileContent) } } \ No newline at end of file