Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2011 16:48:34 -0700
From:      Kurt Buff <kurt.buff@gmail.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        FreeBSD Questions <questions@freebsd.org>
Subject:   Re: Probably working too hard for this cron question
Message-ID:  <BANLkTimicmztHixPSq3K1ByXPW_s8YeEcA@mail.gmail.com>
In-Reply-To: <20110614000258.c5cb84f3.freebsd@edvax.de>
References:  <BANLkTimD4DaYtvDmiJ4=qaj3CNsKr=XHNQ@mail.gmail.com> <BANLkTinCFMqGBx0jkbRH-J03wNkQaPOo7Q@mail.gmail.com> <BANLkTikJLpb-PQKWbuyX1F7GWzW1jMpirA@mail.gmail.com> <20110614000258.c5cb84f3.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 13, 2011 at 15:02, Polytropon <freebsd@edvax.de> wrote:
> On Mon, 13 Jun 2011 14:44:29 -0700, Kurt Buff <kurt.buff@gmail.com> wrote=
:
>> Per the handbook, I added
>>
>> =C2=A0 =C2=A0 =C2=A0SHELL=3D/bin/sh
>>
>> to crontab, and I also added
>>
>> =C2=A0 =C2=A0 =C2=A0#!/bin/sh
>>
>> as the first line in the script
>>
>> But, while a file is being created, it's just
>>
>> =C2=A0 =C2=A0 =C2=A0/root/-external1.txt
>>
>> not
>>
>> =C2=A0 =C2=A0 =C2=A0/root/2011-06-13-external1.txt
>
> Just a wild guess: How about adding {} to the variable
> identifiers? There are some restrictions in how far a
> character following the variable name will be treated
> as a "stop sign", e. g. variable x, literal y, and you
> have $xy which won't work, but $x_y may work, so you
> use ${x}y to make sure the name is properly scoped.
>
> Refering to your original script:
>
> #!/bin/sh
> 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
>
> Could you try that?

Can, and did, and it works like a champ. That solves the last issue.

<snip>

My thank to you Polytropon, and to those who replied privately.

Now all I have to do is pin down whether the name resolution slowness
is in our firewall, or web filter, or external router, or perhaps
something at the ISP.

Kurt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTimicmztHixPSq3K1ByXPW_s8YeEcA>