Bretheren

So with scripts in crontab, you are supposed to explicit paths. But whats a good way to specify the path to a config file?

In a previous thread it was noted that I had several versions of a script running and that I running a single script (or links from a single script) and using config files to differentiate.

Well only 2 scripts of the 4 were copies of each other, but I see the wisdom in centerally locating them and maintaining one piece of code. (also, the wisdom of using distinct script names :) I found a sub for reading java style properties into a hash and added it to my local Utils package. Now I'm wondering what the SOP is for getting the conf file to the cron script.

I suppose this is a style thing, but it seems kind of hokey to hardcode a config path into it (I'm passing the node name to use as the finally subdir). I was wondering if I could assume the directory was local to the script once it was running or if I should just specify the full path and file name as an option on the commandline.

Thanks!


a ravenous Jimbus mumbles, "Never moon a werewolf!"

PS: I've been following the seeker's page for a couple days and I think its superb that you guys can/will tackle anything. I've yet to see anyone left hanging. I use other forums for differnt products and sometimes it like they saw me coming and left. (insert witty barb here) I wonder sometimes if I have issues communicating or I'm that out of touch with the intended usage of the product... anyhow, thanks again.


In reply to Of crontab and paths by jimbus

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.