From 3794c3455c196755e869f7b1c68c2ed33dbae456 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Sun, 26 Oct 2025 10:14:32 +0100 Subject: [PATCH] feat: add cron for flushing disk cache --- templates/cron/alpine-root.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/cron/alpine-root.j2 b/templates/cron/alpine-root.j2 index 7db847a..03c60bb 100644 --- a/templates/cron/alpine-root.j2 +++ b/templates/cron/alpine-root.j2 @@ -9,5 +9,10 @@ # disable swap @reboot swapoff -a +{% if type == 'vm' %} +# flush caches every 2 hours +0 */2 * * * echo 3 > /proc/sys/vm/drop_caches +{% endif %} + # update packages between 3:15-3:30 am 15 3 * * * sleep $(($RANDOM % 900)) && apk -U upgrade >/dev/null 2>&1 && apk clean cache && reboot -d 60