[skip ci] fix cron day for Tuesday

This commit is contained in:
ansgarz 2024-12-07 12:04:52 +01:00
parent ad7845d910
commit c99277ddf6
2 changed files with 2 additions and 2 deletions

View file

@ -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."))
}

View file

@ -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)
}
}