in reply to safe to use system

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