Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: Environment Variables?????

by muba (Priest)
on Jun 27, 2012 at 12:46 UTC ( #978644=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Environment Variables?????
in thread Environment Variables?????

Just set up an environment for the cron job that has all the information (and permissions and so on) it needs to run properly. I bet a lot of your personal environment information consists of stuff such as a customised PATH, a prompt (likely PS1, PS2 etc), maybe something to tell Perl to look into a directory in your HOME to look for modules (e.g. PERL_LIB = ~/perl5lib), maybe some stuff to auto-beautify the output of the ls command, yadayadayada. Does the cron job really need all that? Or could it live a happy life with just a minimal environment?


Comment on Re^4: Environment Variables?????
Re^5: Environment Variables?????
by mrguy123 (Hermit) on Jun 27, 2012 at 13:32 UTC
    I agree with you that my private environment information (which is alarmingly similar to what you described) is not very relevant for the cron job. In my case, however, I am working on a product where there are close to a 100 "public" env variables which are used widely in every program (they are stored in a different .cshrc file which is sourced by my private one).
    Therefore, the idea of updating a separate file each time I need to use a different env variable seems like a recipe for mistakes.
    So, do you think there is there an "in-between" solution or do we agree to disagree?
        Thanks!
        BTW, I meant "alarmingly" in good humor, but putting emoticons in parentheses in not so simple :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978644]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2015-07-06 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls