Answer the question
In order to leave comments, you need to log in
Are there sensible analogues of the AT task scheduler?
For some time I have been trying to find information on the topic, but so far to no avail.
The task is next.
There is a web application written in PHP and running on a Linux server. Everything is as usual.
The task is that I need to perform some tasks on a schedule. But to perform these tasks not regularly, but once, and I need to manage this through my application.
For example, I have a mechanism for delayed publication of news. The editor creates a news item and specifies the day and time that the news item should be published. Now I check the publication date when selecting, but this is not the best solution.
Knowing the publication date, I just need to run a script at a given time that will publish the news.
It is not reasonable to use cron for these purposes, because it will pull the application idle in 99% of cases. From all that I could dig up, this is the at utility . It seems to do exactly what I need.
Launch planning might look like:
shell_exec('at php news_publisher.php 12345 -t 201710271030');
Answer the question
In order to leave comments, you need to log in
cron is a perfectly reasonable solution. It is not necessary to run every minute - every hour or even less often is enough.
Even if it fails, then the load from a single query on indexed fields "publish all unpublished articles that have a publication date already" will be close to zero.
I also recommend celery, although it is written in python, there is a PHP client for it
www.celeryproject.org and https://github.com/gjedeer/celery-php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question