Automatic backups on password protected site with disabled wp-cron
-
Hi there,
I wonder how the scheduled automatic backups work with Updraft when wp-cron is disabled.
define('DISABLE_WP_CRON', true);
WP_CRON is disabled for a reason, as I am using Updraft on a development site which is password protected via .htaccess
Hence, I think WP_CRON won’t be triggered anyway as there won’t be any visitors on the site.
I researched and found two approaches, I am not sure which one is valid or to prefer
First
Add a PHP script to the root folder with a minimum of 705 permission and run the script e.g.runupdraftbackup.php
via server cron on a daily basis<?php
define(‘UPDRAFTPLUS_CONSOLELOG’, true);
define(‘DOING_CRON’, true);
require_once(‘wp-load.php’);
do_action(‘updraft_backupnow_backup_all’, array(‘nocloud’ => 1));
?>Second
Just run wp-cron via server cron by adding this line to the server cron.
I am not sure if I fully understand it, it sounds to me as every task that is scheduled within wp-cron will be run this waywget -q -O - https://dev.mysite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Thanks in advance for your help
best regards
Markus
- The topic ‘Automatic backups on password protected site with disabled wp-cron’ is closed to new replies.