Cron command not working

Hi! On my server I created a cron.sh file that contains:

#!/bin/bash
php80 artisan schedule:run >> /dev/null 2>&1
echo done

The cron log file correctly returns “done” but the commands defined in registerSchedule were not executed.

public function registerSchedule($schedule)
{
    $schedule->command('cache:clear')->everyFiveMinutes();
}

Where is the problem?

I can’t use PHP instead of BASH because the server doesn’t allow using system/passthru/exec/shell functions.

The cron.sh and artisan files are in the same directory.

OC3 / PHP 8.0

Hi @Radek ,

Have you tried logging the execution to check what’s happening?

You can modify your script like this:

#!/bin/bash
php80 artisan schedule:run >> /path/to/cron_output.log 2>&1
echo done >> /path/to/cron_output.log

Hi @apinard ,
cron_output.log is empty