delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/08/21/10:35:39

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: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 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=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 AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <1041974061.20140821182500@yandex.ru>
To: Cary Lewis <cary DOT lewis AT gmail DOT com>, cygwin AT cygwin DOT com
Subject: Re: Problem with cron jobs
In-Reply-To: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ@mail.gmail.com>
References: <CAEF1h+VvERQqWKnorMSFRF=NPhbMU+OTO437VkmJK7eY-buvgQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
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 AT yandex DOT 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

- Raw text -


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