fix schedule in scheduleMonthlyReboot

This commit is contained in:
ansgarz 2024-12-20 13:28:39 +01:00
parent d50f61a4d6
commit da73a87bca

View file

@ -9,6 +9,7 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.scheduledjobs.infrast
* ATTENTION: Use with care!! System will be shut down, restart might not succeed in all cases.
*/
fun Prov.scheduleMonthlyReboot() = task {
// reboot each first Tuesday in a month at 3:00
createCronJob("50_monthly_reboot", "0 2 1-7 * 2", "/sbin/shutdown", "-r now", "root")
// reboot each first Tuesday a month - see https://blog.healthchecks.io/2022/09/schedule-cron-job-the-funky-way/
val schedule = "0 2 */100,1-7 * TUE"
createCronJob("50_monthly_reboot", schedule, "/sbin/shutdown", "-r now", "root")
}