Add 3 times retry and 30m+30m rsync timeout to syncHttpLogs

This commit is contained in:
Adam Saleh 2021-07-21 16:05:42 +02:00
parent fca9cbad46
commit 721e3e9864

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
RSYNC_FLAGS='-avSHP --no-motd' RSYNC_FLAGS='-avSHP --no-motd --timeout=1200 --contimeout=1200'
DEBUG=1 DEBUG=1
function syncHttpLogs { function syncHttpLogs {
@ -26,12 +26,14 @@ function syncHttpLogs {
if [[ ${DEBUG} -eq 1 ]]; then if [[ ${DEBUG} -eq 1 ]]; then
echo "${HOST}: Getting ${RSYNC_OUTPUT} and saving to ${DEST}" echo "${HOST}: Getting ${RSYNC_OUTPUT} and saving to ${DEST}"
fi fi
/usr/bin/rsync $RSYNC_FLAGS $HOST::log/httpd/$f ./$DEST &> /dev/null for i in 2 1 0; do
timeout 12h /usr/bin/rsync $RSYNC_FLAGS $HOST::log/httpd/$f ./$DEST &> /dev/null && break
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "rsync from $HOST for file $f failed" echo "rsync from $HOST for file $f failed, will repeat $i times"
fi fi
done done
done done
done
} }
syncHttpLogs proxy01.iad2.fedoraproject.org syncHttpLogs proxy01.iad2.fedoraproject.org