File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ install_if_not apt-transport-https
158
158
# Install build-essentials to get make
159
159
install_if_not build-essential
160
160
161
+ # Needed for cron(tab)
162
+ install_if_not cron
163
+
161
164
# Set DNS resolver
162
165
# https://unix.stackexchange.com/questions/442598/how-to-configure-systemd-resolved-and-systemd-networkd-to-use-local-dns-server-f
163
166
while :
@@ -522,10 +525,10 @@ mv "$PHP_POOL_DIR"/www.conf "$PHP_POOL_DIR"/www.conf.backup
522
525
restart_webserver
523
526
524
527
# Force wp-cron.php (updates WooCommerce Services and run Scheluded Tasks)
525
- if [ -f " $WPATH /wp-cron.php" ]
528
+ if [ -f " $WPATH /wp-cron.php" ] && [ -f $WPATH /wp-cli.yml ]
526
529
then
527
530
chmod +x " $WPATH /wp-cron.php"
528
- crontab -u www-data -l | { cat; echo " 14 */1 * * * php -f $WPATH /wp- cron.php > /dev/null 2>&1" ; } | crontab -u www-data -
531
+ crontab -u www-data -l | { cat; echo " 14 */1 * * * wp cron event run --due-now --path='/var/www/html/wordpress' > 2>&1" ; } | crontab -u www-data -
529
532
fi
530
533
531
534
# Install Figlet
You can’t perform that action at this time.
0 commit comments