Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions tunasync/conf/worker-centos.conf

This file was deleted.

29 changes: 0 additions & 29 deletions tunasync/conf/worker-epel.conf

This file was deleted.

29 changes: 0 additions & 29 deletions tunasync/conf/worker-pypi.conf

This file was deleted.

30 changes: 0 additions & 30 deletions tunasync/conf/worker-ubuntu.conf

This file was deleted.

50 changes: 50 additions & 0 deletions tunasync/conf/worker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[global]
name = "worker"
log_dir = "/mirrors/log/tunasync/{{.Name}}"
mirror_dir = "/mirrors"
concurrent = 10
interval = 1440

[manager]
api_base = "http://localhost:14242"

[cgroup]
enable = false
base_path = "/sys/fs/cgroup"
group = "tunasync"

[server]
hostname = "localhost"
listen_addr = "127.0.0.1"
listen_port = 16020
ssl_cert = ""
ssl_key = ""

[[mirrors]]
name = "ubuntu"
provider = "rsync"
upstream = "rsync://mirrors.yun-idc.com/ubuntu/"
use_ipv6 = false
interval = 540

[[mirrors]]
name = "pypi"
provider = "rsync"
upstream = "rsync://rsync.mirrors.ustc.edu.cn/pypi/"
use_ipv6 = false
interval = 1920

[[mirrors]]
name = "epel"
provider = "rsync"
upstream = "rsync://rsync.mirrors.ustc.edu.cn/epel/"
use_ipv6 = false
interval = 1680

[[mirrors]]
name = "centos"
provider = "rsync"
upstream = "rsync://mirrors.tuna.tsinghua.edu.cn/centos/"
use_ipv6 = false
# interval is inherited from the global configuration

19 changes: 10 additions & 9 deletions tunasync/scripts/updateTunasync.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#! /bin/bash
source ~/.bash_profile

centos_size=`du -sh /mirrors/centos/ | awk '{print $1}'`
epel_size=`du -sh /mirrors/epel/ | awk '{print $1}'`
ubuntu_size=`du -sh /mirrors/ubuntu/ | awk '{print $1}'`
pypi_size=`du -sh /mirrors/pypi/ | awk '{print $1}'`
# Not needed because sizes can be retrived directly from rsync logs
#centos_size=`du -sh /mirrors/centos/ | awk '{print $1}'`
#epel_size=`du -sh /mirrors/epel/ | awk '{print $1}'`
#ubuntu_size=`du -sh /mirrors/ubuntu/ | awk '{print $1}'`
#pypi_size=`du -sh /mirrors/pypi/ | awk '{print $1}'`

tunasynctl set-size -w centos_worker centos $centos_size
tunasynctl set-size -w epel_worker epel $epel_size
tunasynctl set-size -w ubuntu_worker ubuntu $ubuntu_size
tunasynctl set-size -w pypi_worker pypi $pypi_size
#tunasynctl set-size -w worker centos $centos_size
#tunasynctl set-size -w worker epel $epel_size
#tunasynctl set-size -w worker ubuntu $ubuntu_size
#tunasynctl set-size -w worker pypi $pypi_size

sleep 5
#sleep 5

mv /mirrors/jobs.json /mirrors/jobs.json.bak
wget -c http://localhost:14242/jobs -O /mirrors/jobs.json -o /mirrors/log/plog/wget.log