init; not very clean

This commit is contained in:
2022-11-20 12:02:29 +08:00
commit 0690b9552b
4 changed files with 25 additions and 0 deletions

15
sync.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/zsh
for src in {CTAN,ubuntu,docker-ce/linux/ubuntu,ubuntu-releases}
do
if [ ! -f "/tmp/mirror-${src//\//\-}.lock" ];
then
touch /tmp/mirror-${src//\//\-}.lock
/home/root/programs/dxsync/presync.sh $src
rsync -4avzthP --stats --delete --bwlimit=6000 --log-file=/var/log/rsync-mirrors-${src//\//\-}.log rsync://mirrors4.tuna.tsinghua.edu.cn/$src /mnt/mirrors/$src
/home/root/programs/dxsync/postsync.sh ${src} $?
rm /tmp/mirror-${src//\//\-}.lock
else
/home/root/programs/dxsync/locked.sh $src
fi
done