From 86f55e156392069f63f67ae44cd62393de386f8e Mon Sep 17 00:00:00 2001 From: finn Date: Fri, 13 Nov 2026 10:43:16 -0700 Subject: [PATCH] add cron option and tweak ss --- README.md | 26 ++++++++++++++++++++++++-- create-linode.sh | 22 +++++++++++++++++++++- every_fifteen.sh | 12 ++++++++++++ every_hour.sh | 12 ++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) create mode 100755 every_fifteen.sh create mode 100755 every_hour.sh diff --git a/README.md b/README.md index 5b13991..a68cf5a 100644 --- a/README.md +++ b/README.md @@ -128,8 +128,12 @@ IMAGE="lloesche/valheim-server" # --------------------------------------------------------------------------- export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y --no-install-recommends docker.io ca-certificates docker-cli +apt-get install -y --no-install-recommends docker.io ca-certificates docker-cli cron systemctl enable --now docker +# cron is not started automatically by the docker.io package, and the +# manually maintained scripts on the volume (every_fifteen.sh, every_hour.sh) +# rely on it. +systemctl enable --now cron # --------------------------------------------------------------------------- # 2. Mount the Valheim volume. @@ -167,6 +171,24 @@ fi # --------------------------------------------------------------------------- mkdir -p "$CONFIG_DIR" "$DATA_DIR" +# Install the root crontab that drives the manually maintained scripts on the +# volume. cron runs jobs from $HOME with a minimal environment, so the scripts +# are called by absolute path and the scripts themselves write their logs next +# to their own location. /etc/cron.d is used instead of `crontab -` because the +# file is overwritten on every deploy, so re-runs cannot accumulate duplicate +# entries, and the instance always matches this definition. +cat > /etc/cron.d/valheim-maintenance <