update nodesource and docker script

This commit is contained in:
tuna-mirror-server 2015-10-10 21:15:44 +08:00
parent 3776f11057
commit c96b7aa2e1
2 changed files with 24 additions and 4 deletions

16
scripts/docker.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
function sync_docker() {
repo_url="$1"
repo_dir="$2"
[ ! -d "$repo_dir" ] && mkdir -p "$repo_dir"
cd $repo_dir
# lftp "${repo_url}/" -e "mirror --verbose --exclude-glob='*/SRPMS/*' -P 5 --delete --only-newer; bye"
# lftp "${repo_url}/" -e "mirror --verbose -P 5 --delete --only-newer; bye"
wget --mirror --convert-links --no-parent --no-host-directories $repo_url
find . -type f -iname "*.1" -exec rm {} \;
}
sync_docker "http://apt.dockerproject.org/" "${TUNASYNC_WORKING_DIR}/apt"
sync_docker "http://yum.dockerproject.org/" "${TUNASYNC_WORKING_DIR}/yum"

View File

@ -1,14 +1,18 @@
#!/bin/bash
function sync_repo_ck() {
function sync_nodesource() {
repo_url="$1"
repo_dir="$2"
[ ! -d "$repo_dir" ] && mkdir -p "$repo_dir"
cd $repo_dir
# lftp "${repo_url}/" -e "mirror --verbose --log=${TUNASYNC_LOG_FILE} --exclude-glob='*/SRPMS/*' -P 5 --delete --only-newer; bye"
# lftp "${repo_url}/" -e "mirror --verbose --exclude-glob='*/SRPMS/*' -P 5 --delete --only-newer; bye"
lftp "${repo_url}/" -e "mirror --verbose -P 5 --delete --only-newer; bye"
}
sync_repo_ck "https://deb.nodesource.com/node" "${TUNASYNC_WORKING_DIR}/deb"
sync_repo_ck "https://rpm.nodesource.com/pub" "${TUNASYNC_WORKING_DIR}/rpm"
sync_nodesource "https://deb.nodesource.com/node" "${TUNASYNC_WORKING_DIR}/deb"
sync_nodesource "https://deb.nodesource.com/node_0.12" "${TUNASYNC_WORKING_DIR}/deb_0.12"
sync_nodesource "https://deb.nodesource.com/node_4.x" "${TUNASYNC_WORKING_DIR}/deb_4.x"
sync_nodesource "https://rpm.nodesource.com/pub" "${TUNASYNC_WORKING_DIR}/rpm"
sync_nodesource "https://rpm.nodesource.com/pub_0.12" "${TUNASYNC_WORKING_DIR}/rpm_0.12"
sync_nodesource "https://rpm.nodesource.com/pub_4.x" "${TUNASYNC_WORKING_DIR}/rpm_4.x"