Anonymous Monk,
Not really a Perl question, but here goes.

Running these scripts from cron as root is usually not a good idea. You want to make sure the ownership/permissions on the scripts themselves are correct. Depending on what you mean by "ended without errors", you might be able to just get away with checking the exit status. On the other hand, the script may complete but still encounter problems.

If this is the case and you want to be sure it is safe to continue, here is how I would do it:

  • Have cron delete the "ok-#" files before calling the first script
  • Have the first script's last item of business be to create the "ok-1" file
  • Have the second script exit if the "ok-1" script doesn't exist
  • Have the second script's last item of business be to create the "ok-2" file
  • Have the third script exit if the "ok-2" script doesn't exist.
  • Have the third script's last item of business be to create the "ok-3" file
  • Have cron check for the existance of all 3 "ok" files and email you with either "success" or "failure"

    Now this method is not without gotchas. Perhaps the script ran fine but couldn't create the "ok" file. Maybe someone deleted it during the window of opportunity (after the first script created it and the next script read it).

    Cheers - L~R


    In reply to Re: safe to use system by Limbic~Region
    in thread safe to use system by Anonymous Monk

    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.