Probably working too hard for this cron question

Kurt Buff kurt.buff at gmail.com
Mon Jun 13 23:48:35 UTC 2011


On Mon, Jun 13, 2011 at 15:02, Polytropon <freebsd at edvax.de> wrote:
> On Mon, 13 Jun 2011 14:44:29 -0700, Kurt Buff <kurt.buff at gmail.com> wrote:
>> Per the handbook, I added
>>
>>      SHELL=/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
>
> 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=`/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


More information about the freebsd-questions mailing list