add timeout

This commit is contained in:
bigeagle 2014-11-23 12:12:19 +08:00
parent 5ef9ecd6ec
commit f7888e0239
4 changed files with 8 additions and 6 deletions

View File

@ -6,7 +6,7 @@ fi
function update_homebrew_git() {
cd $TUNASYNC_WORKING_DIR
git remote -v update
/usr/bin/timeout -s INT 3600 git remote -v update
}
update_homebrew_git

View File

@ -6,7 +6,7 @@ fi
function update_linux_git() {
cd $TUNASYNC_WORKING_DIR
git remote -v update
/usr/bin/timeout -s INT 3600 git remote -v update
}
update_linux_git

View File

@ -4,4 +4,4 @@ if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
exit 1
fi
/usr/bin/timeout -s INT 3600 /home/tuna/.virtualenvs/bandersnatch/bin/bandersnatch -c /etc/bandersnatch.conf mirror || exit 1
/usr/bin/timeout -s INT 3600 /home/tuna/.virtualenvs/bandersnatch/bin/bandersnatch -c /etc/bandersnatch.conf mirror

View File

@ -6,9 +6,11 @@ function sync_repo_ck() {
[ ! -d "$repo_dir" ] && mkdir -p "$repo_dir"
cd $repo_dir
lftp "${repo_url}/" -e 'mirror -v -P 5 --delete --only-missing --only-newer --no-recursion; bye'
lftp "${repo_url}/" -e 'mirror -v -P 5 --delete --only-missing --only-newer --no-recursion; bye' || return 1
wget "${repo_url}/repo-ck.db" -O "repo-ck.db"
}
sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/x86_64" "${TUNASYNC_WORKING_DIR}/x86_64"
sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/i686" "${TUNASYNC_WORKING_DIR}/i686"
stat=0
sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/x86_64" "${TUNASYNC_WORKING_DIR}/x86_64" || stat=1
sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/i686" "${TUNASYNC_WORKING_DIR}/i686" || stat=1
exit $stat