A
A
Alexey2016-02-09 00:55:18
linux
Alexey, 2016-02-09 00:55:18

Changing crontable with php?

There are several scripts in PHP. I would like to add tasks to cron on the site, through the admin panel, which would execute these scripts, after a certain time by me. I would also like to change the repetition time of the script execution, all the same through the admin panel. I can't find any information, is it possible to do this? I tried to write tasks in crontab by setting write permissions to all users, but as it turned out, cron stops seeing crontab after changing the rights.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tema_sun, 2016-02-09
@Feramon4ik

It seems to me like this:
edit a text file with the rules for cron through the admin panel, then do something like:
exec('crontab /path/to/file/crontab.txt');
The only thing you have to run php on behalf of the same user as the scripts in the crown.

Y
Yuri, 2016-02-09
@riky

in some cases (especially with limited rights in the system), it is more convenient to set up the launch of one script every minute, and already check whether something needs to be done in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question