delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/08/21/17:48:40

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:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; q=dns; s=default; b=M93m
RMr+ElH1MvWbX/tEnv0J52JeR9gk2m1oC2O2JYJE/D9iqIN3TROf2ncdZ6cMITtb
5C8BLPnM2FWOYweRcsATbpSsG+NuWdZUavMrSGjhKHfGIJfVDT4gHrqsNSXLjbPa
vIKb9kbD5NkFKM+NhKHcS4sWsLPbilhgAWkQ17k=
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:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; s=default; bh=Jm5AF+kkOz
lIb+DGmvcxMtmI2yY=; b=WJET2L5mf50EJhd5roEgeipXKmiWBBKf1c/45n6oax
OBTZJZANq7+LTM/VbGdgoVpuRojHKdtlSt0jS9eKmVu4US9WHBVXnJGoJuDvIPuU
bkHC5nmzeVx+xloooQT1ZiXwohsLeHDTE9M2aZOU+xHot1muS6fuLi4MLzIhhQXI
M=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.3 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2
X-HELO: mail105.syd.optusnet.com.au
Date: Fri, 22 Aug 2014 07:48:12 +1000
From: Duncan Roe <duncan_roe AT acslink DOT net DOT au>
To: cygwin AT cygwin DOT com
Subject: Re: Problem with cron jobs
Message-ID: <20140821214811.GA2714@dimstar.local.net>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ@mail.gmail.com>
User-Agent: Mutt/1.5.22 (2013-10-16)
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=AOuw8Gd4 c=1 sm=1 tr=0 a=+cDhJlqnNvz9E7c5l3ERGg==:117 a=+cDhJlqnNvz9E7c5l3ERGg==:17 a=y26AOypDAAAA:8 a=PO7r1zJSAAAA:8 a=M1kyBYkWWGkA:10 a=zD6Paqi8_hUA:10 a=kj9zAlcOel0A:10 a=iaFubHWvAAAA:8 a=dZuH2TmBjW3fshrM0RMA:9 a=CjuIK1q_8ugA:10
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019