Hi folks,
I'm looking for advice on how to best run some bash and php scripts together, as seamlessly as possible. I had originally intended to write all these as PHP functions, but discovered bash was more efficient for part of the total process I wanted.
I have 1 bash script that runs in this manner:
run script 1
(error checking in script 1)
if fails, write to log;
else
run script 2
(error checking in script 2)
if fails, write to log
done
if log is generated, mail it as an attachment
I then have 2 PHP files set up in the following way:
script 1
calls function1.php (does error checking, write to log)
if fails, call error() function (mails generated log as attachment)
else
calls function2.php (does error checking, writes to log)
if fails, call error() function (mails generated log as attachment)
The bash scripts need to run successfully before the PHP scripts run. Would it be best to call the PHP script from my main bash script, or call bash scripts from my main PHP script? Either way, I need to check that the bash script runs before executing the other.
Thanks,
Eve