X-Recipient: archive-cygwin AT delorie DOT 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:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=MLdjfdfSFsyzO8Po GTbzJhDYP4FhcLSHEBSH9osDXKoMjG0QHKzXmYbxMDYa63DQeziFBeP9yV3ntTb/ Keo5ACHTpRW89UIO9Zxkkx46faNuBtzz7obwjDmFmWHySg5hLO/SDgKcG+CjMh4M mzyO38TPL/Ws1Z9CEuNbboxuy9A= 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:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=5NNcneU+TL0EkNMpr/fwqq ljVUQ=; b=Z8pF7CMCf4BIT7qdwb3nsTTmYNpaFJ6VdtH5NS91VtJ3AOzn9dqXR6 d4FBZD9GqZifTbKDyLP5EJ+n9xpPIi/NdjPVV4t7CP8KZIbIoxdgK8vbk6fp1Mco xOmaYpY5i0w45eP8ICbyeC5GywcJ4BF9T4kuJqOC60o6KQt7J5d0g= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=bryan, ls, Bryan, dunphy X-HELO: smtp-out-no.shaw.ca X-Authority-Analysis: v=2.2 cv=M/89E24s c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=B8O7xx6FAAAA:8 a=a_05hr6xKBnNxAMGFpwA:9 a=QEXdDO2ut3YA:10 a=lGIfm0F7_MwsHfD5398K:22 Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca Subject: Re: How to repeat a bash shell script until success To: cygwin AT cygwin DOT com References: <97021E71-D804-42AF-8358-6276AF4514AB AT gmail DOT com> From: Brian Inglis Message-ID: <8f1c496b-6462-26a0-055a-730b3ecc90a1@SystematicSw.ab.ca> Date: Thu, 13 Jul 2017 19:12:35 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <97021E71-D804-42AF-8358-6276AF4514AB@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfFdJHPol5dy8IXP/Kgqj1OqjxhHMB+/tQG8woZ5qQZ/oUhrt6OFvn24R+A1eulJMf2Lteb/bZ0WZqdGvSx9HswWMv+WltcV7tkklrL8PdhoQFvlkeLfJ cLZyBwqreHEuQBgtNrLMycuPABGG85cq6C7ng3uevEwTcqAHw79bdzKF1bOF2j/e6TmyOhpjUlO6Ug== X-IsSubscribed: yes On 2017-07-12 09:35, Bryan Dunphy wrote: > 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 Plug your subject line into a web search and read the resulting hits. Then you don't have to wait 9 hours for hints. ;^> You could also run "man bash" and RTFM. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- 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