Commit 1de3da4e authored by Seblu's avatar Seblu

Add a timeout on rsync connections

It may append that rsync stall and don't quit. This add and housekeeper.
parent e2655124
......@@ -40,9 +40,15 @@ REPO_PACKAGES_INDEX=1
# Better option is to let it to 0 to look only in the last snapshot
REPO_PACKAGES_FULL_SEARCH=0
# Max duration of the rsyncing of the daily snapshot
REPO_RSYNC_TIMEOUT=80000
##############################################################################
#### ISO
##############################################################################
# Enable ISO archiving
ARCHIVE_ISO=1
# Max duration of the rsyncing of the iso images
ISO_RSYNC_TIMEOUT=6400
# vim:set sw=2 ts=2 ft=sh et:
# Archlinux remote rsync server
# Global
ARCHIVE_RSYNC='rsync://polymorf.fr/archlinux/'
# Archive base directory
ARCHIVE_DIR="$PWD/archive-root"
# Archive User and Group
ARCHIVE_USER=$(id -u -n)
ARCHIVE_GROUP=$(id -g -n)
# Packages extension
PKGEXT='.pkg.tar.xz'
PKGSIG="$PKGEXT.sig"
# Umask used when archiving
UMASK=022
##############################################################################
#### Repositories
##############################################################################
# Enable repositories archiving
# Repositories
ARCHIVE_REPO=1
# Enable daily repo trees
# This offer daily, weekly, monthly, yearly snapshot trees
REPO_DAYLY=1
# Enable packages tree
# Create a dedicated tree with packages sorted by name
REPO_PACKAGES=1
# Enable repository package index
# Needed by agetpkg to list packages
REPO_PACKAGES_INDEX=1
# Search in all repository snapshop. This is slow.
# Better option is to let it to 0 to look only in the last snapshot
REPO_PACKAGES_FULL_SEARCH=0
REPO_RSYNC_TIMEOUT=10
##############################################################################
#### ISO
##############################################################################
# Enable ISO archiving
ARCHIVE_ISO=1
\ No newline at end of file
# ISO
ARCHIVE_ISO=1
ISO_RSYNC_TIMEOUT=5
\ No newline at end of file
......@@ -85,8 +85,9 @@ repo_rsync() {
msg2 'Rsyncing...'
# rsync from master using last sync
# we must use absolute path with --link-dest to avoid errors
rsync -rltH $LINKDEST --exclude '*/.*' --exclude 'iso/*' "$ARCHIVE_RSYNC" "$SNAP/" ||
error "Unable to rsync: $ARCHIVE_RSYNC."
timeout $REPO_RSYNC_TIMEOUT rsync -rltH $LINKDEST \
--exclude '*/.*' --exclude 'iso/*' "$ARCHIVE_RSYNC" "$SNAP/" ||
error "Unable to rsync: $ARCHIVE_RSYNC."
# only to have a quick check of sync in listdir
touch "$SNAP"
......@@ -201,8 +202,9 @@ iso_rsync() {
[[ -d "$ISO_DIR" ]] || mkdir -p "$ISO_DIR"
# Rsync from master using last sync
rsync -vrltH "$ISO_RSYNC" --include='/????.??.??/***' --exclude='*' "$ISO_DIR/" ||
error "Unable to rsync: $ISO_RSYNC."
timeout $ISO_RSYNC_TIMEOUT rsync -vrltH "$ISO_RSYNC" \
--include='/????.??.??/***' --exclude='*' "$ISO_DIR/" ||
error "Unable to rsync: $ISO_RSYNC."
}
main() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment