From owner-freebsd-questions@FreeBSD.ORG Mon Jun 13 20:55:51 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 3F94A106566C for ; Mon, 13 Jun 2011 20:55:51 +0000 (UTC) (envelope-from nomadlogic@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id F02D58FC0A for ; Mon, 13 Jun 2011 20:55:50 +0000 (UTC) Received: by gxk28 with SMTP id 28so4503248gxk.13 for ; Mon, 13 Jun 2011 13:55:50 -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:cc:content-type :content-transfer-encoding; bh=WOQ2JQtpEbYcCaMCVICvgR8uEeioAFhsrSg4G/apXRo=; b=HjEvd3FFFMU5f03GI9YTixh9HEtKojCFPlVcci9TM7cTrfv62rcSxxDmVVzh+QY+mL D9kT+NR6BILtcFtpChFObaTr31zMpRyyu43LxD0EMA6AQoA+8AymLjTP5gol3UbPaDTd lWAE6gQ2WoL88PVFrna6pcqPlkTG+ag2vL/CQ= 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 :cc:content-type:content-transfer-encoding; b=BKcH9b7HLtnvLjaQh3O6pAOrEIzUU4gX2FHWUaMu5lfPlCE43rKjHi3K7xLffsih2y VOL/+LJfv/1DKoale7Il+iDEz8zMn5c7yuUkSFcKETacItgDISFblgK+p1blwTprI47S UGxdWprYtN+f3LrPJn5UdLeSbZjgMgWcFbVXQ= MIME-Version: 1.0 Received: by 10.236.80.105 with SMTP id j69mr7784249yhe.428.1307996729302; Mon, 13 Jun 2011 13:25:29 -0700 (PDT) Received: by 10.236.103.232 with HTTP; Mon, 13 Jun 2011 13:25:29 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Jun 2011 13:25:29 -0700 Message-ID: From: pete wright To: Kurt Buff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Questions 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 20:55:51 -0000 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 * * * =A0 =A0 =A0 =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 /r= oot. > > 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 ? -pete --=20 pete wright www.nycbug.org