Someone else please let me know if this is right, but my understanding was that you w/could do something like the following in a crontab(5) for such a thing:

DBUILDER_DIR=/home/indy/source/dbuilder * */6 * * * $DBUILDER_DIR/scripts/spamburglar.pl

To my knowledge, you don't have to put an environment variable definition in a cron entry on the same line, but can put it above entries if it affects more than one, or is more readable that way. Then, in your code, I am thinking you w/could do something like:

unless (defined($ENV{'DBUILDER_DIR'})) { $ENV{'DBUILDER_DIR'} = '..'; } use lib "$ENV{'DBUILDER_DIR'}/lib";

I haven't used the use lib... pragma you are using before, but I hope this either proves helpful in itself, or results in a more knowledgable monk posting to correct my misunderstanding, enlightening us both. My best in your quest for this knowledge.


In reply to Re: A relative cron questions by atcroft
in thread A relative cron questions by bittondb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.