From owner-freebsd-stable@freebsd.org Thu Apr 11 16:53:47 2019 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE0A1588D43 for ; Thu, 11 Apr 2019 16:53:47 +0000 (UTC) (envelope-from mack63richard@gmail.com) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 968B96E8B9 for ; Thu, 11 Apr 2019 16:53:46 +0000 (UTC) (envelope-from mack63richard@gmail.com) Received: by mail-ed1-x52d.google.com with SMTP id x14so5864070eds.1 for ; Thu, 11 Apr 2019 09:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gqxlvNOWDV9hr2k6wp2sEqvXX+eOInePmGyjXAlesII=; b=tiJueW483pX7oV/f7UE/MSqDX9wbCDh8bCC6RG9XW1IVHNqRQJumeGsu0HxfbAf2yB w/949DzueVCqQ/LT6VoJxdd11adQyJbHmTl/26BoU95uqUGUR1cZ1xTf74rqwE3GeNMo avG0MZMb0NkeUaCcBicwOgdtLDZchE9kXr/N8x/yh/UYbPzEHAOg6mVqnYoUxog1Ns7x ps8zE6VnMHcOQh6O4+sFbYfXmgjKfuukk61iWUcGw1SD0Y/Mg5+1mSj7H7hPSlGFx/OF lPEpsoULELMl6SPzbwrgkoQkUAHOOO0PohFhZooDelmUhleFcml1u/x4tr5dNFrC2Z23 onRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gqxlvNOWDV9hr2k6wp2sEqvXX+eOInePmGyjXAlesII=; b=pTID8X7NSqbnhEWZflHAfGvRANmwMSmefqq6d2vK1sTYUv5N7qArdGFC1ZwWTJR8u0 llnYo8Kmbr4dMYDuTCbaKl7gZ7sMwhYvmB39i3G68HjA8ey/Nb8G4GuBjR1rEHiQKznU URVef7DlUFMJEFCr5DBmq0zgsjpmFz9tgM9dDcMNRUDcsE+pavnqgxpZEiMBCkpVoTMx 4J452DSvGtOqqvbMPX+bbYFtdYswMTno4R9+9xiybIKUuUe4gKPirybDCCeNyCibSzDE V1n4ZXv5VyBWMXsgF1XuUFd+tVSVaXtmPn4LYkLSMBLJ8m41wHRLleiBESBN6HaF7DfX i8UQ== X-Gm-Message-State: APjAAAXd193y5j1gj5uoX55b6xCHIwoqwplntoSQzZ7Km08167HKzkYd /++6QcUtovzaW6YhOBnjBCwweOk3lHs= X-Google-Smtp-Source: APXvYqxHG+eaUeeIRJW/N3dTyIvXn8bbWleNM3xzwXbpItGFBo8OuGMwerrGQenxY09D2+vhQ4BJ4w== X-Received: by 2002:a17:906:19db:: with SMTP id h27mr9762389ejd.4.1555001623941; Thu, 11 Apr 2019 09:53:43 -0700 (PDT) Received: from [192.168.0.13] (cpc129954-hawk19-2-0-cust205.know.cable.virginm.net. [92.234.141.206]) by smtp.gmail.com with ESMTPSA id s24sm5096551edq.79.2019.04.11.09.53.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 09:53:42 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Crontab Question From: Richard Mackerras X-Mailer: iPad Mail (16E227) In-Reply-To: <5caf5d3d.1c69fb81.63ae1.ffd0@mx.google.com> Date: Thu, 11 Apr 2019 17:53:41 +0100 Cc: Walter Cramer , "freebsd-stable@freebsd.org" , Jonathan Chen Content-Transfer-Encoding: quoted-printable Message-Id: <36054B2F-3456-46C1-BE1A-FB90551E2AE7@gmail.com> References: <5cae4e6f.1c69fb81.95785.62bf@mx.google.com> <5cae5cc3.1c69fb81.15e0.dbd1@mx.google.com> <20190410172638.C14867@mulder.mintsol.com> <5caf5d3d.1c69fb81.63ae1.ffd0@mx.google.com> To: Software Info X-Rspamd-Queue-Id: 968B96E8B9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=tiJueW48; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mack63richard@gmail.com designates 2a00:1450:4864:20::52d as permitted sender) smtp.mailfrom=mack63richard@gmail.com X-Spamd-Result: default: False [-6.22 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[d.2.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.74)[ip: (-9.07), ipnet: 2a00:1450::/32(-2.39), asn: 15169(-2.19), country: US(-0.06)] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Apr 2019 16:53:47 -0000 In your script put a few commands outputting to a check file pwd > /tmp/checkfile Add a few more like=20 ENV >> /tmp/checkfile Just to make sure it really is in the directory you expect with the environm= ent you expect.=20 If you want it to be run as you never use the root crontab unless you want r= eally crap security.=20 Cheers Sent from my iPad > On 11 Apr 2019, at 16:29, Software Info wrote:= >=20 > Well thanks for all the input. I just have to tp keep working at it. Again= , much appreciated. >=20 >=20 > Regards > SI >=20 > Sent from Mail for Windows 10 >=20 > From: Walter Cramer > Sent: Wednesday, April 10, 2019 4:40 PM > To: Software Info > Cc: Jonathan Chen; freebsd-stable@freebsd.org > Subject: RE: Crontab Question >=20 >> On Wed, 10 Apr 2019, Software Info wrote: >>=20 >> OK. So although the script is located in my home directory, it doesn=C3=A2= =E2=82=AC=E2=84=A2t=20 >> start there? Sorry but I don=C3=A2=E2=82=AC=E2=84=A2t quite understand. C= ould you explain a=20 >> little further please? >=20 > Both 'cp' and 'ls' are located in /bin. But if I run the 'ls' command in=20= > /root, 'ls' can't find 'cp' (unless I tell it where to look) - even though= =20 > /bin *is* in my PATH - >=20 > server7:/root # ls cp > ls: cp: No such file or directory > server7:/root # ls /bin/cp > /bin/cp >=20 > Where the system looks for *commands*, to execute, is different from where= =20 > it looks for other files, which those commands use. The latter is=20 > generally only the current directory (unless you tell it otherwise).=20 > When cron runs a script as root, "current directory" will be /root. >=20 > BUT - for security and other reasons, it would be better to have cron run=20= > your script as you (not root), and as '/home/me/myscript' (instead of=20 > adding your home directory to PATH in /etc/crontab). >=20 > -Walter >=20 > _______________________________________________ > freebsd-stable@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"