diff --git a/archive.conf b/archive.conf index 4b506ddebdcf1bdf615529076a0cbc10ebb35f2f..af05bc431979f8027d686cf796ef937a7f4a1b8c 100644 --- a/archive.conf +++ b/archive.conf @@ -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 diff --git a/archive.conf.test b/archive.conf.test index c700c17c9b6ff2dc4371db7af498280043be05f5..942170dd682d5c47688d56f1a9821a42c12b3144 100644 --- a/archive.conf.test +++ b/archive.conf.test @@ -1,48 +1,22 @@ # 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 diff --git a/archive.sh b/archive.sh index 955e2f3e7993119794a4f84fb706414f88af1147..28a929791acb7221d72d66e9fdb8a202ccef6113 100755 --- a/archive.sh +++ b/archive.sh @@ -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() {