S
S
Sergey2015-01-02 06:59:55
linux
Sergey, 2015-01-02 06:59:55

What are some good and easy solutions for running cron from php?

You need a ready-made library \ class \ script to work with cron from under php.
Do you recommend anything good? On ubuntu server if that matters.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2016-01-04
@butteff

Here is how I implemented it:

$output = shell_exec('crontab -l');
file_put_contents('/tmp/crontab.txt', $output.$rule.PHP_EOL);
echo exec('crontab /tmp/crontab.txt');

Where $rule is the command to be executed in the cron.

S
Saboteur, 2015-01-02
@saboteur_kiev

Refine your question. from PHP with cron usually don't work, it's from cron that work with PHP.

D
Denis Kotlyarov, 2015-01-02
@denisandroid

Hmm, I don’t know what to offer you, but this is Linux) there is a cron process there, it usually sits as root, what do you think it is intended for? I did not set up this process myself, but I think there are enough instructions on the Internet, such as this
help.ubuntu.ru/wiki/cron

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question