aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-09-02 10:21:44 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-09-11 12:36:24 +0200
commitc8d6c4597ff66ca9aad6f3e41d16b43b6011b7e8 (patch)
tree752e7425b40c41ef85ec50f07ba0987afa96d3ee
parentecc281446c2908a2280568ad1e0b8c246d576c88 (diff)
packages-update: add random delay for scheduler
-rw-r--r--packages-update5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages-update b/packages-update
index 8807027..e02505c 100644
--- a/packages-update
+++ b/packages-update
@@ -42,8 +42,9 @@
:put "Do you want to (s)chedule reboot instead of (r)eboot now? [s/R]";
:if ([ :terminal inkey timeout=60 ] = 115) do={
/ system scheduler add name="reboot-for-update" start-time=03:00:00 interval=1d \
- on-event="/ system scheduler remove reboot-for-update; / system reboot;"
- :log info ("Scheduled reboot for update at 03:00.");
+ on-event=(":global RandomDelay; \$RandomDelay 3600; " . \
+ "/ system scheduler remove reboot-for-update; / system reboot;");
+ :log info ("Scheduled reboot for update between 03:00 and 04:00.");
:error ("Scheduled reboot.");
}