X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:content-type:content-transfer-encoding
	:mime-version:date:subject:message-id:to; q=dns; s=default; b=m+
	G3MM2CjcVNVp/JhU8bga+uw7WJ2oX1O76REyfi4Ctqk+9aBQInKQfObIQt/2waW6
	HwOOkGgL/fJGCoaqDX8Y+udWwWbN6XOxvxmXmbCmJ/oA1lUb0fDXjPu4Oj/POz/c
	hc7nm0We3mCn7Sm2Dl6P54rDuMHNEwJtt7TJ0PXdE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:content-type:content-transfer-encoding
	:mime-version:date:subject:message-id:to; s=default; bh=2VpAJvwF
	wdc1fY+Kqe1B+ly1raI=; b=tGlQA0m4ni4uSAHiQE9+jq4AG/7q0Fe83r4VGKDA
	AK7wwulTJYajybZiUeUEa+exOaelsft7Y5gASg+Lp57cy2Ep3Wn36y3HA6EJy77b
	447ypva3NL09JAU2rXhGSzM9fj9HUruSNWRlfoGC0R7VjmjPMfiJE2n9Jq5B/PXu
	HJk=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=ls, sk:project
X-HELO: mail-it0-f50.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:from:content-transfer-encoding:mime-version:date         :subject:message-id:to;        bh=dVbfQvF5Fea/zCBxxz2u46q0I8SntaKEqavI05l9PSE=;        b=A2nYv8r96qNkDvDihc+walwrqnaIwvGV483ALXZ7rWeV+2xVttCJKCZ64B+bI4XluC         2lVIEnVWMS89ZuO9FA1tKnKnnaSwxNfxo6Tw/vFhu3lfdGQ5CHnt87qms0NOBT904spI         b8zFvwpt4HOLwqv3491SjNuNw/2LluIcLzgOZR0iwDoNsI0efb1tEGsGgyLOpUPK1l9s         QmJJT7/JPvH+M6UDUWiGaCjbyLk7v9bcgtYZvXu36wMG2erVEoQDnROG+tzVIjTTpV1t         muS1dnjYXSEUCbJmXIaHDxV1Ho0Pzt82oWIeHl1Cnww/VHepmWeIWKtjEFvUahqNiNpw         NkUg==
X-Gm-Message-State: AIVw111bixx0FagQIY0x/rSGxSjz6PrsEQJuRxEpxgDCvHmuNxZ2UDnP	KgcB6PpppFXsprZVR94=
X-Received: by 10.36.41.204 with SMTP id p195mr1638211itp.12.1499991411777;        Thu, 13 Jul 2017 17:16:51 -0700 (PDT)
From: Bryan Dunphy <b.dunphy.342@gmail.com>
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Date: Wed, 12 Jul 2017 10:35:55 -0500
Subject: How to repeat a bash shell script until success
Message-Id: <97021E71-D804-42AF-8358-6276AF4514AB@gmail.com>
To: cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v6E0HG8Q005071

I have a shell script, originally created for Mac OS X. that waits for an external drive to be mounted (by testing an “ls” of the volume’s root directory for success) then runs an “rsync”
 command. How do I get the script to be run repeatedly until successful exit under Cygwin?

Here is the unmodified Mac OS version of the script:

#!/bin/bash
if ls /Volumes/Shared >/dev/null 2>/dev/null
then
        rsync -avz --compress-level=9 --delete-during --partial --exclude 'cache/' aleph.gutenberg.org::gutenberg /Volumes/Shared/Project-Gutenberg
        exit 0
else
        exit 1
fi


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


