I am developing an internal system for a company with PHP using Zend framework. I need one of its functions to execute on a time specified by user.
My research on this matter found me several ways of doing this using CPanel Cron jobs and setting up scheduled tasks on the server. But in this scenario, I don’t have a CPanel and I already use scheduled tasks. But my challenge is to provide an interface for the user to specify the time to trigger the function.
Any help on this is very much appreciated!! 🙂
You might store a ‘job’ in the database [ through the interface you have to provide ], and in Cron just execute script [ for example every minute ] that checks if there are any pending jobs and if their start_date is > now(). If so, execute it, otherwise do nothing. Don’t forget to mark them as complete to avoid running them many times:)