From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39180 invoked by alias); 14 Jul 2017 01:12:40 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 38319 invoked by uid 89); 14 Jul 2017 01:12:39 -0000 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 Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jul 2017 01:12:38 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with SMTP id Vp9nd01aerztEVp9odNobv; Thu, 13 Jul 2017 19:12:36 -0600 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.Inglis@SystematicSw.ab.ca Subject: Re: How to repeat a bash shell script until success To: cygwin@cygwin.com References: <97021E71-D804-42AF-8358-6276AF4514AB@gmail.com> From: Brian Inglis Message-ID: <8f1c496b-6462-26a0-055a-730b3ecc90a1@SystematicSw.ab.ca> Date: Fri, 14 Jul 2017 01:12:00 -0000 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 X-SW-Source: 2017-07/txt/msg00227.txt.bz2 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