This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Problem with cron jobs
- From: Duncan Roe <duncan_roe at acslink dot net dot au>
- To: cygwin at cygwin dot com
- Date: Fri, 22 Aug 2014 07:48:12 +1000
- Subject: Re: Problem with cron jobs
- Authentication-results: sourceware.org; auth=none
- References: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ at mail dot gmail dot com>
On Thu, Aug 21, 2014 at 07:59:29AM -0400, Cary Lewis wrote:
> I have created a small shell script that acts like a network
> connectivity watchdog, which checks for a successful ping to the
> internet, and if it doesn't work, restarts the machine.
>
> When I attempt to run it from a cron job, the script exits whenever
> any of the commands exits with a non zero status, preventing the
> script from doing its job.
>
> Has anyone seen this behaviour before?
>
Yes - this is the behaviour you get with "set -e". To negate it, put "set +e"
at the top of your script,
Cheers ... Duncan.
--
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