From 4b8107ea4d3dea6b413b23261ef3da817825b819 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 4 Sep 2006 13:59:58 +0000 Subject: Have CONCURRENCY_LEVEL environment git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@177 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- backup-mysql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backup-mysql b/backup-mysql index af162b4..4826415 100755 --- a/backup-mysql +++ b/backup-mysql @@ -28,6 +28,10 @@ if [ -z "$HOSTS" ]; then HOSTS="localhost" fi +if [ -z "$CONCURRENCY_LEVEL" ]; then + CONCURRENCY_LEVEL=1 +fi + for host in $HOSTS; do if [ "$host" = "localhost" ]; then prefix=""; @@ -61,7 +65,7 @@ for host in $HOSTS; do for db in $DBs; do file="$TARGET/$DATE-$prefix$db" echo $file - done | xargs --no-run-if-empty --max-procs 4 -n 1 bzip2 + done | xargs --no-run-if-empty --max-procs "$CONCURRENCY_LEVEL" -n 1 bzip2 for db in $DBs; do file="$TARGET/$DATE-$prefix$db" -- cgit v1.2.3