Minimal script to update a Kiwix catalog. Supports automatically resuming partial downloads, can safely set and forget.
curl --proto "=https" --tlsv1.2 "https://gist.githubusercontent.com/msanders/903923ce83040054a09907b376b89c7d/raw/kiwix_catalog_update" -o /usr/local/bin/kiwix_catalog_update
chmod u+x /usr/local/bin/kiwix_catalog_update
aria2c
kiwix-tools
xq
# apt install aria2 kiwix-tools xq
Example systemd config on Debian to run every Tuesday – Thursday at 1 AM to 7 AM.
[Unit]
Description=Kiwix Catalog Update Service
PartOf=kiwix.service
[Service]
User=kiwix
Group=kiwix
Type=oneshot
ExecStart=/usr/local/bin/kiwix_catalog_update -q
[Install]
WantedBy=multi-user.target
[Unit]
Description=Kiwix Catalog Update Timer
[Timer]
OnCalendar=Tue..Thu 1:00
[Install]
WantedBy=timers.target
[Unit]
Description=Kiwix Catalog Update Stop Service
[Service]
User=kiwix
Group=kiwix
Type=oneshot
ExecStart=/usr/bin/systemctl stop kiwix-catalog-update.service
[Install]
WantedBy=multi-user.target
[Unit]
Description=Kiwix Catalog Update Stop Timer
[Timer]
OnCalendar=*-*-* 7:00:00
[Install]
WantedBy=timers.target
Write the above files and then run:
# systemctl daemon-reload
# systemctl enable --now kiwix-catalog-update.timer
# systemctl enable --now kiwix-catalog-update-stop.timer
This is made available under the terms of the MIT license. For a copy, see https://opensource.org/licenses/MIT.