Drupal Cron: Attempting to re-run cron while it is already running (solved with Drush + Cronjob)

Problem:

Attempting to re-run cron while it is already running.

 

Solution

Cronjob (hourly):

1     *       *       *       *       ...myscripts/my-drupal-cron.sh

 

my-drupal-cron.sh

#!/bin/bash
maindir="/var/www/mysite123"
logfile="$maindir/scripts/cron/logs/drush-cron--$(date +%Y-%m-%d-%H%M).log"

echo " START : $(date '+%Y-%m-%d %H:%M:%S') " >> "$logfile" 2>&1

cd $maindir
drush="php -c $maindir/drush.ini $maindir/vendor/drush/drush/drush"

$drush cron >> "$logfile" 2>&1


echo " END : $(date '+%Y-%m-%d %H:%M:%S') " >> "$logfile" 2>&1

 

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare