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

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:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding
:in-reply-to; q=dns; s=default; b=phhCVq0Pf4+eJFQAZ4+yHhw8l5ol1z
8z23q37x2HLJIlc05Rn6uBwk1VKTMFrbfeLlBViuosV5OgDBFtlV66W46lAHcRfn
tq+mLG6NMG8MkfZDajJMt0Gyi1mTne1LUIO6r86953HpouT67KPl5bfWyM3jeqba
7rlERNv8an4gM=
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:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding
:in-reply-to; s=default; bh=EfjhdgqVuj5ocXr38h0DFm48Af8=; b=vvK8
sas6QcSXmtKQGULWgZ+qYw57L1CcRzf+HIjbBUMxKRo3orqONq76VjpK91Vcju8f
nkexbz7BtQbWOdHDUv8oCZbZSd96VW/c99cc5A82roiGZm9iIkbNX6BfZb563wvz
dcNQL2SKCbWv8MkWCJ+6loahTalwNHpGKNsAxdg=
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=1.1 required=5.0 tests=AWL,BAYES_40,FSL_HELO_BARE_IP_2,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: Problem with cron jobs
Date: Thu, 21 Aug 2014 14:40:38 -0700
Lines: 38
Message-ID: <lt5p0r$f69$1@ger.gmane.org>
References: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ AT mail DOT gmail DOT com> <1041974061 DOT 20140821182500 AT yandex DOT ru>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0
In-Reply-To: <1041974061.20140821182500@yandex.ru>
X-IsSubscribed: yes

On 8/21/2014 7:25 AM, Andrey Repin wrote:
> 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 AT yandex DOT ru) 21.08.2014, <18:24>
>
> Sorry for my terrible english...
>
>

$ man bash | grep abort
        Control-G  will  abort  an  incremental search and restore the 
original
        abort (C-g)

It might be better if your searched for "errexit".

-- 
Andrew DeFaria
http://defaria.com


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