From owner-freebsd-stable@freebsd.org Thu Apr 11 22:38:24 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 E81F3156C44F for ; Thu, 11 Apr 2019 22:38:23 +0000 (UTC) (envelope-from softwareinfojam@gmail.com) Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) (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 55D318152A for ; Thu, 11 Apr 2019 22:38:22 +0000 (UTC) (envelope-from softwareinfojam@gmail.com) Received: by mail-ua1-x931.google.com with SMTP id l22so2592524uao.8 for ; Thu, 11 Apr 2019 15:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:cc:from:subject:date:importance :in-reply-to:references; bh=1nYLS+Gy4UtqASltsQnfYdWvdSBYZO2kqRfMcFkLL+o=; b=H+vVBaPVP2dnzK+iM/OyGNg+/ubX+zguixjK0CB02GsySMDChEriyQNtZ05cvLTPgW Ox+L5kUQadUG269pTMjf90Jogi/1Ns8neiB+4KLCKP1ceGFNosUKZ7ar0NxtX3XcMhIc 1hytqWNIwX+NkWA1OUipoCs+LG+2UvlDooF2Cf5k6LpSbvJu5pCkAUBBmPvYPyYIstDI 47FVI80VvrLf1Bbvc6bFiWj0SHTzF+R5rb3R+qVjgYw/oq08yB0PBLaL9d2iJy52saDH tQzseSCsc4IV3jjrK+xCRrJMPpmG1ONl4CYTcctIoqughMiwL/nCEw8pEXVGRdBNh0IL 4jLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:cc:from:subject:date :importance:in-reply-to:references; bh=1nYLS+Gy4UtqASltsQnfYdWvdSBYZO2kqRfMcFkLL+o=; b=VZzLXab1BkxXz/t/P7L3KlXTJ8zaMoEaLBXftNT25NKQTsxwsNeflDmj6aOf724J+J lkn891B5Cx0c+WXuQVt8AZ5359npuwO+v8A2hspzYxZzcBl1fej7DRvWaRXoMxhRkX3Z u1rIqUfjfImXixm6E3RpVEI6M5WaPv1jsS+x1d7CYEtpaH3GoNrb0ZKyj+Z7zmWidhD3 fpMpYIjQle95ZfhQFEQ9sxaMvudt6eDe3C6V11VaIqe9Fy2SjxybUBtqfdEyNzMHC+HG Y6Z8fXX7iiLI8y5XCqmmdwCUg8lZamx95V/zusmjfJ9lPBRRBh1HQ0W0Mbv74MTu3Dtc fGJg== X-Gm-Message-State: APjAAAUgVGZyBlUzSFza7ptI0RlBQX4rLPIgKAKrgvPO1M2HbVqwqXVD uNP8FX3itgeVrhwo4GkhzzA= X-Google-Smtp-Source: APXvYqw+b7E7TUlizaoFngADGU/ZvzbeGHyT2fPFWDx12AX3HAgvzKubuXhhwyPbfIeqU9iwgXnpZw== X-Received: by 2002:a9f:3c01:: with SMTP id u1mr28547070uah.19.1555022301684; Thu, 11 Apr 2019 15:38:21 -0700 (PDT) Received: from ?IPv6:::ffff:192.10.1.119? (git.mayberryinv.com. [63.143.111.202]) by smtp.gmail.com with ESMTPSA id h78sm4828185vka.48.2019.04.11.15.38.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 15:38:21 -0700 (PDT) Message-ID: <5cafc1dd.1c69fb81.8462d.ffaf@mx.google.com> MIME-Version: 1.0 To: Richard Mackerras Cc: Walter Cramer , "freebsd-stable@freebsd.org" , Jonathan Chen From: Software Info Subject: RE: Crontab Question Date: Thu, 11 Apr 2019 17:38:21 -0500 Importance: normal X-Priority: 3 In-Reply-To: <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> <36054B2F-3456-46C1-BE1A-FB90551E2AE7@gmail.com> X-Rspamd-Queue-Id: 55D318152A X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=H+vVBaPV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of softwareinfojam@gmail.com designates 2607:f8b0:4864:20::931 as permitted sender) smtp.mailfrom=softwareinfojam@gmail.com X-Spamd-Result: default: False [-3.76 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(0.00)[+ip6:2607:f8b0:4000::/36]; URI_COUNT_ODD(1.00)[1]; RCVD_COUNT_THREE(0.00)[3]; RBL_SEM_IPV6(1.00)[1.3.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.bl.ipv6.spameatingmonkey.net]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; HAS_X_PRIO_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_LAST(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)[-0.995,0]; R_DKIM_ALLOW(0.00)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.3.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.85)[ip: (-9.05), ipnet: 2607:f8b0::/32(-2.95), asn: 15169(-2.18), country: US(-0.06)] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 22:38:24 -0000 Thanks so much for all the replies. It was true that I had to hardcode ever= y path but thankfully it is working now. Really appreciate the assistance. Kind Regards SI From: Richard Mackerras Sent: Thursday, April 11, 2019 11:53 AM To: Software Info Cc: Walter Cramer; freebsd-stable@freebsd.org; Jonathan Chen Subject: Re: Crontab Question 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 environ= ment you expect.=20 If you want it to be run as you never use the root crontab unless you want = really 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. Agai= n, 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.= Could 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 thoug= h=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 wher= e=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"