I've tried to pass the following command line to Symfony Process component according to Symfony documentation:
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
$process = new Process(['cat crons/* | crontab -']);
$process->run();
and also the following:
$process = new Process(['cat crons/*', '|', 'crontab -']);
and:
['cat crons/*', '|', 'crontab', '-']
but it doesn't work, it rises an exception:
The command "'cat /var/www/config/crontab/* | crontab -'" failed.
Exit Code: 127(Command not found)
Working directory: /var/www
Output:
================
Error Output:
================
sh: exec: line 1: cat /var/www/config/crontab/* | crontab -: not found
Have anyone a solution please ?