ash , exporting env vars

Loïc Grenié loic.grenie at gmail.com
Mon Jul 5 19:09:42 UTC 2010


2010/7/5  <beebee at piments.com>:
> On 07/05/10 17:47, Denys Vlasenko wrote:
>>
>> On Mon, Jul 5, 2010 at 5:09 PM,<beebee at piments.com>  wrote:
> Huh? The following line has been working for two years.
>
> 00,15,30,45 * * * * cd /www/apache/cgi-bin/ && gnuplot test.gnu
>
> cd is BB as is the shell, what's the difference?

    The command 'cd /www && gnuplot' is executed by a single shell.

> man cron gives the following example:
>
>       5 4 * * sun     echo "run at 5 after 4 every sunday"
>
> What do you mean by "not a cron command"?

    The "export" is a shell internal command, there is no /usr/bin/export
  while there is a /usr/bin/echo.

>> I don't understand what do you want to do. You want to set
>> DELAY env var to 16 - *in which process*? In cron?
>> That's not possible to do from a cron job.
>>
>> Cron job is a child of cron.
>>
>> A process can only change its own environment, and control
>> what environment is passed to a newly created child.
>> It can't change environment of another already
>> running process (even if that process is its child).
>>
>> Can you describe a "bigger" problem you are trying to solve,
>> since it looks like you are doing it all wrong.
>>
>
> Sorry if the the crontab was confusing. I made it as short as possible to
> test it. This is not the end objective !
>
> in essence I want something like this:
>
> 00,15,30,45 * * * * source /usr/local/bin/cron_plot_delay.sh &&  gnuplot
> test.gnu
>
> I think using source should do it , my problem seems to be the crontab is
> not getting run.

00,15,30,45 * * * * env DELAY=16 gnuplot test.gnu

   should solve your environment problem. As for the "cron not starting"
  I don't know.

        Hope this helps,

              Loïc


More information about the busybox mailing list