From owner-freebsd-questions@FreeBSD.ORG Tue Sep 17 03:55:52 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8F9651DC for ; Tue, 17 Sep 2013 03:55:52 +0000 (UTC) (envelope-from aurfalien@gmail.com) Received: from mail-oa0-x232.google.com (mail-oa0-x232.google.com [IPv6:2607:f8b0:4003:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A16C274E for ; Tue, 17 Sep 2013 03:55:52 +0000 (UTC) Received: by mail-oa0-f50.google.com with SMTP id l10so809529oag.9 for ; Mon, 16 Sep 2013 20:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ktig+CkY5NPqLx2ijr4ak68PneudO+El84imvjftxtE=; b=ugVF6/sEMnXtOOc42cSsyMlVSP5vIMGW0FS/HZgBNB0Mj3kPkMf5swm9vjn2zexWRG QVZJtac75YW/35x9qiyfInObzgNDAP5bZVIkjTLrZPokZr01oZpCfk3kU46t7JZwFmHU n5KSsNIRl8tMjgkSdsp2vbBNp7shv2c/MD/CnPdSYH9iDhhiry+YYHG5f5LZDWaz6aJO GcuOxe98OdlmmG8VVHtngkHHfqv/U7kmguFEeRPKG0rAOlDe9XOQO0+S5vMOWVaKZcOj t89F/iQoOWIy1ogOfKUIYrfElhY+SskVuBYLC4ldJEGszeJbxTuJo7pKagX/7etun65b Xg6A== X-Received: by 10.60.118.41 with SMTP id kj9mr2881040oeb.31.1379390151647; Mon, 16 Sep 2013 20:55:51 -0700 (PDT) Received: from [192.168.1.74] (75-63-29-182.lightspeed.irvnca.sbcglobal.net. [75.63.29.182]) by mx.google.com with ESMTPSA id bq4sm35304099obb.1.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 20:55:50 -0700 (PDT) Subject: Re: test if script called by cron Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=iso-8859-1 From: aurfalien In-Reply-To: <5236EB03.7040001@ifdnrg.com> Date: Mon, 16 Sep 2013 20:55:48 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6E30E203-1062-41C6-A553-68D6AB372C4A@gmail.com> References: <5236EB03.7040001@ifdnrg.com> To: Paul Macdonald X-Mailer: Apple Mail (2.1085) Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 03:55:52 -0000 An easy way to do this is check /var/log/cron There are many other ways.=20 - aurf On Sep 16, 2013, at 4:26 AM, Paul Macdonald wrote: >=20 > Hi, >=20 > Is there a simple way of testing whether a given script was called via = cron, >=20 > I'd rather find a solution that would work from within the script = rather than setting an environment variable in the crontab. >=20 > thanks > Paul. >=20 > (anyone here going to EuroBSD con?) >=20 > --=20 > ------------------------- > Paul Macdonald > IFDNRG Ltd > Web and video hosting > ------------------------- > t: 0131 5548070 > m: 07970339546 > e: paul@ifdnrg.com > w: http://www.ifdnrg.com > ------------------------- > IFDNRG > 40 Maritime Street > Edinburgh > EH6 6SA > ---------------------------------------------------- > High Specification Dedicated Servers from =A3100.00pm > ---------------------------------------------------- >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"