From e0c043ffb08ea83a31978c28d34d411492130c67 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 31 Dec 2020 16:08:30 +0100 Subject: [PATCH] Fix cron --- conf/wp-config.php | 3 +++ scripts/actions/reset_default_app | 4 ++-- scripts/change_url | 7 ------- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/conf/wp-config.php b/conf/wp-config.php index f53900b..12c8c7e 100644 --- a/conf/wp-config.php +++ b/conf/wp-config.php @@ -18,6 +18,9 @@ * @package WordPress */ +/** Disable the wordress cron because it's managed by the system */ +define('DISABLE_WP_CRON', true); + // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', '__DB_USER__'); diff --git a/scripts/actions/reset_default_app b/scripts/actions/reset_default_app index fd1ab8d..1af95b8 100755 --- a/scripts/actions/reset_default_app +++ b/scripts/actions/reset_default_app @@ -66,8 +66,8 @@ yunohost app action run $app reset_default_phpfpm # CREATE A CRON TASK FOR AUTOMATIC UPDATE #================================================= -echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal wordpress cron. -0 3 * * * root wget -q -O - https://$domain$path_url/wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app +echo "# Reach everyday wp-cron.php to trig the internal WordPress cron. +0 3 * * * $app php$phpversion $final_path/wp-cron.php" > /etc/cron.d/$app #================================================= # SECURE FILES AND DIRECTORIES diff --git a/scripts/change_url b/scripts/change_url index 1990e6e..44af2d5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -123,13 +123,6 @@ db_prefix=$(grep '^$table_prefix' "$final_path/wp-config.php" | sed "s/.*'\(.*\) ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='siteurl'" --database=$app ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='home'" --database=$app -#================================================= -# UPDATE THE CRON -#================================================= - -echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal wordpress cron. -0 3 * * * root wget -q -O - https://$new_domain$new_path/wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app - #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/install b/scripts/install index e4c6c69..ff4d8f6 100644 --- a/scripts/install +++ b/scripts/install @@ -228,8 +228,8 @@ ynh_store_file_checksum --file="$final_path/wp-config.php" # CREATE A CRON TASK FOR AUTOMATIC UPDATE #================================================= -echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal WordPress cron. -0 3 * * * root wget -q -O - https://$domain$path_url/wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app +echo "# Reach everyday wp-cron.php to trig the internal WordPress cron. +0 3 * * * $app php$phpversion $final_path/wp-cron.php" > /etc/cron.d/$app #================================================= # GENERIC FINALISATION diff --git a/scripts/upgrade b/scripts/upgrade index 4df9b47..a104e38 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -263,8 +263,8 @@ ynh_store_file_checksum --file="$final_path/wp-config.php" # CREATE A CRON TASK FOR AUTOMATIC UPDATE #================================================= -echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal wordpress cron. -0 3 * * * root wget -q -O - https://$domain$path_url/wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app +echo "# Reach everyday wp-cron.php to trig the internal WordPress cron. +0 3 * * * $app php$phpversion $final_path/wp-cron.php" > /etc/cron.d/$app #================================================= # GENERIC FINALISATION