Commit 1de3da4e authored by Seblu's avatar Seblu
Browse files

Add a timeout on rsync connections

It may append that rsync stall and don't quit. This add and housekeeper.
parent e2655124
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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
+6 −32
Original line number Diff line number Diff line
# 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
# ISO
ARCHIVE_ISO=1
ISO_RSYNC_TIMEOUT=5
 No newline at end of file
+6 −4
Original line number Diff line number Diff line
@@ -85,7 +85,8 @@ 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/" ||
	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
@@ -201,7 +202,8 @@ iso_rsync() {
	[[ -d "$ISO_DIR" ]] || mkdir -p "$ISO_DIR"

	# Rsync from master using last sync
	rsync -vrltH "$ISO_RSYNC" --include='/????.??.??/***' --exclude='*' "$ISO_DIR/" ||
	timeout $ISO_RSYNC_TIMEOUT rsync -vrltH "$ISO_RSYNC" \
		--include='/????.??.??/***' --exclude='*' "$ISO_DIR/" ||
			error "Unable to rsync: $ISO_RSYNC."
}