This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: How to repeat a bash shell script until success
- From: "Ian Lambert via cygwin" <cygwin at cygwin dot com>
- To: cygwin at cygwin dot com,cyg Simple <cygsimple at gmail dot com>
- Date: Mon, 17 Jul 2017 13:41:32 -0400
- Subject: Re: How to repeat a bash shell script until success
- Authentication-results: sourceware.org; auth=none
- References: <97021E71-D804-42AF-8358-6276AF4514AB@gmail.com> <20170714052736.GA2895@phoenix> <8bb16934-972b-5d3e-918f-36eec3d16ca6@gmail.com>
- Reply-to: Ian Lambert <ian dot lambert_42 at yahoo dot com>
On July 14, 2017 9:06:02 AM EDT, cyg Simple <> wrote:
>On 7/14/2017 1:27 AM, Gary Johnson wrote:
>> On 2017-07-12, Bryan Dunphy wrote:
>>> I have a shell script, originally created for Mac OS X. that waits
>>> for an external drive to be mounted (by .
>>
>
>In reality the OP script appears to be executed in a crontab system and
>executed every X minutes. So a change to the OP question is needed
>which is answered at[1]. Let's remember some people have no real clue
>as to what question they should ask and we need to interpret what is
>being asked into what should have been asked. If interpretation isn't
>possible then asking for a use case would be warranted.
>
>[1]
>https://stackoverflow.com/questions/707184/how-do-you-run-a-crontab-in-cygwin-on-windows
cyg Simple,
Thanks much for this. It seems the link is misleading, because it says cygrunsrv and cron-config must be used to get Cron to work.
I've been frustrated without admin, being unable to use these. It turns out simply adding
/usr/sbin/cron to .bashrc will make Cron available. Or, slightly more complicated,
to avoid "lock" errors:
$HOME/bin/startcron
Containing:
#!/bin/bash
if P=$(pgrep cron)
then
echo "already running, PID is $P"
else
echo "not running, starting now"
/usr/sbin/cron
fi
Thanks!
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
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