test
This commit is contained in:
@@ -158,8 +158,13 @@ wait_for_rsync() {
|
||||
|
||||
for i in $(seq 1 "$RETRY_COUNT"); do
|
||||
|
||||
# stable + cross-system safe
|
||||
COUNT=$(pgrep -af rsync | wc -l)
|
||||
# ONLY COUNT LOCAL INITIATED RSYNC COMMANDS
|
||||
COUNT=$(ps -eo pid,cmd | grep "[r]sync .*${REMOTE_SERVER:-}" | wc -l || true)
|
||||
|
||||
# fallback if REMOTE_SERVER not set yet
|
||||
if [[ -z "$REMOTE_SERVER" ]]; then
|
||||
COUNT=$(pgrep -x rsync | wc -l || true)
|
||||
fi
|
||||
|
||||
if [[ "$COUNT" -ge "$MAX_RSYNC_PROCS" ]]; then
|
||||
warn "Waiting rsync slot ($COUNT/$MAX_RSYNC_PROCS)"
|
||||
|
||||
Reference in New Issue
Block a user