[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-gnubatch] Force reload env
From: |
Reuti |
Subject: |
Re: [help-gnubatch] Force reload env |
Date: |
Thu, 28 Jan 2016 22:42:10 +0100 |
Am 28.01.2016 um 22:19 schrieb Sun Ray:
> GNU batch calls my_script. It needs to know where the script is.
>
> I am sourcing .bashrc before calling my_script from gnu batch. But I don't
> want to do that.
Yep. Before starting GNU batch you adjust the $PATH to include /product/recent.
The symbolic link /product/recent will point to the actual version it should
find and can be adjusted when a new version is available. No need to reload any
environment.
BTW: for documentation reason you might want to include a line in your script
like:
echo $(readlink -f $(dirname $0))
which will output the physical path, not the symbolic one, and so it's clear
what version of the script was used for this run.
-- Reuti
> I want gnubatch to reload.
>
> On Thu, Jan 28, 2016 at 12:54 PM, Reuti <address@hidden> wrote:
> Hi,
>
> Am 28.01.2016 um 18:38 schrieb Sun Ray:
>
> > The path to the scripts that are run from GNU batch changes with every
> > release.
> >
> > For example, the script could be in /product/release.1/bin/myscript and
> > with another release next day, the script needs to be sourced from
> > /product/release.2/bin/myscript.
> >
> > $MY_SCRIPT_PATH=/product/release.1 today and it changes to
> > $MY_SCRIPT_PATH=/product/release.2 next day.
> >
> > So how do I force GNUbatch to find the right script path. This is affecting
> > us in production right now and any input is much appreciated.
>
> I can't test it with your particular set up, but what about handling it
> outside of GNU batch by having a path pointing to:
>
> MY_SCRIPT_PATH=/product/recent
>
> and recent is a symbolic link to the actual directory. After release.2 is
> tested, you can `ln -sfT release.2 recent` to adjust it.
>
> -- Reuti
>
>
> > On Thu, Jan 28, 2016 at 2:44 AM, Reuti <address@hidden> wrote:
> > Hi,
> >
> > > Am 28.01.2016 um 03:24 schrieb Sun Ray <address@hidden>:
> > >
> > > Hi,
> > >
> > > Is there a way to force GNUBatch to reload the env variables everytime it
> > > runs a scheduled job. I would like GNUBatch to source and reload .bashrc.
> > > Please let me know.
> >
> > just for curiosity: what's the rationale behind it?
> >
> > -- Reuti
> >
>
>