From owner-freebsd-questions@FreeBSD.ORG Mon Jun 13 21:44:31 2011 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A63106566B for ; Mon, 13 Jun 2011 21:44:31 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A23C58FC08 for ; Mon, 13 Jun 2011 21:44:30 +0000 (UTC) Received: by wyf23 with SMTP id 23so5345960wyf.13 for ; Mon, 13 Jun 2011 14:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=+bXpjeqfuR/VhraMf00kR1POc9oWSGpAXYRleYwao4I=; b=o6Fc56udWV8O4Zw8Z9ja3uVrCn4Ktk09B08mvGpzbyJaemE77tTjW8q+kWPn3zy2xa z9yXs0IQzpUncsDc20+qdvoC+aiqXL3CwMXOn6XKcC1uI9OIHMXPhslBQNvgPgdWY2T4 E0ccD/4fqCzQW9Nl66psrOf1/E7iv6i8Vrtzw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lBD2PyYrPUNKzpA0Jxksva1g2XnEYfEYyawjfBin/KjeTldpiyfGMbB1hlFyQpkzz6 mA5xXadY1zt8vVcCihAfbxTQGbeAdtz/wLXEnv3tsBM/VqTBioYGM+ozLbO1aVdQMDaZ dJH25zUiEf3xn5L6KTA1b4LD0cITGGSWnhHqY= MIME-Version: 1.0 Received: by 10.216.231.89 with SMTP id k67mr5372606weq.113.1308001469509; Mon, 13 Jun 2011 14:44:29 -0700 (PDT) Received: by 10.216.46.7 with HTTP; Mon, 13 Jun 2011 14:44:29 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Jun 2011 14:44:29 -0700 Message-ID: From: Kurt Buff To: FreeBSD Questions Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: Probably working too hard for this cron question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 21:44:31 -0000 On Mon, Jun 13, 2011 at 13:25, pete wright wrote: > On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff wrote: >> All, >> >> I've googled a bunch, read some freebsd.org docs, and just can't >> figure this out. >> >> I have a script that should read the current date into a variable, >> append the time/date stamp at the beginning of the file created with >> the date in the variable, do a bunch of cURL stuff, then append a >> time/date stamp at the end of the file. >> >> It works if I run it manually, but not from cron. >> >> Here are the batchfile and the cron entry: >> >> ----------begin script---------- >> dt=3D`/bin/date "+%Y-%m-%d"` >> /bin/date > /root/$dt-external1.txt >> /usr/local/bin/curl -K /root/urls.txt >> /root/$dt-external1.txt >> /bin/date >> /root/$dt-external1.txt >> ----------end script---------- >> >> ----------begin crontab---------- >> 15 12 * * * =C2=A0 =C2=A0 =C2=A0 =C2=A0/root/do-curl.sh >> ----------end crontab---------- >> >> I'm doing all of this as root, as you can see. >> >> The job launches - I can see an entry for cURL in top - but no file in /= root. >> >> I've tried several variations on the first line of the script, but I'm >> getting nowhere, though I'm sure it's something stupidly simple that >> I'm missing. >> >> What am I missing? > > #!/bin/sh ? Definitely closer... Per the handbook, I added SHELL=3D/bin/sh to crontab, and I also added #!/bin/sh as the first line in the script But, while a file is being created, it's just /root/-external1.txt not /root/2011-06-13-external1.txt Kurt