From 4389968bf2543693a97725b2a87a7c0bef4683c9 Mon Sep 17 00:00:00 2001 From: Arthur Erlich <1+haylan@noreply.localhost> Date: Thu, 7 May 2026 06:59:27 +0200 Subject: [PATCH] Add Arch/systemd/ghostmirror-monthly.service --- Arch/systemd/ghostmirror-monthly.service | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Arch/systemd/ghostmirror-monthly.service diff --git a/Arch/systemd/ghostmirror-monthly.service b/Arch/systemd/ghostmirror-monthly.service new file mode 100644 index 0000000..c35fccb --- /dev/null +++ b/Arch/systemd/ghostmirror-monthly.service @@ -0,0 +1,48 @@ +[Unit] +Description=Monthly mirror update – Timeshift backup then GhostMirror refresh +Documentation=https://github.com/vbextreme/ghostmirror +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot + +# Step 1: Timeshift RSYNC snapshot before touching anything +ExecStart=/bin/sh -c '/usr/bin/timeshift --create --rsync \ + --comments "pre-ghostmirror monthly mirror update $(date +%%Y-%%m-%%d %%H:%%M:%%S)" \ + --scripted' + +# Step 2: Fetch & rank mirror pool +# -c countries: Switzerland (primary), Germany, Italy + Austria, France, Netherlands +# -L 30 candidates +# -S drop errored mirrors, prefer synced + fresh + nearest +ExecStart=/usr/bin/ghostmirror \ + -P -o \ + -c Switzerland,Germany,Italy,Austria,France,Netherlands \ + -l /etc/pacman.d/mirrorlist \ + -L 30 \ + -S state,outofdate,morerecent,ping + +# Step 3: Speed-test candidates, write final top 10 to mirrorlist +# -m use the file from step 2 +# -u file is already uncommented +# -s light speed test (~6 MiB per mirror) +# -L keep top 10 +# -S stability + speed on top of sync/freshness +ExecStart=/usr/bin/ghostmirror \ + -P -o \ + -m /etc/pacman.d/mirrorlist \ + -u \ + -l /etc/pacman.d/mirrorlist \ + -L 10 \ + -s light \ + -S state,outofdate,morerecent,estimated,speed + +Nice=10 +IOSchedulingClass=best-effort +IOSchedulingPriority=5 +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target \ No newline at end of file