Best way to do Schedule PHP [duplicate]

0

Good Morning, Personal

I have a GSM PUSH panel for sending notifications of android apps is already working perfectly, however now there has been a need to schedule push messages.

I thought of doing a routine that keeps checking every 30 seconds if it has a record with the submission date less than or equal to the date of now, then register in the CRON task of the Cpanel.

Would that be the best alternative?

I would like you to have the same options as Cron, scheduling an event now or repeating according to the pre-set configuration.

Do you know if you already have something like this?

    
asked by anonymous 13.01.2017 / 14:29

1 answer

3

Scheduling for PHP via CRON (crontab) is the way I've been using it for some time, and with no headaches.

I can not say if there is any better way, maybe I have, but I can state that the PHP schedules called through CRON work well.

Remember that the range definition will be set in CRON and not in SCRIPT.

To follow your default PHP settings, it is important to inform the path of your php.ini on the CRON line.

php -c /etc/php/php.ini /path/seu_script.php
    
13.01.2017 / 14:45