• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Plesk Laravel scheduler runs console app twice

vanherst

New Pleskian
I have added the Laravel scheduler as a scheduled task to Plesk see picture below

CdrFR.png


I have added the following lines to app\Console\Kernel.php.

$schedule->command('*********')->dailyAt('06:00')->evenInMaintenanceMode()->runInBackground()->withoutOverlapping(10)->emailOutputTo('info@*****.com');

Everythings looks fine but the job is running twice, I get the following email notifications:

1. Scheduled Job Output For ['/usr/bin/php7.4' 'artisan' ***********]
2. Scheduled Job Output For ['/opt/plesk/php/7.4/bin/php' 'artisan' ***********]

What have I done wrong?

Output of `crontab -l`:

MAILTO=""
SHELL="/bin/bash"
* * * * * cd /var/www/vhosts/*******.com/httpdocs && /opt/plesk/php/7.4/bin/php artisan schedule:run >> /dev/null 2>&1

And the same for root:
0 1 * * 1 /usr/local/psa/libexec/modules/watchdog/cp/secur-check
0 1 * * 1 /usr/local/psa/libexec/modules/watchdog/cp/send-report weekly
10 1 * * * /usr/local/psa/libexec/modules/watchdog/cp/clean-sysstats
15 1 * * * /usr/local/psa/libexec/modules/watchdog/cp/pack-sysstats day
15 1 * * 1 /usr/local/psa/libexec/modules/watchdog/cp/pack-sysstats week
15 1 1 * * /usr/local/psa/libexec/modules/watchdog/cp/pack-sysstats month
15 1 1 * * /usr/local/psa/libexec/modules/watchdog/cp/pack-sysstats year
20 1 * * * /usr/local/psa/libexec/modules/watchdog/cp/clean-events
0 3 * * 7 /usr/local/psa/libexec/modules/watchdog/cp/clean-reports
47 23 * * * /usr/sbin/ntpdate -b -s 2.pool.ntp.org

I did some more testing.
If I execute a function with $schedule->call() it is running once.
 
Back
Top