This topic is locked

Cron Jobs

6/7/2019 3:34:26 PM
PHPRunner General questions
T
Tempus_Erus author

Hi
This may be an age old question, however I think there is much written - much with conflicting arguments.
I like others are quite capable of running basic cronjobs. A simple email report would be an example.
As PHPRunner has improved immeasurably so has the demand for reporting.
Example: I have a particular requirement for 100 students, each with say 20 courses associated with said students. I need to periodically report into an email expiry dates of all 100 students.
Looping a script 100 times (the students) with each loop containing 20 loops (courses) to test the expiry date course is not efficient. What is best practice or what do people recommend?
Keeping this in mind, what is the best way to handle cronjobs within Phprunner. A custom script is not an issue but would need to be secure(I can easily do).I can secure a custom page of code using PHP but of course you would need to be logged in ???...I would not want to call the script from an outside source....
Any pointers and ideas would be great.
Look forward to some ideas!
Adrian

admin 6/7/2019

I don't really see anything PHPRunner related here. There is no UI. Run a custom script, loop though all students and for each student loop through their courses. Send a single email to each student with their info. Use a cron job to run it on a timely fashion. You don't even need to access this script from the outside, just run it as a regular PHP file from the command line.