X-Recipient: archive-cygwin@delorie.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:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=wVn1vS50lmQAYezu
	NINtlk7wLBxtdT6FuVMlA/7xS0KrBptvcKfiG0H6tGUqhjWkGfDWbeFA872r1lio
	hMFTKAMFnKp1AF2H03LccAddu+2+EKxAQ4YVahNvhMlYST+wJ9Yl4BpqMmFLwcij
	DlAuafnVpYT6jwTMrL+nzkDfkQE=
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:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=qiu+n2xvweICx1g0DR+bDf
	SPibs=; b=OAQW3UVa3B1lc6tyixVyVH4SRcAGMNkyuLRCTGmowsPJsXFVxLPSkt
	JoqQ4TT7ujvfn1CFK208eJ5d9C/AsWJFVSSl6ggJkr0ld/2s3Zzx3nV7cJ4G5/yg
	LJCOIQ+fYaQHbS8TQry+DucFDYkFhMj0pC9TzOEPqbmLD1PkU7Kms=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.7 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2
X-HELO: smtpback.ht-systems.ru
Date: Thu, 21 Aug 2014 18:25:00 +0400
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <1041974061.20140821182500@yandex.ru>
To: Cary Lewis <cary.lewis@gmail.com>, cygwin@cygwin.com
Subject: Re: Problem with cron jobs
In-Reply-To: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ@mail.gmail.com>
References: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Cary Lewis!

> 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?

> I have tried wrapping the script in () to run it within a sub-shell,
> but to no avail.

man bash
You have to disable abort-on-error in your script.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 21.08.2014, <18:24>

Sorry for my terrible english...


--
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

