-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync_contrib.sh
executable file
·36 lines (26 loc) · 1.08 KB
/
sync_contrib.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
PARALLEL=32
BIOC_VERSION="3.19"
# BIOC_MIRROR="https://mirrors.dotsrc.org"
# CRAN_MIRROR="https://mirrors.dotsrc.org"
BIOC_MIRROR="https://ftp.gwdg.de"
CRAN_MIRROR="https://ftp.gwdg.de"
DEST=${1:-"$HOME/r-contrib"}
do_sync() {
local mirror=$1
local from=$2
local to=$3
mkdir -p "$to"
rclone sync \
--http-url "$mirror" \
":http:$from" \
"$to" \
--progress --delete-before --transfers=$PARALLEL --checkers=$((PARALLEL * 4)) -L
}
# BioC
do_sync "$BIOC_MIRROR" "pub/misc/bioconductor/packages/$BIOC_VERSION/bioc/src/contrib" "$DEST/bioconductor/packages/$BIOC_VERSION/bioc/src/contrib"
do_sync "$BIOC_MIRROR" "pub/misc/bioconductor/packages/$BIOC_VERSION/data/experiment/src/contrib" "$DEST/bioconductor/packages/$BIOC_VERSION/data/experiment/src/contrib"
do_sync "$BIOC_MIRROR" "pub/misc/bioconductor/packages/$BIOC_VERSION/data/annotation/src/contrib" "$DEST/bioconductor/packages/$BIOC_VERSION/data/annotation/src/contrib"
# CRAN
do_sync "$CRAN_MIRROR" "pub/misc/cran/src/contrib" "$DEST/cran/src/contrib"
echo "Done!"