鄙人的镜像已经上线,正在测试阶段。见:https://www.nicho1as.wang/mirror.html

NGINX 目录显示使用了 fancyindex 模块,搭配 https://github.com/llorephie/ngx-fancyindex-theme-bootstrap

状态检查使用了十分简陋的脚本跑 cron job:


File: pull_status.sh

#!/bin/bash
TIMENOW=$(date +"%F %R:%S %z")
echo "Tunasync status @$TIMENOW:" > /tmp/sync_status.txt
tunasynctl list --all >> /tmp/sync_status.txt
/srv/mirror/check_syncing.sh

--

File: check_syncing.sh

#!/bin/bash
SYNCING_COUNT=$(cat /tmp/sync_status.txt | grep -c success)
let "SYNCING_COUNT=SYNCING_COUNT+$?"

if [ "$SYNCING_COUNT" -ne "2" ]
then
 echo "#syncing_warning {display: block !important;}" > /tmp/syncing_warning.css
else
 echo "#syncing_warning {display: none !important;}" > /tmp/syncing_warning.css
fi

Rsyncd 基本就是默认模板改了改,就不放了。

最后顺便备份一下 tunasync 的 systemd service:

File: /etc/systemd/system/tunasync-manager.service

[Unit]
Description=Tunasync Manager
After=network-online.target

[Service]
Type=simple
User=http
Group=http
ExecStart=/usr/bin/tunasync manager -c /srv/mirror/conf.d/manager.conf --with-systemd --pidfile /run/tunasync-manager.pid --verbose --debug
PIDFile=/run/tunasync-manager.pid

[Install]
WantedBy=multi-user.target

--

File: /etc/systemd/system/tunasync-worker.service

[Unit]
Description=Tunasync Worker
After=network-online.target tunasync-manager.service

[Service]
Type=simple
User=http
Group=http
ExecStart=/usr/bin/tunasync worker -c /srv/mirror/conf.d/worker.conf --with-systemd --pidfile /run/tunasync-worker.pid --debug --verbose
PIDFile=/run/tunasync-worker.pid

[Install]
WantedBy=multi-user.target

扫描二维码,在手机上阅读!
*本站文章保留所有权利,如需转载请联系me#nicho1as.wang