This is the mail archive of the
cygwin
mailing list for the Cygwin project.
How to repeat a bash shell script until success
- From: Bryan Dunphy <b dot dunphy dot 342 at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 12 Jul 2017 10:35:55 -0500
- Subject: How to repeat a bash shell script until success
- Authentication-results: sourceware.org; auth=none
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