Skip to main content

Cron jobs not working

I am hosting my magento 2 shop at all-inkl and unfortunately I can only use a "cgi bridge" to call the cron.php via a web cron job.

I have built that bridge which looks like that:

<?php
exec("/bin/bash cron.php  2>&1", $out, $result);
echo "Returncode: " .$result ."<br>";
echo "Script:" ."<br>";
echo "<pre>"; print_r($out);
?>

my cron.php looks like that:

#~ MAGENTO START
* * * * * /usr/bin/php /www/htdocs/USER/magento2/bin/magento cron:run | grep -v Ran jobs by schedule >> /www/htdocs/USER/magento2/var/log/magento.cron.log
* * * * * /usr/bin/php /www/htdocs/USER/magento2/update/cron.php >> /www/htdocs/USER/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /www/htdocs/USER/magento2/bin/magento setup:cron:run >> /www/htdocs/USER/magento2/var/log/setup.cron.log
#~ MAGENTO END

But if I open the bridge file via my browser, I get this error:

Returncode: 127 Script: Array ( [0] => cron.php: line 2: /bin/grep: Permission denied

[1] => cron.php: line 2: CHANGELOG.md: command not found
[2] => cron.php: line 3: CHANGELOG.md: command not found
[3] => cron.php: line 4: CHANGELOG.md: command not found 

)

I have no idea how to get those cron jobs running.