From owner-freebsd-stable@freebsd.org Fri Apr 12 05:58:30 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 638161573804 for ; Fri, 12 Apr 2019 05:58:30 +0000 (UTC) (envelope-from Willem@offermans.rompen.nl) Received: from cpsmtpb-ews10.kpnxchange.com (cpsmtpb-ews10.kpnxchange.com [213.75.39.15]) by mx1.freebsd.org (Postfix) with ESMTP id EFFCB8CE6E for ; Fri, 12 Apr 2019 05:58:18 +0000 (UTC) (envelope-from Willem@offermans.rompen.nl) Received: from cpsps-ews13.kpnxchange.com ([10.94.84.180]) by cpsmtpb-ews10.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Fri, 12 Apr 2019 07:58:11 +0200 X-Brand: 7abm2Q== X-KPN-SpamVerdict: e1=0;e2=0;e3=0;e4=(e4=10;e1=10;e3=10;e2=11);EVW:Whi te;BM:NotScanned;FinalVerdict:Clean X-CMAE-Analysis: v=2.3 cv=CfzZG4jl c=1 sm=1 tr=0 cx=a_idp_e a=4/rmT19p7yX2nqNQQg5uwQ==:117 a=4/rmT19p7yX2nqNQQg5uwQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=oexKYjalfGEA:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=5kunse5LzU4oOerN7HIA:9 a=QEXdDO2ut3YA:10 a=r_UuC3295I9e1owF-gsA:9 a=Nv6spcoC3aJsqdWb:21 a=_W_S_7VecoQA:10 a=IjZwj45LgO3ly-622nXo:22 X-CM-AcctID: kpn@feedback.cloudmark.com Received: from smtp.kpnmail.nl ([195.121.84.44]) by cpsps-ews13.kpnxchange.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Fri, 12 Apr 2019 07:58:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kpnmail.nl; s=kpnmail01; h=to:message-id:date:from:subject:mime-version:content-type; bh=lzM935rqCbQp4Sbj+s+UAkDkPdb2X/qeK4LojkZV7pw=; b=tBCjrAKxuK3YM03htRUAwOuuG+EAocz9Ak2K0PRvu7Che4lloM6xlvS2ITFYxlhqQIblgRVYMVleK 3xDNCXOpLMdS8iNqv9zUTo1XaYL5FRf9h9MXNBMwn9rKOdNDtH+ippCxsSUh7SXw9Nz4TDnyXCjIAy ySFd0m0soH7306rU= Received: from donald.offrom.nl (unknown [77.164.21.27]) by smtp.kpnmail.nl (Halon) with ESMTPS id f3c47cfc-5ce7-11e9-871b-005056abf0db; Fri, 12 Apr 2019 07:58:11 +0200 (CEST) Received: from [10.168.0.78] (winnie.vpn.offrom.nl [10.168.0.78]) by donald.offrom.nl (8.15.2/8.15.2) with ESMTPS id x3C5w8Kp067607 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Apr 2019 07:58:08 +0200 (CEST) (envelope-from Willem@Offermans.Rompen.nl) Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: Crontab Question From: Willem Offermans X-Priority: 3 In-Reply-To: <5cafc1dd.1c69fb81.8462d.ffaf@mx.google.com> Date: Fri, 12 Apr 2019 07:58:07 +0200 Cc: Richard Mackerras , Walter Cramer , "freebsd-stable@freebsd.org" , Jonathan Chen Message-Id: <70AAF9FB-A8E9-4E64-9A58-5F316DD7945B@Offermans.Rompen.nl> 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> <5cafc1dd.1c69fb81.8462d.ffaf@mx.google.com> To: Software Info X-Mailer: Apple Mail (2.3445.104.8) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on donald.offrom.nl X-OriginalArrivalTime: 12 Apr 2019 05:58:11.0548 (UTC) FILETIME=[B5ECF9C0:01D4F0F4] X-RcptDomain: freebsd.org X-Rspamd-Queue-Id: EFFCB8CE6E X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=kpnmail.nl header.s=kpnmail01 header.b=tBCjrAKx X-Spamd-Result: default: False [-4.05 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[kpnmail.nl:+]; MX_GOOD(-0.01)[donald.offermans.rompen.nl]; HAS_X_PRIO_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; IP_SCORE(-1.41)[ipnet: 213.75.0.0/17(-3.91), asn: 8737(-3.13), country: NL(0.01)]; ASN(0.00)[asn:8737, ipnet:213.75.0.0/17, country:NL]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[27.21.164.77.zen.spamhaus.org : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[kpnmail.nl:s=kpnmail01]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[Rompen.nl]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[15.39.75.213.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FREEMAIL_CC(0.00)[gmail.com] 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: Fri, 12 Apr 2019 05:58:30 -0000 Dear FreeBSD friends, Yes, specifying whole directories is a bit counterintuitive, but you get = used to it. To me it became part of crontab, with only a vague understanding of why. Probably all of us went through this process of incorporation once. Wiel Offermans Willem@Offermans.Rompen.nl > On 12 Apr 2019, at 00:38, Software Info = wrote: >=20 > Thanks so much for all the replies. It was true that I had to hardcode = every path but thankfully it is working now. Really appreciate the = assistance. >=20 >=20 > Kind Regards > SI >=20 >=20 >=20 > 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 >=20 > In your script put a few commands outputting to a check file >=20 > pwd > /tmp/checkfile >=20 > Add a few more like=20 >=20 > ENV >> /tmp/checkfile >=20 > Just to make sure it really is in the directory you expect with the = environment you expect.=20 >=20 > If you want it to be run as you never use the root crontab unless you = want really crap security.=20 >=20 > Cheers >=20 >=20 > Sent from my iPad >=20 >> 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. 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 = 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" >=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"