nano -w /usr/lib/systemd/system/archlinux-update.timer
[Unit]
Description=rsync the resposity of archlinx daily
[Timer]
OnCalendar=*-*-* *:30:00
AccuracySec=4h
Persistent=true
[Install]
WantedBy=timers.target
修改后重新加载服务
systemctl daemon-reload
nano -w /usr/lib/systemd/system/archlinux-update.service
[Unit]
Description=rsync the resposity of archlinx daily
[Service]
Nice=19
IOSchedulingClass=2
IOSchedulingPriority=7
ExecStart=/data/sync.sh
sync.sh为自动同步archlinux的源,注意红色部分的-, 没有的话无法正常运行
#!/bin/bash –
/usr/bin/rsync -rtlvH –delete-after –delay-updates –safe-links –max-delete=500000 rsync://mirrors.ustc.edu.cn/archlinux/ /data/archlinux/
chown -R http.http /data/archlinux
不要忘记启动定时器呀…
systemctl enable archlinux-update.timer